The transformer we use is specifically allowed to add whitespace,
which does not offer us with enough control as to what it is going
to be -- making it implementation-dependent.
Checking whitespace match actually breaks with Java11, so disable
that checking.
Change-Id: I8b3b5fa648ea2f13cc069b03ba374975be33e9d9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.util.Queue;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.util.Queue;
+import org.custommonkey.xmlunit.XMLUnit;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.netconf.api.NetconfMessage;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.netconf.api.NetconfMessage;
NetconfMessage receivedMessage = testChunkChannel.readInbound();
assertNotNull(receivedMessage);
NetconfMessage receivedMessage = testChunkChannel.readInbound();
assertNotNull(receivedMessage);
+ XMLUnit.setIgnoreWhitespace(true);
assertXMLEqual(this.msg.getDocument(), receivedMessage.getDocument());
}
assertXMLEqual(this.msg.getDocument(), receivedMessage.getDocument());
}
testChunkChannel.writeInbound(recievedOutbound);
NetconfMessage receivedMessage = testChunkChannel.readInbound();
assertNotNull(receivedMessage);
testChunkChannel.writeInbound(recievedOutbound);
NetconfMessage receivedMessage = testChunkChannel.readInbound();
assertNotNull(receivedMessage);
+ XMLUnit.setIgnoreWhitespace(true);
assertXMLEqual(this.msg.getDocument(), receivedMessage.getDocument());
}
assertXMLEqual(this.msg.getDocument(), receivedMessage.getDocument());
}
- private static long getHeaderLength(byte[] bytes) {
+ private static long getHeaderLength(final byte[] bytes) {
byte[] headerStart = new byte[]{(byte) 0x0a, (byte) 0x23};
return Long.parseLong(StandardCharsets.US_ASCII.decode(
ByteBuffer.wrap(bytes, headerStart.length, bytes.length - headerStart.length - 1)).toString());
byte[] headerStart = new byte[]{(byte) 0x0a, (byte) 0x23};
return Long.parseLong(StandardCharsets.US_ASCII.decode(
ByteBuffer.wrap(bytes, headerStart.length, bytes.length - headerStart.length - 1)).toString());