import java.io.ByteArrayInputStream;
import java.io.InputStream;
-
import org.junit.BeforeClass;
import org.junit.Test;
import org.opendaylight.controller.sal.rest.impl.XmlToCompositeNodeProvider;
@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);
}
@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 );
}
}