aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar
diff options
context:
space:
mode:
Diffstat (limited to 'test/org/traccar')
-rw-r--r--test/org/traccar/ProtocolTest.java10
-rw-r--r--test/org/traccar/protocol/Vt200FrameDecoderTest.java4
2 files changed, 7 insertions, 7 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));
}
diff --git a/test/org/traccar/protocol/Vt200FrameDecoderTest.java b/test/org/traccar/protocol/Vt200FrameDecoderTest.java
index b31e14b7d..a9fff6c33 100644
--- a/test/org/traccar/protocol/Vt200FrameDecoderTest.java
+++ b/test/org/traccar/protocol/Vt200FrameDecoderTest.java
@@ -11,11 +11,11 @@ public class Vt200FrameDecoderTest extends ProtocolTest {
Vt200FrameDecoder decoder = new Vt200FrameDecoder();
- Assert.assertEquals(
+ verifyFrame(
binary("28631037309456208400340102dc0906171616454415760201144494473f920a0c0000030500200100417c1f383a9d1090510000006a00007000000e00180ee129"),
decoder.decode(null, null, binary("28631037309456208400340102dc0906171616454415760201144494473f920a0c0000030500200100417c1f383a9d1090510000006a00007000000e00180ee129")));
- Assert.assertEquals(
+ verifyFrame(
binary("28631037309456208400340102f51306171327294418267501208948170231071f0000044300200100005f02180000667500000000000000000000080000624629"),
decoder.decode(null, null, binary("28631037309456208400340102f513061713273d144418267501208948170231071f0000044300200100005f02180000667500000000000000000000080000624629")));