Merge "sal-remoterpc-connector: sync ch.qos.logback:logback-classic version"
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / java / org / opendaylight / controller / sal / restconf / impl / test / RestGetAugmentedElementWhenEqualNamesTest.java
1 package org.opendaylight.controller.sal.restconf.impl.test;
2
3 import static org.junit.Assert.assertEquals;
4 import static org.junit.Assert.assertFalse;
5
6 import java.io.FileNotFoundException;
7 import java.io.UnsupportedEncodingException;
8 import java.net.URISyntaxException;
9
10 import org.junit.Ignore;
11 import org.junit.Test;
12 import org.opendaylight.controller.sal.restconf.impl.ControllerContext;
13 import org.opendaylight.controller.sal.restconf.impl.InstanceIdWithSchemaNode;
14 import org.opendaylight.controller.sal.restconf.impl.ResponseException;
15 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
16
17 public class RestGetAugmentedElementWhenEqualNamesTest {
18
19     @Ignore
20     @Test
21     public void getDataWithUrlMountPoint() throws UnsupportedEncodingException, URISyntaxException,
22             FileNotFoundException {
23         boolean exceptionCaught = false;
24
25         SchemaContext schemaContextTestModule = TestUtils.loadSchemaContext("/common/augment/yang");
26         ControllerContext controllerContext = ControllerContext.getInstance();
27         controllerContext.setSchemas(schemaContextTestModule);
28
29         try {
30             InstanceIdWithSchemaNode instanceIdentifierA = controllerContext
31                     .toInstanceIdentifier("main:cont/augment-main-a:cont1");
32             InstanceIdWithSchemaNode instanceIdentifierB = controllerContext
33                     .toInstanceIdentifier("main:cont/augment-main-b:cont1");
34
35             assertEquals("ns:augment:main:a", instanceIdentifierA.getSchemaNode().getQName().getNamespace().toString());
36             assertEquals("ns:augment:main:b", instanceIdentifierB.getSchemaNode().getQName().getNamespace());
37         } catch (ResponseException e) {
38             exceptionCaught = true;
39         }
40
41         assertFalse(exceptionCaught);
42
43     }
44
45 }