BUG 2412 remove CompositeNode from RestconfImpl codeBase
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / java / org / opendaylight / controller / sal / restconf / impl / test / XmlAndJsonToCnSnLeafRefTest.java
index 7b216ef1ba54f276628349a534871f4694852c00..e2e19c25dea23fc4280f5023ca19f93e4296d72c 100644 (file)
@@ -7,22 +7,8 @@
  */
 package org.opendaylight.controller.sal.restconf.impl.test;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.net.URISyntaxException;
-
-import javax.ws.rs.WebApplicationException;
-
 import org.junit.BeforeClass;
-import org.junit.Test;
-import org.opendaylight.controller.sal.rest.impl.JsonToCompositeNodeProvider;
-import org.opendaylight.controller.sal.rest.impl.XmlToCompositeNodeProvider;
 import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.CompositeNode;
-import org.opendaylight.yangtools.yang.data.api.Node;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 
 public class XmlAndJsonToCnSnLeafRefTest extends YangAndXmlAndDataSchemaLoader {
 
@@ -38,46 +24,5 @@ public class XmlAndJsonToCnSnLeafRefTest extends YangAndXmlAndDataSchemaLoader {
         dataLoad("/leafref/yang", 2, "leafref-module", "cont");
     }
 
-    @Test
-    public void loadXmlToCnSn() throws WebApplicationException, IOException, URISyntaxException {
-        Node<?> node = TestUtils.readInputToCnSn("/leafref/xml/xmldata.xml", XmlToCompositeNodeProvider.INSTANCE);
-
-        assertTrue(node instanceof CompositeNode);
-        CompositeNode cnSn = (CompositeNode)node;
-
-        TestUtils.normalizeCompositeNode(cnSn, modules, schemaNodePath);
-
-        verifyContPredicate(cnSn, "lf4", YangInstanceIdentifier.builder().node(refContQName).node(refLf1QName).build());
-        verifyContPredicate(cnSn, "lf2", YangInstanceIdentifier.builder().node(contQName).node(lf1QName).build());
-        verifyContPredicate(cnSn, "lf3", YangInstanceIdentifier.builder().node(contQName).node(lf2QName).build());
-        verifyContPredicate(cnSn, "lf5", YangInstanceIdentifier.builder().node(contQName).node(lf3QName).build());
-    }
-
-    @Test
-    public void loadJsonToCnSn() throws WebApplicationException, IOException, URISyntaxException {
-        Node<?> node = TestUtils.readInputToCnSn("/leafref/json/jsondata.json",
-                JsonToCompositeNodeProvider.INSTANCE);
-        assertTrue(node instanceof CompositeNode);
-        CompositeNode cnSn = (CompositeNode)node;
-
-        TestUtils.normalizeCompositeNode(cnSn, modules, schemaNodePath);
-
-        verifyContPredicate(cnSn, "lf4", YangInstanceIdentifier.builder().node(refContQName).node(refLf1QName).build());
-        verifyContPredicate(cnSn, "lf2", YangInstanceIdentifier.builder().node(contQName).node(lf1QName).build());
-        verifyContPredicate(cnSn, "lf3", YangInstanceIdentifier.builder().node(contQName).node(lf2QName).build());
-        verifyContPredicate(cnSn, "lf5", YangInstanceIdentifier.builder().node(contQName).node(lf3QName).build());
-    }
-
-    private void verifyContPredicate(CompositeNode cnSn, String leafName, Object value) throws URISyntaxException {
-        Object parsed = null;
-
-        for (final Node<?> node : cnSn.getValue()) {
-            if (node.getNodeType().getLocalName().equals(leafName)) {
-                parsed = node.getValue();
-            }
-        }
-
-        assertEquals(value, parsed);
-    }
 
 }