X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-rest-connector%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Frestconf%2Fimpl%2Fxml%2Fto%2Fcnsn%2Ftest%2FXmlToCnSnTest.java;h=9745c955c2d2098b3667f4db0833afd0ad34f4b8;hp=d0af29e913fa633381c176ff1796a2fbd3f41c29;hb=9ba2b4eca79bcc0e78099b133296801c8d45a6c4;hpb=48daeb11697dbb83f554b64fe8702e21de3e0a12 diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/xml/to/cnsn/test/XmlToCnSnTest.java b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/xml/to/cnsn/test/XmlToCnSnTest.java index d0af29e913..9745c955c2 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/xml/to/cnsn/test/XmlToCnSnTest.java +++ b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/xml/to/cnsn/test/XmlToCnSnTest.java @@ -7,21 +7,8 @@ */ package org.opendaylight.controller.sal.restconf.impl.xml.to.cnsn.test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; import org.junit.BeforeClass; -import org.junit.Test; -import org.opendaylight.controller.sal.rest.impl.XmlToCompositeNodeProvider; -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 XmlToCnSnTest extends YangAndXmlAndDataSchemaLoader { @@ -30,55 +17,4 @@ public class XmlToCnSnTest extends YangAndXmlAndDataSchemaLoader { dataLoad("/xml-to-cnsn/leafref"); } - @Test - public void testXmlLeafrefToCnSn() { - Node node = TestUtils.readInputToCnSn("/xml-to-cnsn/leafref/xml/data.xml", false, - XmlToCompositeNodeProvider.INSTANCE); - assertTrue(node instanceof CompositeNode); - CompositeNode compositeNode = (CompositeNode)node; - - - assertNotNull(dataSchemaNode); - TestUtils.normalizeCompositeNode(compositeNode, modules, schemaNodePath); - - 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()); - } - - @Test - public void testXmlBlankInput() throws Exception { - InputStream inputStream = new ByteArrayInputStream("".getBytes()); - Node node = - XmlToCompositeNodeProvider.INSTANCE.readFrom(null, null, null, null, null, inputStream); - - assertNull( node ); - } - - @Test - public void testXmlBlankInputUnmarkableStream() throws Exception { - InputStream inputStream = new ByteArrayInputStream("".getBytes()) { - @Override - public boolean markSupported() { - return false; - } - }; - Node node = - XmlToCompositeNodeProvider.INSTANCE.readFrom(null, null, null, null, null, inputStream); - - assertNull( node ); - } - }