aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/ProtocolTest.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-08-04 00:39:09 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-08-04 00:39:09 +1200
commitc6760e2ca84a0118c1439a6cbee0da42ed4a1c92 (patch)
tree2ae92b38b31b1dad81e20e0ad5474bf54377626d /test/org/traccar/ProtocolTest.java
parent4d35ef57f3dff21348d9ae9fe269176cd885c127 (diff)
downloadtrackermap-server-c6760e2ca84a0118c1439a6cbee0da42ed4a1c92.tar.gz
trackermap-server-c6760e2ca84a0118c1439a6cbee0da42ed4a1c92.tar.bz2
trackermap-server-c6760e2ca84a0118c1439a6cbee0da42ed4a1c92.zip
Improve frame decoder testing
Diffstat (limited to 'test/org/traccar/ProtocolTest.java')
-rw-r--r--test/org/traccar/ProtocolTest.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/org/traccar/ProtocolTest.java b/test/org/traccar/ProtocolTest.java
index 8a1602de7..daa495a17 100644
--- a/test/org/traccar/ProtocolTest.java
+++ b/test/org/traccar/ProtocolTest.java
@@ -270,14 +270,14 @@ public class ProtocolTest extends BaseTest {
protected void verifyCommand(
BaseProtocolEncoder encoder, Command command, ChannelBuffer expected) throws Exception {
- verifyDecodedCommand(encoder.encodeCommand(command), expected);
+ verifyFrame(expected, encoder.encodeCommand(command));
}
- private void verifyDecodedCommand(Object decodedObject, ChannelBuffer expected) {
+ protected void verifyFrame(ChannelBuffer expected, Object object) {
- Assert.assertNotNull("command is null", decodedObject);
- Assert.assertTrue("not a buffer", decodedObject instanceof ChannelBuffer);
- Assert.assertEquals(ChannelBuffers.hexDump(expected), ChannelBuffers.hexDump((ChannelBuffer) decodedObject));
+ Assert.assertNotNull("buffer is null", object);
+ Assert.assertTrue("not a buffer", object instanceof ChannelBuffer);
+ Assert.assertEquals(ChannelBuffers.hexDump(expected), ChannelBuffers.hexDump((ChannelBuffer) object));
}