Merge "BUG 2854 : Do not add empty read write transactions to the replicable journal"
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / java / org / opendaylight / controller / sal / restconf / impl / json / to / cnsn / test / JsonLeafrefToCnSnTest.java
index 913e9f2d707bd310feb103313d53d5c8a83928df..4705de33df6eab1a53a269389cc5f6bfd2d2a08a 100644 (file)
@@ -7,52 +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() {
-        CompositeNode compositeNode = TestUtils.readInputToCnSn("/json-to-cnsn/leafref/json/data.json", false,
-                JsonToCompositeNodeProvider.INSTANCE);
-        assertNotNull(compositeNode);
-        TestUtils.normalizeCompositeNode(compositeNode, modules, searchedModuleName + ":" + searchedDataSchemaName);
-
-        assertEquals("cont", compositeNode.getNodeType().getLocalName());
-
-        SimpleNode<?> lf2 = null;
-        for (Node<?> childNode : compositeNode.getValue()) {
-            if (childNode instanceof SimpleNode) {
-                if (childNode.getNodeType().getLocalName().equals("lf2")) {
-                    lf2 = (SimpleNode<?>) childNode;
-                    break;
-                }
-            }
-        }
-
-        assertNotNull(lf2);
-        assertTrue(lf2.getValue() instanceof String);
-        assertEquals("121", lf2.getValue());
-
+        dataLoad("/json-to-cnsn/leafref",2,"leafref-module","cont");
     }
 
 }