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%2Ftest%2FCnSnToXmlAndJsonInstanceIdentifierTest.java;h=3f2c212bd87785ccbf021749d9bddb1db069bf6f;hp=18b5ce490ff137f7da978052a09819a6a5b4e1d1;hb=92f1fd15e99ce5b9e52612c0b52f70cd661b99cc;hpb=aa186fdb5e8950f06824cf907aaad96e8cbed93e diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/CnSnToXmlAndJsonInstanceIdentifierTest.java b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/CnSnToXmlAndJsonInstanceIdentifierTest.java index 18b5ce490f..3f2c212bd8 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/CnSnToXmlAndJsonInstanceIdentifierTest.java +++ b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/CnSnToXmlAndJsonInstanceIdentifierTest.java @@ -64,7 +64,7 @@ public class CnSnToXmlAndJsonInstanceIdentifierTest extends YangAndXmlAndDataSch @Ignore @Test public void saveCnSnWithLeafListInstIdentifierToXmlTest() throws WebApplicationException, IOException, - URISyntaxException, XMLStreamException { + URISyntaxException, XMLStreamException { CompositeNode cnSn = prepareCnSn(createInstanceIdentifierWithLeafList()); String output = TestUtils.writeCompNodeWithSchemaContextToOutput(cnSn, modules, dataSchemaNode, StructuredDataToXmlProvider.INSTANCE); @@ -94,7 +94,7 @@ public class CnSnToXmlAndJsonInstanceIdentifierTest extends YangAndXmlAndDataSch @Test public void saveCnSnWithLeafListInstIdentifierToJsonTest() throws WebApplicationException, IOException, - URISyntaxException { + URISyntaxException { CompositeNode cnSn = prepareCnSn(createInstanceIdentifierWithLeafList()); String output = TestUtils.writeCompNodeWithSchemaContextToOutput(cnSn, modules, dataSchemaNode, StructuredDataToJsonProvider.INSTANCE); @@ -111,7 +111,7 @@ public class CnSnToXmlAndJsonInstanceIdentifierTest extends YangAndXmlAndDataSch assertTrue(strInOutput); } - private void validateXmlOutput(String xml) throws XMLStreamException { + private void validateXmlOutput(final String xml) throws XMLStreamException { XMLInputFactory xmlInFactory = XMLInputFactory.newInstance(); XMLEventReader eventReader; @@ -124,7 +124,7 @@ public class CnSnToXmlAndJsonInstanceIdentifierTest extends YangAndXmlAndDataSch if (nextEvent.isStartElement()) { StartElement startElement = (StartElement) nextEvent; if (startElement.getName().getLocalPart().equals("lf111")) { - Iterator prefixes = startElement.getNamespaceContext().getPrefixes("augment:augment:module"); + Iterator prefixes = startElement.getNamespaceContext().getPrefixes("augment:augment:module"); while (prefixes.hasNext() && aaModulePrefix == null) { String prefix = (String) prefixes.next(); @@ -152,7 +152,7 @@ public class CnSnToXmlAndJsonInstanceIdentifierTest extends YangAndXmlAndDataSch } - private void validateXmlOutputWithLeafList(String xml) throws XMLStreamException { + private void validateXmlOutputWithLeafList(final String xml) throws XMLStreamException { XMLInputFactory xmlInFactory = XMLInputFactory.newInstance(); XMLEventReader eventReader; @@ -164,7 +164,7 @@ public class CnSnToXmlAndJsonInstanceIdentifierTest extends YangAndXmlAndDataSch if (nextEvent.isStartElement()) { StartElement startElement = (StartElement) nextEvent; if (startElement.getName().getLocalPart().equals("lf111")) { - Iterator prefixes = startElement.getNamespaceContext().getPrefixes("augment:module:leaf:list"); + Iterator prefixes = startElement.getNamespaceContext().getPrefixes("augment:module:leaf:list"); while (prefixes.hasNext() && aModuleLfLstPrefix == null) { String prefix = (String) prefixes.next(); @@ -188,7 +188,7 @@ public class CnSnToXmlAndJsonInstanceIdentifierTest extends YangAndXmlAndDataSch } - private CompositeNode prepareCnSn(InstanceIdentifier instanceIdentifier) throws URISyntaxException { + private CompositeNode prepareCnSn(final InstanceIdentifier instanceIdentifier) throws URISyntaxException { MutableCompositeNode cont = NodeFactory.createMutableCompositeNode( TestUtils.buildQName("cont", "instance:identifier:module", "2014-01-17"), null, null,null,null); MutableCompositeNode cont1 = NodeFactory.createMutableCompositeNode( @@ -198,15 +198,15 @@ public class CnSnToXmlAndJsonInstanceIdentifierTest extends YangAndXmlAndDataSch MutableSimpleNode lf111 = NodeFactory.createMutableSimpleNode(TestUtils.buildQName("lf111", "augment:augment:module", "2014-01-17"), lst11, instanceIdentifier,null,null); - - - lst11.getChildren().add(lf111); + + + lst11.getValue().add(lf111); lst11.init(); - cont1.getChildren().add(lst11); + cont1.getValue().add(lst11); cont1.init(); - - cont.getChildren().add(cont1); + + cont.getValue().add(cont1); cont.init(); return cont; @@ -226,7 +226,7 @@ public class CnSnToXmlAndJsonInstanceIdentifierTest extends YangAndXmlAndDataSch pathArguments.add(new NodeIdentifier(new QName(new URI("augment:augment:module"), "lf112"))); - return new InstanceIdentifier(pathArguments); + return InstanceIdentifier.create(pathArguments); } private InstanceIdentifier createInstanceIdentifierWithLeafList() throws URISyntaxException { @@ -235,7 +235,7 @@ public class CnSnToXmlAndJsonInstanceIdentifierTest extends YangAndXmlAndDataSch pathArguments.add(new NodeIdentifier(new QName(new URI("instance:identifier:module"), "cont1"))); pathArguments.add(new NodeWithValue(new QName(new URI("augment:module:leaf:list"), "lflst11"), "lflst11_1")); - return new InstanceIdentifier(pathArguments); + return InstanceIdentifier.create(pathArguments); } }