aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-26 12:15:04 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-26 12:15:04 +1300
commitd227bf37681dcfad55a9365e166b1a71742d3ae1 (patch)
treed54002b0885d6f4c4658937ce7617dc0d4dd963f /test/org/traccar/protocol
parentefa23587b3ca8ea0c08e418a4c445cfa0062f110 (diff)
downloadtraccar-server-d227bf37681dcfad55a9365e166b1a71742d3ae1.tar.gz
traccar-server-d227bf37681dcfad55a9365e166b1a71742d3ae1.tar.bz2
traccar-server-d227bf37681dcfad55a9365e166b1a71742d3ae1.zip
Add Meiligao frame decoder tests
Diffstat (limited to 'test/org/traccar/protocol')
-rw-r--r--test/org/traccar/protocol/MeiligaoFrameDecoderTest.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/MeiligaoFrameDecoderTest.java b/test/org/traccar/protocol/MeiligaoFrameDecoderTest.java
new file mode 100644
index 000000000..639f140ea
--- /dev/null
+++ b/test/org/traccar/protocol/MeiligaoFrameDecoderTest.java
@@ -0,0 +1,29 @@
+package org.traccar.protocol;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.jboss.netty.buffer.ChannelBuffers;
+import org.junit.Assert;
+import org.junit.Test;
+import org.traccar.ProtocolDecoderTest;
+
+public class MeiligaoFrameDecoderTest extends ProtocolDecoderTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ MeiligaoFrameDecoder decoder = new MeiligaoFrameDecoder();
+
+ Assert.assertNull(
+ decoder.decode(null, null, binary("00")));
+
+ Assert.assertEquals(
+ binary("2424007b8621700151517899553233323835372e3030302c562c333632372e313835342c4e2c30313034352e323130392c452c302e30302c372c3239303131332c2c2a31347c302e307c347c303030307c303030382c303030357c303235443030303230303541374432327c30367c303030314530353527f40d0a"),
+ decoder.decode(null, null, binary("2424007B8621700151517899553233323835372E3030302C562C333632372E313835342C4E2C30313034352E323130392C452C302E30302C372C3239303131332C2C2A31347C302E307C347C303030307C303030382C303030357C303235443030303230303541374432327C30367C303030314530353527F40D0A")));
+
+ Assert.assertEquals(
+ binary("2424007b8621700151517899553233323835372e3030302c562c333632372e313835342c4e2c30313034352e323130392c452c302e30302c372c3239303131332c2c2a31347c302e307c347c303030307c303030382c303030357c303235443030303230303541374432327c30367c303030314530353527f40d0a"),
+ decoder.decode(null, null, binary("002424007B8621700151517899553233323835372E3030302C562C333632372E313835342C4E2C30313034352E323130392C452C302E30302C372C3239303131332C2C2A31347C302E307C347C303030307C303030382C303030357C303235443030303230303541374432327C30367C303030314530353527F40D0A")));
+
+ }
+
+}