From 02c1fb78a8b1681325ec01f49ae6ff6603825243 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 26 Apr 2012 19:34:10 +0000 Subject: --- .../traccar/protocol/Avl08ProtocolDecoderTest.java | 42 +++++++++++++++ .../traccar/protocol/Gl100ProtocolDecoderTest.java | 38 +++++++++++++ .../traccar/protocol/Gl200ProtocolDecoderTest.java | 33 ++++++++++++ .../protocol/Gps103ProtocolDecoderTest.java | 29 ++++++++++ .../traccar/protocol/T55ProtocolDecoderTest.java | 24 +++++++++ .../traccar/protocol/Tk103ProtocolDecoderTest.java | 18 +++++++ .../protocol/Xexun2ProtocolDecoderTest.java | 18 +++++++ .../traccar/protocol/XexunProtocolDecoderTest.java | 27 ++++++++++ .../protocol/avl08/Avl08ProtocolDecoderTest.java | 63 ---------------------- .../protocol/gl100/Gl100ProtocolDecoderTest.java | 59 -------------------- .../protocol/gl200/Gl200ProtocolDecoderTest.java | 53 ------------------ .../protocol/gps103/Gps103ProtocolDecoderTest.java | 49 ----------------- .../protocol/t55/T55ProtocolDecoderTest.java | 43 --------------- .../protocol/tk103/Tk103ProtocolDecoderTest.java | 38 ------------- .../protocol/xexun/XexunProtocolDecoderTest.java | 47 ---------------- .../protocol/xexun2/Xexun2ProtocolDecoderTest.java | 38 ------------- 16 files changed, 229 insertions(+), 390 deletions(-) create mode 100644 test/org/traccar/protocol/Avl08ProtocolDecoderTest.java create mode 100644 test/org/traccar/protocol/Gl100ProtocolDecoderTest.java create mode 100644 test/org/traccar/protocol/Gl200ProtocolDecoderTest.java create mode 100644 test/org/traccar/protocol/Gps103ProtocolDecoderTest.java create mode 100644 test/org/traccar/protocol/T55ProtocolDecoderTest.java create mode 100644 test/org/traccar/protocol/Tk103ProtocolDecoderTest.java create mode 100644 test/org/traccar/protocol/Xexun2ProtocolDecoderTest.java create mode 100644 test/org/traccar/protocol/XexunProtocolDecoderTest.java delete mode 100644 test/org/traccar/protocol/avl08/Avl08ProtocolDecoderTest.java delete mode 100644 test/org/traccar/protocol/gl100/Gl100ProtocolDecoderTest.java delete mode 100644 test/org/traccar/protocol/gl200/Gl200ProtocolDecoderTest.java delete mode 100644 test/org/traccar/protocol/gps103/Gps103ProtocolDecoderTest.java delete mode 100644 test/org/traccar/protocol/t55/T55ProtocolDecoderTest.java delete mode 100644 test/org/traccar/protocol/tk103/Tk103ProtocolDecoderTest.java delete mode 100644 test/org/traccar/protocol/xexun/XexunProtocolDecoderTest.java delete mode 100644 test/org/traccar/protocol/xexun2/Xexun2ProtocolDecoderTest.java (limited to 'test') diff --git a/test/org/traccar/protocol/Avl08ProtocolDecoderTest.java b/test/org/traccar/protocol/Avl08ProtocolDecoderTest.java new file mode 100644 index 000000000..8145412a5 --- /dev/null +++ b/test/org/traccar/protocol/Avl08ProtocolDecoderTest.java @@ -0,0 +1,42 @@ +package org.traccar.protocol; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class Avl08ProtocolDecoderTest { + + @Test + public void testDecode() throws Exception { + + Avl08ProtocolDecoder decoder = new Avl08ProtocolDecoder(new TestDataManager(), 0); + + assertNull(decoder.decode(null, null, + "$$AE359772033395899|AA000000000000000000000000000000000000000000000000000000000000|00.0|00.0|00.0|000000000000|20090215000153|13601435|00000000|00000000|0000|0.0000|0007|2DAA")); + + assertNull(decoder.decode(null, null, + "$$AE359772033395899|AA000000000000000000000000000000000000000000000000000000000000|00.0|00.0|00.0|00000000|20090215001204|14182037|00000000|0012D888|0000|0.0000|0016|5B51")); + + assertNull(decoder.decode(null, null, + "$$AE359772033395899|AA00000000000000000000000000000000000000000000000000000000000|00.0|00.0|00.0|00000000000|20090215001337|14182013|00000000|0012D888|0000|0.0000|0017|346E")); + + assertNotNull(decoder.decode(null, null, + "$$B3359772032399074|60$GPRMC,094859.000,A,3648.2229,N,01008.0976,E,0.00,,221211,,,A*79|02.3|01.3|02.0|000000000000|20111222094858|13360808|00000000|00000000|0000|0.0000|0001||A977")); + + assertNotNull(decoder.decode(null, null, + "$$B3359772032399074|09$GPRMC,094905.000,A,3648.2229,N,01008.0976,E,0.00,,221211,,,A*71|02.1|01.3|01.7|000000000000|20111222094905|03210533|00000000|00000000|0000|0.0000|0002||FA58")); + + assertNotNull(decoder.decode(null, null, + "$$B3359772032399074|AA$GPRMC,093911.000,A,3648.2146,N,01008.0977,E,0.00,,140312,,,A*7E|02.1|01.1|01.8|000000000000|20120314093910|04100057|00000000|0012D887|0000|0.0000|1128||C50E")); + + assertNotNull(decoder.decode(null, null, + "$$B3359772032399074|AA$GPRMC,094258.000,A,3648.2146,N,01008.0977,E,0.00,,140312,,,A*7F|02.1|01.1|01.8|000000000000|20120314094257|04120057|00000000|0012D887|0000|0.0000|1136||CA32")); + + assertNotNull(decoder.decode(null, null, + "$$B3359772032399074|AA$GPRMC,234603.000,A,3648.2179,N,01008.0962,E,0.00,,030412,,,A*74|01.8|01.0|01.5|000000000000|20120403234603|14251914|00000000|0012D888|0000|0.0000|3674||940B")); + + assertNotNull(decoder.decode(null, null, + "$$B3359772032399074|AA$GPRMC,234603.000,A,3648.2179,N,01008.0962,E,0.00,,030412,,,A*74|01.8|01.0|01.5|000000000000|20120403234603|14251914|00000000|0012D888|0000|0.0000|3674|940B")); + } + +} diff --git a/test/org/traccar/protocol/Gl100ProtocolDecoderTest.java b/test/org/traccar/protocol/Gl100ProtocolDecoderTest.java new file mode 100644 index 000000000..1e1a1c978 --- /dev/null +++ b/test/org/traccar/protocol/Gl100ProtocolDecoderTest.java @@ -0,0 +1,38 @@ +package org.traccar.protocol; + +import static org.junit.Assert.assertNotNull; +import org.junit.Test; + +public class Gl100ProtocolDecoderTest { + + @Test + public void testDecode() throws Exception { + + Gl100ProtocolDecoder decoder = new Gl100ProtocolDecoder(new TestDataManager(), 0); + + assertNotNull(decoder.decode(null, null, + "+RESP:GTSOS,359231030000010,0,0,0,1,4.3,92,70.0,1,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,11F0,0102120204")); + + assertNotNull(decoder.decode(null, null, + "+RESP:GTRTL,359231030000010,0,0,0,1,4.3,92,70.0,1,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,11F0,0102120204")); + + assertNotNull(decoder.decode(null, null, + "+RESP:GTEST,359231030000010,0,0,0,1,4.3,92,70.0,1,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,11F0,0102120204")); + + assertNotNull(decoder.decode(null, null, + "+RESP:GTSZI,359231030000010,0,3,0,1,4.3,92,70.0,1,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,11F0,0102120204")); + + assertNotNull(decoder.decode(null, null, + "+RESP:GTLBC,359231030000010,02132523415,1,4.3,92,70.0,1,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,11F0,0102120204")); + + assertNotNull(decoder.decode(null, null, + "+RESP:GTTRI,359231030000010,1,0,0,1,4.3,92,70.0,1,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,11F0,0102120204")); + + assertNotNull(decoder.decode(null, null, + "+RESP:GTTRI,359231030000010,2,0,0,1,4.3,92,70.0,1,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,0,0,1,-3.6,145,30.0,2,121.354442,31.221940,20090101000100,0460,0000,18d8,6141,00,11F0,0102120204")); + + //assertNotNull(decoder.decode(null, null, + // "AT+GTHBD=HeartBeat,359231030000010,20090101000000,11F0,0102120204")); + } + +} diff --git a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java new file mode 100644 index 000000000..b14a0c141 --- /dev/null +++ b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java @@ -0,0 +1,33 @@ +package org.traccar.protocol; + +import static org.junit.Assert.assertNotNull; +import org.junit.Test; + +public class Gl200ProtocolDecoderTest { + + @Test + public void testDecode() throws Exception { + + Gl200ProtocolDecoder decoder = new Gl200ProtocolDecoder(new TestDataManager(), 0); + + assertNotNull(decoder.decode(null, null, + "+RESP:GTFRI,020102,000035988863964,,0,0,1,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,,20090214093254,11F0")); + + assertNotNull(decoder.decode(null, null, + "+RESP:GTFRI,020102,135790246811220,,0,0,1,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,,20090214093254,11F0")); + + assertNotNull(decoder.decode(null, null, + "+RESP:GTFRI,020102,135790246811220,,0,0,2,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,0,4.3,92,70.0,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,,20090214093254,11F0")); + + assertNotNull(decoder.decode(null, null, + "+RESP:GTDOG,020102,135790246811220,,0,0,1,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,2000.0,20090214093254,11F0")); + + assertNotNull(decoder.decode(null, null, + "+RESP:GTLBC,020102,135790246811220,,+8613800000000,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,,20090214093254,11F0")); + + assertNotNull(decoder.decode(null, null, + "+RESP:GTGCR,020102,135790246811220,,3,50,180,2,0.4,296,-5.4,121.391055,31.164473,20100714104934,0460,0000,1878,0873,00,,20100714104934,000C")); + + } + +} diff --git a/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java b/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java new file mode 100644 index 000000000..c09b34bc7 --- /dev/null +++ b/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java @@ -0,0 +1,29 @@ +package org.traccar.protocol; + +import static org.junit.Assert.assertNotNull; +import org.junit.Test; + +public class Gps103ProtocolDecoderTest { + + @Test + public void testDecode() throws Exception { + + Gps103ProtocolDecoder decoder = new Gps103ProtocolDecoder(new TestDataManager(), 0); + + // assertNull(decoder.decode(null, null, "##,imei:10000000000000,A")); + + assertNotNull(decoder.decode(null, null, + "imei:10000000000000,help me,1004171910,,F,010203.000,A,0102.0003,N,00102.0003,E,1.02,")); + + assertNotNull(decoder.decode(null, null, + "imei:353451040164707,tracker,1105182344,+36304665439,F,214418.000,A,4804.2222,N,01916.7593,E,0.37,")); + + assertNotNull(decoder.decode(null, null, + "imei:353451042861763,tracker,1106132241,,F,144114.000,A,2301.9052,S,04909.3676,W,0.13,")); + + assertNotNull(decoder.decode(null, null, + "imei:359587010124900,tracker,0809231929,13554900601,F,112909.397,A,2234.4669,N,11354.3287,E,0.11,321.53,")); + + } + +} diff --git a/test/org/traccar/protocol/T55ProtocolDecoderTest.java b/test/org/traccar/protocol/T55ProtocolDecoderTest.java new file mode 100644 index 000000000..678549968 --- /dev/null +++ b/test/org/traccar/protocol/T55ProtocolDecoderTest.java @@ -0,0 +1,24 @@ +package org.traccar.protocol; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class T55ProtocolDecoderTest { + + @Test + public void testDecode() throws Exception { + + T55ProtocolDecoder decoder = new T55ProtocolDecoder(new TestDataManager(), 0); + + assertNull(decoder.decode(null, null, "$PGID,359853000144328*0F")); + + assertNotNull(decoder.decode(null, null, + "$GPRMC,094907.000,A,6000.5332,N,03020.5192,E,1.17,60.26,091111,,*33")); + + assertNotNull(decoder.decode(null, null, + "$GPRMC,115528.000,A,6000.5432,N,03020.4948,E,,,091111,,*06")); + + } + +} diff --git a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java new file mode 100644 index 000000000..e294f6010 --- /dev/null +++ b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java @@ -0,0 +1,18 @@ +package org.traccar.protocol; + +import static org.junit.Assert.assertNotNull; +import org.junit.Test; + +public class Tk103ProtocolDecoderTest { + + @Test + public void testDecode() throws Exception { + + Tk103ProtocolDecoder decoder = new Tk103ProtocolDecoder(new TestDataManager(), 0); + + assertNotNull(decoder.decode(null, null, + "(035988863964BP05000035988863964110524A4241.7977N02318.7561E000.0123536356.5100000000L000946BB")); + + } + +} diff --git a/test/org/traccar/protocol/Xexun2ProtocolDecoderTest.java b/test/org/traccar/protocol/Xexun2ProtocolDecoderTest.java new file mode 100644 index 000000000..845b5757d --- /dev/null +++ b/test/org/traccar/protocol/Xexun2ProtocolDecoderTest.java @@ -0,0 +1,18 @@ +package org.traccar.protocol; + +import static org.junit.Assert.assertNotNull; +import org.junit.Test; + +public class Xexun2ProtocolDecoderTest { + + @Test + public void testDecode() throws Exception { + + Xexun2ProtocolDecoder decoder = new Xexun2ProtocolDecoder(new TestDataManager(), 0); + + assertNotNull(decoder.decode(null, null, + "111111120009,+436763737552,GPRMC,120009.590,A,4639.6774,N,01418.5737,E,0.00,0.00,111111,,,A*68,F,, imei:359853000144328,04,481.2,F:4.15V,0,139,2689,232,03,2725,0576")); + + } + +} diff --git a/test/org/traccar/protocol/XexunProtocolDecoderTest.java b/test/org/traccar/protocol/XexunProtocolDecoderTest.java new file mode 100644 index 000000000..f85ce9bb3 --- /dev/null +++ b/test/org/traccar/protocol/XexunProtocolDecoderTest.java @@ -0,0 +1,27 @@ +package org.traccar.protocol; + +import static org.junit.Assert.assertNotNull; +import org.junit.Test; + +public class XexunProtocolDecoderTest { + + @Test + public void testDecode() throws Exception { + + XexunProtocolDecoder decoder = new XexunProtocolDecoder(new TestDataManager(), 0); + + assertNotNull(decoder.decode(null, null, + "GPRMC,150120.000,A,3346.4463,S,15057.3083,E,0.0,117.4,010911,,,A*76,F,imei:351525010943661,")); + + assertNotNull(decoder.decode(null, null, + "GPRMC,010203.000,A,0102.0003,N,00102.0003,E,1.02,1.02,010203,,,A*00,F,,imei:10000000000000,")); + + assertNotNull(decoder.decode(null, null, + "GPRMC,233842.000,A,5001.3060,N,01429.3243,E,0.00,,210211,,,A*74,F,imei:354776030495631,")); + + assertNotNull(decoder.decode(null, null, + "GPRMC,080303.000,A,5546.7313,N,03738.6005,E,0.56,160.13,100311,,,A*6A,L,imei:354778030461167,")); + + } + +} diff --git a/test/org/traccar/protocol/avl08/Avl08ProtocolDecoderTest.java b/test/org/traccar/protocol/avl08/Avl08ProtocolDecoderTest.java deleted file mode 100644 index 281d780b3..000000000 --- a/test/org/traccar/protocol/avl08/Avl08ProtocolDecoderTest.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.traccar.protocol.avl08; - -import java.util.List; -import org.junit.Test; -import org.traccar.Device; -import org.traccar.Position; -import org.traccar.DataManager; -import static org.junit.Assert.*; - -public class Avl08ProtocolDecoderTest { - - private class TestDataManager implements DataManager { - public List getDevices() { - return null; - } - - public Device getDeviceByImei(String imei) { - Device device = new Device(); - device.setId(new Long(1)); - device.setImei("10000000000000"); - return device; - } - - public void setPosition(Position position) { - } - } - - @Test - public void testDecode() throws Exception { - - Avl08ProtocolDecoder decoder = new Avl08ProtocolDecoder(new Avl08ProtocolDecoderTest.TestDataManager(), 0); - - //$$(2 Bytes) + Len(2 Bytes) + IMEI(15 Bytes) + | + AlarmType(2 Bytes) + GPRMC + | + - //PDOP + | + HDOP + | + VDOP + | + Status(12 Bytes) + | + RTC(14 Bytes) + | + Voltage(8 Bytes) - //+ | + ADC(8 Bytes) + | + LACCI(8 Bytes) + | + Temperature(4 Bytes) | +Mile-meter+| +Serial(4 - //Bytes) + | +RFID(10Bytes)+|+ Checksum (4 Byte) + \r\n(2 Bytes) - - assertNull(decoder.decode(null, null, - "$$AE359772033395899|AA000000000000000000000000000000000000000000000000000000000000|00.0|00.0|00.0|000000000000|20090215000153|13601435|00000000|00000000|0000|0.0000|0007|2DAA")); - - assertNull(decoder.decode(null, null, - "$$AE359772033395899|AA000000000000000000000000000000000000000000000000000000000000|00.0|00.0|00.0|00000000|20090215001204|14182037|00000000|0012D888|0000|0.0000|0016|5B51")); - - assertNull(decoder.decode(null, null, - "$$AE359772033395899|AA00000000000000000000000000000000000000000000000000000000000|00.0|00.0|00.0|00000000000|20090215001337|14182013|00000000|0012D888|0000|0.0000|0017|346E")); - - assertNotNull(decoder.decode(null, null, - "$$B3359772032399074|60$GPRMC,094859.000,A,3648.2229,N,01008.0976,E,0.00,,221211,,,A*79|02.3|01.3|02.0|000000000000|20111222094858|13360808|00000000|00000000|0000|0.0000|0001||A977")); - - assertNotNull(decoder.decode(null, null, - "$$B3359772032399074|09$GPRMC,094905.000,A,3648.2229,N,01008.0976,E,0.00,,221211,,,A*71|02.1|01.3|01.7|000000000000|20111222094905|03210533|00000000|00000000|0000|0.0000|0002||FA58")); - - assertNotNull(decoder.decode(null, null, - "$$B3359772032399074|AA$GPRMC,093911.000,A,3648.2146,N,01008.0977,E,0.00,,140312,,,A*7E|02.1|01.1|01.8|000000000000|20120314093910|04100057|00000000|0012D887|0000|0.0000|1128||C50E")); - - assertNotNull(decoder.decode(null, null, - "$$B3359772032399074|AA$GPRMC,094258.000,A,3648.2146,N,01008.0977,E,0.00,,140312,,,A*7F|02.1|01.1|01.8|000000000000|20120314094257|04120057|00000000|0012D887|0000|0.0000|1136||CA32")); - - assertNotNull(decoder.decode(null, null, - "$$B3359772032399074|AA$GPRMC,234603.000,A,3648.2179,N,01008.0962,E,0.00,,030412,,,A*74|01.8|01.0|01.5|000000000000|20120403234603|14251914|00000000|0012D888|0000|0.0000|3674||940B")); - } - -} diff --git a/test/org/traccar/protocol/gl100/Gl100ProtocolDecoderTest.java b/test/org/traccar/protocol/gl100/Gl100ProtocolDecoderTest.java deleted file mode 100644 index 972e849e2..000000000 --- a/test/org/traccar/protocol/gl100/Gl100ProtocolDecoderTest.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.traccar.protocol.gl100; - -import java.util.List; -import org.junit.Test; -import org.traccar.Device; -import org.traccar.Position; -import org.traccar.DataManager; -import static org.junit.Assert.*; - -public class Gl100ProtocolDecoderTest { - - private class TestDataManager implements DataManager { - public List getDevices() { - return null; - } - - public Device getDeviceByImei(String imei) { - Device device = new Device(); - device.setId(new Long(1)); - device.setImei("10000000000000"); - return device; - } - - public void setPosition(Position position) { - } - } - - @Test - public void testDecode() throws Exception { - - Gl100ProtocolDecoder decoder = new Gl100ProtocolDecoder(new TestDataManager(), 0); - - assertNotNull(decoder.decode(null, null, - "+RESP:GTSOS,359231030000010,0,0,0,1,4.3,92,70.0,1,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,11F0,0102120204")); - - assertNotNull(decoder.decode(null, null, - "+RESP:GTRTL,359231030000010,0,0,0,1,4.3,92,70.0,1,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,11F0,0102120204")); - - assertNotNull(decoder.decode(null, null, - "+RESP:GTEST,359231030000010,0,0,0,1,4.3,92,70.0,1,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,11F0,0102120204")); - - assertNotNull(decoder.decode(null, null, - "+RESP:GTSZI,359231030000010,0,3,0,1,4.3,92,70.0,1,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,11F0,0102120204")); - - assertNotNull(decoder.decode(null, null, - "+RESP:GTLBC,359231030000010,02132523415,1,4.3,92,70.0,1,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,11F0,0102120204")); - - assertNotNull(decoder.decode(null, null, - "+RESP:GTTRI,359231030000010,1,0,0,1,4.3,92,70.0,1,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,11F0,0102120204")); - - assertNotNull(decoder.decode(null, null, - "+RESP:GTTRI,359231030000010,2,0,0,1,4.3,92,70.0,1,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,0,0,1,-3.6,145,30.0,2,121.354442,31.221940,20090101000100,0460,0000,18d8,6141,00,11F0,0102120204")); - - //assertNotNull(decoder.decode(null, null, - // "AT+GTHBD=HeartBeat,359231030000010,20090101000000,11F0,0102120204")); - - } - -} diff --git a/test/org/traccar/protocol/gl200/Gl200ProtocolDecoderTest.java b/test/org/traccar/protocol/gl200/Gl200ProtocolDecoderTest.java deleted file mode 100644 index 5f6707ab7..000000000 --- a/test/org/traccar/protocol/gl200/Gl200ProtocolDecoderTest.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.traccar.protocol.gl200; - -import java.util.List; -import org.junit.Test; -import org.traccar.Device; -import org.traccar.Position; -import org.traccar.DataManager; -import static org.junit.Assert.*; - -public class Gl200ProtocolDecoderTest { - - private class TestDataManager implements DataManager { - public List getDevices() { - return null; - } - - public Device getDeviceByImei(String imei) { - Device device = new Device(); - device.setId(new Long(1)); - device.setImei("10000000000000"); - return device; - } - - public void setPosition(Position position) { - } - } - - @Test - public void testDecode() throws Exception { - - Gl200ProtocolDecoder decoder = new Gl200ProtocolDecoder(new TestDataManager(), 0); - - assertNotNull(decoder.decode(null, null, - "+RESP:GTFRI,020102,000035988863964,,0,0,1,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,,20090214093254,11F0")); - - assertNotNull(decoder.decode(null, null, - "+RESP:GTFRI,020102,135790246811220,,0,0,1,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,,20090214093254,11F0")); - - assertNotNull(decoder.decode(null, null, - "+RESP:GTFRI,020102,135790246811220,,0,0,2,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,0,4.3,92,70.0,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,,20090214093254,11F0")); - - assertNotNull(decoder.decode(null, null, - "+RESP:GTDOG,020102,135790246811220,,0,0,1,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,2000.0,20090214093254,11F0")); - - assertNotNull(decoder.decode(null, null, - "+RESP:GTLBC,020102,135790246811220,,+8613800000000,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,,20090214093254,11F0")); - - assertNotNull(decoder.decode(null, null, - "+RESP:GTGCR,020102,135790246811220,,3,50,180,2,0.4,296,-5.4,121.391055,31.164473,20100714104934,0460,0000,1878,0873,00,,20100714104934,000C")); - - } - -} diff --git a/test/org/traccar/protocol/gps103/Gps103ProtocolDecoderTest.java b/test/org/traccar/protocol/gps103/Gps103ProtocolDecoderTest.java deleted file mode 100644 index 79ba76586..000000000 --- a/test/org/traccar/protocol/gps103/Gps103ProtocolDecoderTest.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.traccar.protocol.gps103; - -import java.util.List; -import org.junit.Test; -import org.traccar.Device; -import org.traccar.Position; -import org.traccar.DataManager; -import static org.junit.Assert.*; - -public class Gps103ProtocolDecoderTest { - - private class TestDataManager implements DataManager { - public List getDevices() { - return null; - } - - public Device getDeviceByImei(String imei) { - Device device = new Device(); - device.setId(new Long(1)); - device.setImei("10000000000000"); - return device; - } - - public void setPosition(Position position) { - } - } - - @Test - public void testDecode() throws Exception { - - Gps103ProtocolDecoder decoder = new Gps103ProtocolDecoder(new TestDataManager(), 0); - - // assertNull(decoder.decode(null, null, "##,imei:10000000000000,A")); - - assertNotNull(decoder.decode(null, null, - "imei:10000000000000,help me,1004171910,,F,010203.000,A,0102.0003,N,00102.0003,E,1.02,")); - - assertNotNull(decoder.decode(null, null, - "imei:353451040164707,tracker,1105182344,+36304665439,F,214418.000,A,4804.2222,N,01916.7593,E,0.37,")); - - assertNotNull(decoder.decode(null, null, - "imei:353451042861763,tracker,1106132241,,F,144114.000,A,2301.9052,S,04909.3676,W,0.13,")); - - assertNotNull(decoder.decode(null, null, - "imei:359587010124900,tracker,0809231929,13554900601,F,112909.397,A,2234.4669,N,11354.3287,E,0.11,321.53,")); - - } - -} diff --git a/test/org/traccar/protocol/t55/T55ProtocolDecoderTest.java b/test/org/traccar/protocol/t55/T55ProtocolDecoderTest.java deleted file mode 100644 index 8ee9ce9e9..000000000 --- a/test/org/traccar/protocol/t55/T55ProtocolDecoderTest.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.traccar.protocol.t55; - -import java.util.List; -import org.junit.Test; -import org.traccar.Device; -import org.traccar.Position; -import org.traccar.DataManager; -import static org.junit.Assert.*; - -public class T55ProtocolDecoderTest { - - private class TestDataManager implements DataManager { - public List getDevices() { - return null; - } - - public Device getDeviceByImei(String imei) { - Device device = new Device(); - device.setId(new Long(1)); - device.setImei("10000000000000"); - return device; - } - - public void setPosition(Position position) { - } - } - - @Test - public void testDecode() throws Exception { - - T55ProtocolDecoder decoder = new T55ProtocolDecoder(new TestDataManager(), 0); - - assertNull(decoder.decode(null, null, "$PGID,359853000144328*0F")); - - assertNotNull(decoder.decode(null, null, - "$GPRMC,094907.000,A,6000.5332,N,03020.5192,E,1.17,60.26,091111,,*33")); - - assertNotNull(decoder.decode(null, null, - "$GPRMC,115528.000,A,6000.5432,N,03020.4948,E,,,091111,,*06")); - - } - -} diff --git a/test/org/traccar/protocol/tk103/Tk103ProtocolDecoderTest.java b/test/org/traccar/protocol/tk103/Tk103ProtocolDecoderTest.java deleted file mode 100644 index f1ef85b06..000000000 --- a/test/org/traccar/protocol/tk103/Tk103ProtocolDecoderTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.traccar.protocol.tk103; - -import java.util.List; -import org.junit.Test; -import org.traccar.Device; -import org.traccar.Position; -import org.traccar.DataManager; -import static org.junit.Assert.*; - -public class Tk103ProtocolDecoderTest { - - private class TestDataManager implements DataManager { - public List getDevices() { - return null; - } - - public Device getDeviceByImei(String imei) { - Device device = new Device(); - device.setId(new Long(1)); - device.setImei("10000000000000"); - return device; - } - - public void setPosition(Position position) { - } - } - - @Test - public void testDecode() throws Exception { - - Tk103ProtocolDecoder decoder = new Tk103ProtocolDecoder(new TestDataManager(), 0); - - assertNotNull(decoder.decode(null, null, - "(035988863964BP05000035988863964110524A4241.7977N02318.7561E000.0123536356.5100000000L000946BB")); - - } - -} diff --git a/test/org/traccar/protocol/xexun/XexunProtocolDecoderTest.java b/test/org/traccar/protocol/xexun/XexunProtocolDecoderTest.java deleted file mode 100644 index ec5370406..000000000 --- a/test/org/traccar/protocol/xexun/XexunProtocolDecoderTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.traccar.protocol.xexun; - -import java.util.List; -import org.junit.Test; -import org.traccar.Device; -import org.traccar.Position; -import org.traccar.DataManager; -import static org.junit.Assert.*; - -public class XexunProtocolDecoderTest { - - private class TestDataManager implements DataManager { - public List getDevices() { - return null; - } - - public Device getDeviceByImei(String imei) { - Device device = new Device(); - device.setId(new Long(1)); - device.setImei("10000000000000"); - return device; - } - - public void setPosition(Position position) { - } - } - - @Test - public void testDecode() throws Exception { - - XexunProtocolDecoder decoder = new XexunProtocolDecoder(new TestDataManager(), 0); - - assertNotNull(decoder.decode(null, null, - "GPRMC,150120.000,A,3346.4463,S,15057.3083,E,0.0,117.4,010911,,,A*76,F,imei:351525010943661,")); - - assertNotNull(decoder.decode(null, null, - "GPRMC,010203.000,A,0102.0003,N,00102.0003,E,1.02,1.02,010203,,,A*00,F,,imei:10000000000000,")); - - assertNotNull(decoder.decode(null, null, - "GPRMC,233842.000,A,5001.3060,N,01429.3243,E,0.00,,210211,,,A*74,F,imei:354776030495631,")); - - assertNotNull(decoder.decode(null, null, - "GPRMC,080303.000,A,5546.7313,N,03738.6005,E,0.56,160.13,100311,,,A*6A,L,imei:354778030461167,")); - - } - -} diff --git a/test/org/traccar/protocol/xexun2/Xexun2ProtocolDecoderTest.java b/test/org/traccar/protocol/xexun2/Xexun2ProtocolDecoderTest.java deleted file mode 100644 index 790abc222..000000000 --- a/test/org/traccar/protocol/xexun2/Xexun2ProtocolDecoderTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.traccar.protocol.xexun2; - -import java.util.List; -import org.junit.Test; -import org.traccar.Device; -import org.traccar.Position; -import org.traccar.DataManager; -import static org.junit.Assert.*; - -public class Xexun2ProtocolDecoderTest { - - private class TestDataManager implements DataManager { - public List getDevices() { - return null; - } - - public Device getDeviceByImei(String imei) { - Device device = new Device(); - device.setId(new Long(1)); - device.setImei("10000000000000"); - return device; - } - - public void setPosition(Position position) { - } - } - - @Test - public void testDecode() throws Exception { - - Xexun2ProtocolDecoder decoder = new Xexun2ProtocolDecoder(new TestDataManager(), 0); - - assertNotNull(decoder.decode(null, null, - "111111120009,+436763737552,GPRMC,120009.590,A,4639.6774,N,01418.5737,E,0.00,0.00,111111,,,A*68,F,, imei:359853000144328,04,481.2,F:4.15V,0,139,2689,232,03,2725,0576")); - - } - -} -- cgit v1.2.3