X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fimpl%2FMessageParserTest.java;h=abf2ad862f779cb5651f200fb484138482bbb5c0;hb=4e59b3bd93bc8d7bf1880e98b75c87faab8f61c9;hp=8f9d89f1f10fb86fb37cf03fe9c83a536a2a5a82;hpb=605ec74419f5de738d1689203e7bdd798c82f7af;p=controller.git diff --git a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/MessageParserTest.java b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/MessageParserTest.java index 8f9d89f1f1..abf2ad862f 100644 --- a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/MessageParserTest.java +++ b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/MessageParserTest.java @@ -8,26 +8,26 @@ package org.opendaylight.controller.netconf.impl; +import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; + import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import io.netty.channel.embedded.EmbeddedChannel; - import java.util.Queue; - import org.junit.Before; import org.junit.Test; import org.opendaylight.controller.netconf.api.NetconfMessage; -import org.opendaylight.controller.netconf.util.handler.ChunkedFramingMechanismEncoder; -import org.opendaylight.controller.netconf.util.handler.FramingMechanismHandlerFactory; -import org.opendaylight.controller.netconf.util.handler.NetconfChunkAggregator; -import org.opendaylight.controller.netconf.util.handler.NetconfEOMAggregator; -import org.opendaylight.controller.netconf.util.handler.NetconfMessageToXMLEncoder; -import org.opendaylight.controller.netconf.util.handler.NetconfXMLToMessageDecoder; +import org.opendaylight.controller.netconf.nettyutil.handler.ChunkedFramingMechanismEncoder; +import org.opendaylight.controller.netconf.nettyutil.handler.FramingMechanismHandlerFactory; +import org.opendaylight.controller.netconf.nettyutil.handler.NetconfChunkAggregator; +import org.opendaylight.controller.netconf.nettyutil.handler.NetconfEOMAggregator; +import org.opendaylight.controller.netconf.nettyutil.handler.NetconfMessageToXMLEncoder; +import org.opendaylight.controller.netconf.nettyutil.handler.NetconfXMLToMessageDecoder; import org.opendaylight.controller.netconf.util.messages.FramingMechanism; import org.opendaylight.controller.netconf.util.messages.NetconfMessageConstants; import org.opendaylight.controller.netconf.util.messages.NetconfMessageHeader; @@ -69,10 +69,10 @@ public class MessageParserTest { int exptHeaderLength = ChunkedFramingMechanismEncoder.DEFAULT_CHUNK_SIZE; if (i == chunkCount) { exptHeaderLength = msgLength - (ChunkedFramingMechanismEncoder.DEFAULT_CHUNK_SIZE * (i - 1)); - byte[] eom = new byte[NetconfMessageConstants.endOfChunk.length]; - recievedOutbound.getBytes(recievedOutbound.readableBytes() - NetconfMessageConstants.endOfChunk.length, + byte[] eom = new byte[NetconfMessageConstants.END_OF_CHUNK.length]; + recievedOutbound.getBytes(recievedOutbound.readableBytes() - NetconfMessageConstants.END_OF_CHUNK.length, eom); - assertArrayEquals(NetconfMessageConstants.endOfChunk, eom); + assertArrayEquals(NetconfMessageConstants.END_OF_CHUNK, eom); } byte[] header = new byte[String.valueOf(exptHeaderLength).length() @@ -87,7 +87,7 @@ public class MessageParserTest { NetconfMessage receivedMessage = (NetconfMessage) testChunkChannel.readInbound(); assertNotNull(receivedMessage); - assertTrue(this.msg.getDocument().isEqualNode(receivedMessage.getDocument())); + assertXMLEqual(this.msg.getDocument(), receivedMessage.getDocument()); } @Test @@ -106,6 +106,6 @@ public class MessageParserTest { testChunkChannel.writeInbound(recievedOutbound); NetconfMessage receivedMessage = (NetconfMessage) testChunkChannel.readInbound(); assertNotNull(receivedMessage); - assertTrue(this.msg.getDocument().isEqualNode(receivedMessage.getDocument())); + assertXMLEqual(this.msg.getDocument(), receivedMessage.getDocument()); } }