From 24b6fb1778d4d5c8835974fca92c00558323e0e2 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 3 Nov 2013 11:36:58 +1300 Subject: Implement Sanav protocol (fix #421) --- .../traccar/protocol/SanavProtocolDecoderTest.java | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 test/org/traccar/protocol/SanavProtocolDecoderTest.java (limited to 'test') diff --git a/test/org/traccar/protocol/SanavProtocolDecoderTest.java b/test/org/traccar/protocol/SanavProtocolDecoderTest.java new file mode 100644 index 000000000..83895245b --- /dev/null +++ b/test/org/traccar/protocol/SanavProtocolDecoderTest.java @@ -0,0 +1,34 @@ +package org.traccar.protocol; + +import static org.junit.Assert.assertNotNull; +import org.junit.Test; + +public class SanavProtocolDecoderTest { + + @Test + public void testDecode() throws Exception { + + SanavProtocolDecoder decoder = new SanavProtocolDecoder(null); + decoder.setDataManager(new TestDataManager()); + + assertNotNull(decoder.decode(null, null, + "imei=352024028982787&rmc=$GPRMC,103048.000,A,4735.0399,N,01905.2895,E,0.00,0.00,171013,,*05,AUTO-4095mv")); + + assertNotNull(decoder.decode(null, null, + "imei:352024028980000rmc:$GPRMC,093604.354,A,4735.0862,N,01905.2146,E,0.00,0.00,171013,,*09,AUTO-4103mv")); + + assertNotNull(decoder.decode(null, null, + "imei:352024027800000rmc:$GPRMC,000025.000,A,4735.0349,N,01905.2899,E,0.00,202.97,171013,,*03,3950mV,AUTO")); + + assertNotNull(decoder.decode(null, null, + "imei:352024020976845rmc:$GPRMC,000201.000,A,4655.7043,N,01941.3796,E,0.54,159.14,171013,,,A*65,AUTO")); + + assertNotNull(decoder.decode(null, null, + "imei=352024028982787&rmc=$GPRMC,103048.000,A,4735.0399,N,01905.2895,E,0.00,0.00,171013,,")); + + assertNotNull(decoder.decode(null, null, + "65,AUTOimei=352024028982787&rmc=$GPRMC,103048.000,A,4735.0399,N,01905.2895,E,0.00,0.00,171013,,")); + + } + +} -- cgit v1.2.3