1 package org.opendaylight.controller.sal.restconf.impl.test;
3 import static org.junit.Assert.assertEquals;
4 import static org.junit.Assert.assertFalse;
6 import java.io.FileNotFoundException;
7 import java.io.UnsupportedEncodingException;
8 import java.net.URISyntaxException;
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;
17 public class RestGetAugmentedElementWhenEqualNamesTest {
21 public void getDataWithUrlMountPoint() throws UnsupportedEncodingException, URISyntaxException,
22 FileNotFoundException {
23 boolean exceptionCaught = false;
25 SchemaContext schemaContextTestModule = TestUtils.loadSchemaContext("/common/augment/yang");
26 ControllerContext controllerContext = ControllerContext.getInstance();
27 controllerContext.setSchemas(schemaContextTestModule);
30 InstanceIdWithSchemaNode instanceIdentifierA = controllerContext
31 .toInstanceIdentifier("main:cont/augment-main-a:cont1");
32 InstanceIdWithSchemaNode instanceIdentifierB = controllerContext
33 .toInstanceIdentifier("main:cont/augment-main-b:cont1");
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;
41 assertFalse(exceptionCaught);