From 570cd3cbd9290df1388eb8be6e4b2636afc33951 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 13 Apr 2013 01:02:17 +1200 Subject: Add IntelliTrac protocol support --- .../protocol/IntellitracProtocolDecoderTest.java | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 test/org/traccar/protocol/IntellitracProtocolDecoderTest.java (limited to 'test/org') diff --git a/test/org/traccar/protocol/IntellitracProtocolDecoderTest.java b/test/org/traccar/protocol/IntellitracProtocolDecoderTest.java new file mode 100644 index 000000000..098c9415e --- /dev/null +++ b/test/org/traccar/protocol/IntellitracProtocolDecoderTest.java @@ -0,0 +1,49 @@ +package org.traccar.protocol; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class IntellitracProtocolDecoderTest { + + @Test + public void testDecode() throws Exception { + + IntellitracProtocolDecoder decoder = new IntellitracProtocolDecoder(null); + decoder.setDataManager(new TestDataManager()); + + assertNull(decoder.decode(null, null, "$OK:TRACKING")); + + assertNotNull(decoder.decode(null, null, + "1010000002,20030217132813,121.646060,25.061725,20,157,133,7,0,11,15,0.096,0.000")); + + assertNotNull(decoder.decode(null, null, + "1001070919,20130405084206,37.903730,48.011377,0,0,235,10,2,2,0,20.211,0.153")); + + assertNotNull(decoder.decode(null, null, + "1010000002,20030217144230,121.646102,25.061398,0,0,139,0,0,0,0,0.093,0.000")); + + assertNotNull(decoder.decode(null, null, + "1010000004,20050513153524,121.646075,25.063675,0,166,50,6,1,0,0,0.118,0.000")); + + assertNotNull(decoder.decode(null, null, + "1010000004,20050513154001,121.646075,25.063675,0,166,55,7,1,0,0,0.096,0.000")); + + assertNotNull(decoder.decode(null, null, + "1010000002,20030217132813,121.646060,25.061725,20,157,0,7,0,11,15")); + + assertNotNull(decoder.decode(null, null, + "12345,1010000002,20030217132813,121.646060,25.061725,20,157,0,7,0,11,15")); + + assertNotNull(decoder.decode(null, null, + "1010000002,20030217144230,121.646102,25.061398,0,0,0,7,2,0,0")); + + assertNotNull(decoder.decode(null, null, + "$RP:12345,1010000002,20030217144230,121.646102,25.061398,0,0,0,7,2,0,0")); + + assertNotNull(decoder.decode(null, null, + "1010000001,20030105092129,121.651598,25.052325,0,0,33,0,1,0,0")); + + } + +} -- cgit v1.2.3