Merge "BUG 1082 Migrate sal-rest-connector to Async Data Broker API"
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / java / org / opendaylight / controller / sal / restconf / impl / xml / to / cnsn / test / XmlToCnSnTest.java
index 5cda4a7f52014dc4a9ab3572d9073877ec12e74e..d0af29e913fa633381c176ff1796a2fbd3f41c29 100644 (file)
@@ -14,7 +14,6 @@ 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;
@@ -33,9 +32,12 @@ public class XmlToCnSnTest extends YangAndXmlAndDataSchemaLoader {
 
     @Test
     public void testXmlLeafrefToCnSn() {
-        CompositeNode compositeNode = TestUtils.readInputToCnSn("/xml-to-cnsn/leafref/xml/data.xml", false,
+        Node<?> node = TestUtils.readInputToCnSn("/xml-to-cnsn/leafref/xml/data.xml", false,
                 XmlToCompositeNodeProvider.INSTANCE);
-        assertNotNull(compositeNode);
+        assertTrue(node instanceof CompositeNode);
+        CompositeNode compositeNode = (CompositeNode)node;
+
+
         assertNotNull(dataSchemaNode);
         TestUtils.normalizeCompositeNode(compositeNode, modules, schemaNodePath);
 
@@ -57,26 +59,26 @@ public class XmlToCnSnTest extends YangAndXmlAndDataSchemaLoader {
     }
 
     @Test
-    public void testXmlBlankInput() throws Exception{
-        InputStream inputStream = new ByteArrayInputStream( "".getBytes() );
-        CompositeNode compositeNode =
+    public void testXmlBlankInput() throws Exception {
+        InputStream inputStream = new ByteArrayInputStream("".getBytes());
+        Node<?> node =
                 XmlToCompositeNodeProvider.INSTANCE.readFrom(null, null, null, null, null, inputStream);
 
-        assertNull( compositeNode );
+        assertNull( node );
     }
 
     @Test
-    public void testXmlBlankInputUnmarkableStream() throws Exception{
-        InputStream inputStream = new ByteArrayInputStream( "".getBytes() ){
+    public void testXmlBlankInputUnmarkableStream() throws Exception {
+        InputStream inputStream = new ByteArrayInputStream("".getBytes()) {
             @Override
             public boolean markSupported() {
                 return false;
             }
         };
-        CompositeNode compositeNode =
+        Node<?> node =
                 XmlToCompositeNodeProvider.INSTANCE.readFrom(null, null, null, null, null, inputStream);
 
-        assertNull( compositeNode );
+        assertNull( node );
     }
 
 }