X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-rest-connector%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Frestconf%2Fimpl%2Fjson%2Fto%2Fcnsn%2Ftest%2FJsonLeafrefToCnSnTest.java;h=4705de33df6eab1a53a269389cc5f6bfd2d2a08a;hb=81236f34ad88ffcb71c8d7cdb15b82bad2e50251;hp=bdd74e8f9617a634235814304f21a3362eefeb6f;hpb=c22efb3a8955c6562f95915b69fbdbf1ff4e4f11;p=controller.git diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/json/to/cnsn/test/JsonLeafrefToCnSnTest.java b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/json/to/cnsn/test/JsonLeafrefToCnSnTest.java index bdd74e8f96..4705de33df 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/json/to/cnsn/test/JsonLeafrefToCnSnTest.java +++ b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/json/to/cnsn/test/JsonLeafrefToCnSnTest.java @@ -7,51 +7,14 @@ */ package org.opendaylight.controller.sal.restconf.impl.json.to.cnsn.test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - import org.junit.BeforeClass; -import org.junit.Test; -import org.opendaylight.controller.sal.rest.impl.JsonToCompositeNodeProvider; -import org.opendaylight.controller.sal.restconf.impl.test.TestUtils; import org.opendaylight.controller.sal.restconf.impl.test.YangAndXmlAndDataSchemaLoader; -import org.opendaylight.yangtools.yang.data.api.CompositeNode; -import org.opendaylight.yangtools.yang.data.api.Node; -import org.opendaylight.yangtools.yang.data.api.SimpleNode; public class JsonLeafrefToCnSnTest extends YangAndXmlAndDataSchemaLoader { @BeforeClass public static void initialize() { - dataLoad("/json-to-cnsn/leafref"); - } - - /** - * JSON values which represents leafref are always loaded to simple node as string - */ - @Test - public void jsonIdentityrefToCompositeNode() { - Node node = TestUtils.readInputToCnSn("/json-to-cnsn/leafref/json/data.json", false, - JsonToCompositeNodeProvider.INSTANCE); - assertNotNull(node); - TestUtils.normalizeCompositeNode(node, modules, searchedModuleName + ":" + searchedDataSchemaName); - - assertEquals("cont", node.getNodeType().getLocalName()); - - SimpleNode lf2 = null; - assertTrue(node instanceof CompositeNode); - for (Node childNode : ((CompositeNode) node).getValue()) { - if (childNode instanceof SimpleNode) { - if (childNode.getNodeType().getLocalName().equals("lf2")) { - lf2 = (SimpleNode) childNode; - break; - } - } - } - - assertNotNull(lf2); - assertEquals(121, lf2.getValue()); + dataLoad("/json-to-cnsn/leafref",2,"leafref-module","cont"); } }