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;
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()
NetconfMessage receivedMessage = (NetconfMessage) testChunkChannel.readInbound();
assertNotNull(receivedMessage);
- assertTrue(this.msg.getDocument().isEqualNode(receivedMessage.getDocument()));
+ assertXMLEqual(this.msg.getDocument(), receivedMessage.getDocument());
}
@Test
testChunkChannel.writeInbound(recievedOutbound);
NetconfMessage receivedMessage = (NetconfMessage) testChunkChannel.readInbound();
assertNotNull(receivedMessage);
- assertTrue(this.msg.getDocument().isEqualNode(receivedMessage.getDocument()));
+ assertXMLEqual(this.msg.getDocument(), receivedMessage.getDocument());
}
}