diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-30 18:50:43 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-30 18:50:43 +1300 |
commit | c4dc8997bd1fb1178d85a4d70d630782d53c1414 (patch) | |
tree | bde0184bd297973be7a06b66a6c0bc4ec7911b3b /test/org/traccar | |
parent | ea342be81728290bb529bcecfd9a68874c8b46a6 (diff) | |
download | trackermap-server-c4dc8997bd1fb1178d85a4d70d630782d53c1414.tar.gz trackermap-server-c4dc8997bd1fb1178d85a4d70d630782d53c1414.tar.bz2 trackermap-server-c4dc8997bd1fb1178d85a4d70d630782d53c1414.zip |
Implement GPS watch protocol
Diffstat (limited to 'test/org/traccar')
-rw-r--r-- | test/org/traccar/protocol/WatchProtocolDecoderTest.java | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/WatchProtocolDecoderTest.java b/test/org/traccar/protocol/WatchProtocolDecoderTest.java new file mode 100644 index 000000000..712b38f5b --- /dev/null +++ b/test/org/traccar/protocol/WatchProtocolDecoderTest.java @@ -0,0 +1,34 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolDecoderTest; + +public class WatchProtocolDecoderTest extends ProtocolDecoderTest { + + @Test + public void testDecode() throws Exception { + + WatchProtocolDecoder decoder = new WatchProtocolDecoder(new WatchProtocol()); + + verifyNothing(decoder, text( + "[SG*8800000015*0002*LK")); + + verifyNothing(decoder, text( + "[3G*4700186508*000B*LK,0,10,100")); + + verifyPosition(decoder, text( + "[SG*8800000015*0087*UD,220414,134652,A,22.571707,N,113.8613968,E,0.1,0.0,100,7,60,90,1000,50,0000,4,1,460,0,9360,4082,131,9360,4092,148,9360,4091,143,9360,4153,141"), + position("2014-04-22 13:46:52.000", true, 22.57171, 113.86140)); + + verifyPosition(decoder, text( + "[SG*8800000015*0087*UD,220414,134652,A,22.571707,N,113.8613968,E,0.1,0.0,100,7,60,90,1000,50,0000,4,1,460,0,9360,4082,131,9360,4092,148,9360,4091,143,9360,4153,141")); + + verifyPosition(decoder, text( + "[SG*8800000015*0088*UD2,220414,134652,A,22.571707,N,113.8613968,E,0.1,0.0,100,7,60,90,1000,50,0000,4,1,460,0,9360,4082,131,9360,4092,148,9360,4091,143,9360,4153,141")); + + verifyPosition(decoder, text( + "[SG*8800000015*0087*AL,220414,134652,A,22.571707,N,113.8613968,E,0.1,0.0,100,7,60,90,1000,50,0001,4,1,460,0,9360,4082,131,9360,4092,148,9360,4091,143,9360,4153,141")); + + } + +} |