X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-clustering-commons%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fxml%2Fcodec%2FXmlUtilsTest.java;h=cac58587a5ca3acac688c923d47af3846484e4b7;hb=de4ef13b0a23eeec25e3cdd6461864d486707023;hp=0688bfbc5cddbe256a3e67839606d6efd811442b;hpb=aa83d1e4b013eecde3c79b00cca538bd4763c2d4;p=controller.git diff --git a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/xml/codec/XmlUtilsTest.java b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/xml/codec/XmlUtilsTest.java index 0688bfbc5c..cac58587a5 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/xml/codec/XmlUtilsTest.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/xml/codec/XmlUtilsTest.java @@ -8,11 +8,16 @@ package org.opendaylight.controller.xml.codec; - import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import com.google.common.io.ByteSource; -import junit.framework.Assert; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import javax.xml.parsers.DocumentBuilderFactory; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.opendaylight.yangtools.yang.common.QName; @@ -27,15 +32,6 @@ import org.opendaylight.yangtools.yang.model.api.RpcDefinition; import org.opendaylight.yangtools.yang.model.api.SchemaContext; import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl; -import javax.xml.parsers.DocumentBuilderFactory; - -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - - public class XmlUtilsTest { private static final DocumentBuilderFactory BUILDERFACTORY; @@ -85,18 +81,18 @@ public class XmlUtilsTest { @Test public void testInputXmlToCompositeNode() { CompositeNode node = XmlUtils.inputXmlToCompositeNode(testRpc.getQName(), XML_CONTENT, schema); - ImmutableList input = (ImmutableList)node.getValue().get(0).getValue(); - SimpleNode firstNode = input.get(0); + ImmutableList> input = (ImmutableList>)node.getValue().get(0).getValue(); + SimpleNode firstNode = input.get(0); Assert.assertEquals("id", firstNode.getNodeType().getLocalName()); Assert.assertEquals("flowid", firstNode.getValue()); - SimpleNode secondNode = input.get(1); + SimpleNode secondNode = input.get(1); Assert.assertEquals("flow", secondNode.getNodeType().getLocalName()); YangInstanceIdentifier instance = (YangInstanceIdentifier) secondNode.getValue(); Iterable iterable = instance.getPathArguments(); - Iterator it = iterable.iterator(); + Iterator it = iterable.iterator(); YangInstanceIdentifier.NodeIdentifier firstPath = (YangInstanceIdentifier.NodeIdentifier) it.next(); Assert.assertEquals("node", firstPath.getNodeType().getLocalName()); YangInstanceIdentifier.NodeIdentifierWithPredicates secondPath = (YangInstanceIdentifier.NodeIdentifierWithPredicates)it.next(); @@ -108,7 +104,7 @@ public class XmlUtilsTest { @Test public void testInputCompositeNodeToXML() { CompositeNode input = XmlUtils.inputXmlToCompositeNode(testRpc.getQName(), XML_CONTENT, schema); - List> childNodes = new ArrayList(); + List> childNodes = new ArrayList<>(); childNodes.add(input); QName rpcQName = schema.getOperations().iterator().next().getQName(); CompositeNode node = new ImmutableCompositeNode(rpcQName, input.getValue(), ModifyAction.REPLACE);