chengfan | 9d60b6e | 2016-12-01 11:06:39 +0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Foundation |
chengfan | 9d60b6e | 2016-12-01 11:06:39 +0800 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package org.onosproject.provider.te.utils; |
| 18 | |
| 19 | import org.junit.Before; |
| 20 | import org.junit.Test; |
| 21 | import org.onosproject.yms.ych.YangCompositeEncoding; |
| 22 | |
| 23 | import static org.junit.Assert.assertEquals; |
| 24 | import static org.onosproject.yms.ych.YangResourceIdentifierType.URI; |
| 25 | |
| 26 | /** |
| 27 | * Unit test for YangCompositeEncodingImpl. |
| 28 | */ |
| 29 | public class YangCompositeEncodingImplTest { |
| 30 | |
| 31 | private YangCompositeEncoding encode; |
| 32 | private static final String RES_ID = "/restconf/data/ietf"; |
| 33 | private static final String RES_INFO = "tunnel"; |
| 34 | private static final String C_FAILED = "Construct failed: "; |
| 35 | |
| 36 | @Before |
| 37 | public void setup() { |
| 38 | encode = new YangCompositeEncodingImpl(URI, |
| 39 | RES_ID, |
| 40 | RES_INFO); |
| 41 | |
| 42 | } |
| 43 | |
| 44 | @Test |
| 45 | public void testConstruction() { |
| 46 | assertEquals(C_FAILED + "type", URI, encode.getResourceIdentifierType()); |
| 47 | assertEquals(C_FAILED + "id", RES_ID, encode.getResourceIdentifier()); |
| 48 | assertEquals(C_FAILED + "info", RES_INFO, encode.getResourceInformation()); |
| 49 | } |
| 50 | } |