aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2012-12-21 22:04:03 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2012-12-21 22:04:03 +1300
commitfe9f9b034713cb98531d73698a65bd03d18a771c (patch)
treee6c9c976951b018936fa849deeae5fd96afb3bb3 /test/org/traccar/protocol/Gt06ProtocolDecoderTest.java
parentb10a929a464eb866b47d08619d3f792fb00a92e4 (diff)
downloadtrackermap-server-fe9f9b034713cb98531d73698a65bd03d18a771c.tar.gz
trackermap-server-fe9f9b034713cb98531d73698a65bd03d18a771c.tar.bz2
trackermap-server-fe9f9b034713cb98531d73698a65bd03d18a771c.zip
Added GT06 protocol (fix #100)
Diffstat (limited to 'test/org/traccar/protocol/Gt06ProtocolDecoderTest.java')
-rw-r--r--test/org/traccar/protocol/Gt06ProtocolDecoderTest.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java b/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java
index 585a2cea3..f20618061 100644
--- a/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java
@@ -2,17 +2,21 @@ package org.traccar.protocol;
import org.jboss.netty.buffer.ChannelBuffers;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
import org.junit.Test;
-public class Gt02ProtocolDecoderTest {
-
+public class Gt06ProtocolDecoderTest {
+
@Test
public void testDecode() throws Exception {
- Gt02ProtocolDecoder decoder = new Gt02ProtocolDecoder(new TestDataManager());
+ Gt06ProtocolDecoder decoder = new Gt06ProtocolDecoder(new TestDataManager());
- byte[] buf1 = {0x68,0x68,0x25,0x00,0x00,0x01,0x23,0x45,0x67,(byte)0x89,0x01,0x23,0x45,0x00,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x6B,0x3F,0x3E,0x02,0x6B,0x3F,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x0D,0x0A};
+ byte[] buf1 = {0x78,0x78,0x1F,0x12,0x0B,0x08,0x1D,0x11,0x2E,0x10,(byte)0xCC,0x02,0x7A,(byte)0xC7,(byte)0xEB,0x0C,0x46,0x58,0x49,0x00,0x14,(byte)0x8F,0x01,(byte)0xCC,0x00,0x28,0x7D,0x00,0x1F,(byte)0xB8,0x00,0x03,(byte)0x80,(byte)0x81,0x0D,0x0A};
assertNotNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(buf1)));
+
+ byte[] buf2 = {0x78,0x78,0x0D,0x01,0x08,0x64,0x71,0x70,0x03,0x28,0x35,(byte)0x81,0x00,0x09,0x3F,0x04,0x0D,0x0A};
+ assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(buf2)));
}