blob: 21c602ce0be9df5f42ae23d491ab02c8ef0c2e24 [file] [log] [blame]
chengfan9d60b6e2016-12-01 11:06:39 +08001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
chengfan9d60b6e2016-12-01 11:06:39 +08003 *
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
17package org.onosproject.provider.te.utils;
18
19import org.junit.Before;
20import org.junit.Test;
21import org.onosproject.yms.ych.YangCompositeEncoding;
22
23import static org.junit.Assert.assertEquals;
24import static org.onosproject.yms.ych.YangResourceIdentifierType.URI;
25
26/**
27 * Unit test for YangCompositeEncodingImpl.
28 */
29public 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}