diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-09-26 12:10:50 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-09-26 12:10:50 +1200 |
commit | 61f82e3dce810d99bfdd02e6b7e66c6f617a13b5 (patch) | |
tree | dbb31d0564d69cd4d31e4f06b10112d2725665d3 /test/org/traccar/protocol | |
parent | a0991e9461ef0a6a14ba90aa9a91dc9ce790bce9 (diff) | |
download | traccar-server-61f82e3dce810d99bfdd02e6b7e66c6f617a13b5.tar.gz traccar-server-61f82e3dce810d99bfdd02e6b7e66c6f617a13b5.tar.bz2 traccar-server-61f82e3dce810d99bfdd02e6b7e66c6f617a13b5.zip |
Implement ITS protocol
Diffstat (limited to 'test/org/traccar/protocol')
-rw-r--r-- | test/org/traccar/protocol/ItsProtocolDecoderTest.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/ItsProtocolDecoderTest.java b/test/org/traccar/protocol/ItsProtocolDecoderTest.java new file mode 100644 index 000000000..b8d6a1730 --- /dev/null +++ b/test/org/traccar/protocol/ItsProtocolDecoderTest.java @@ -0,0 +1,30 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolTest; + +public class ItsProtocolDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + ItsProtocolDecoder decoder = new ItsProtocolDecoder(new ItsProtocol()); + + verifyNull(decoder, text( + "$,01,XYZ123,0.0.1,861359034137271,MH12AB1234,")); + + verifyNull(decoder, text( + "$,02,XYZ123,0.0.1,861359034137271,100,30,00.0,00005,00600,1000,01,00.1,00.0,")); + + verifyPosition(decoder, text( + "$,EPB,EMR,861359034100626,SP,00,00,0000,00,00,00,V,000.000000,N,000.000000,E,000.0,000.0,000.00,N,MH12AB1234,0000000000000,d34679e1,")); + + verifyNull(decoder, text( + "$,03,XYZ123,0.0.1,TA,16,L,861359034137271,MH12AB1234,0,00,00,0000,00,00,00,000.000000,N,000.000000,E,000.0,000.00,00,000.0,00.00,00.00,IDEAIN,1,1,00.0,4.0,1,O,16,404,22,2797,11b7,11b9,2797,-087,11b8,2797,-093,11b4,2797,-106,0000,0000,0000,1000,01,000032,8173e058,")); + + verifyNull(decoder, text( + "$,04,XYZ123,0.0.1,BR,06,L,861359034137271,MH12AB1234,0,00,00,0000,00,00,00,000.000000,N,000.000000,E,000.0,000.00,00,000.0,00.00,00.00,IDEAIN,1,1,00.0,3.8,1,O,17,404,22,2797,11b7,11b9,2797,-093,11b8,2797,-098,0000,0000,0000,0000,0000,0000,1000,00,000006,abd26284,")); + + } + +} |