diff options
Diffstat (limited to 'test')
10 files changed, 73 insertions, 2 deletions
diff --git a/test/org/traccar/protocol/EelinkProtocolDecoderTest.java b/test/org/traccar/protocol/EelinkProtocolDecoderTest.java index 921b9e327..3e2a896f7 100644 --- a/test/org/traccar/protocol/EelinkProtocolDecoderTest.java +++ b/test/org/traccar/protocol/EelinkProtocolDecoderTest.java @@ -2,6 +2,7 @@ package org.traccar.protocol; import org.junit.Test; import org.traccar.ProtocolTest; +import org.traccar.model.Position; public class EelinkProtocolDecoderTest extends ProtocolTest { @@ -13,6 +14,10 @@ public class EelinkProtocolDecoderTest extends ProtocolTest { verifyNull(decoder, binary( "454C0027E753035254407167747167670100180002035254407167747100200205020500010432000086BD")); + verifyAttribute(decoder, binary( + "6767120043000e5c37387c0304e4e1b4f8194fa800160013009408012e03702d8706453c6e5b066f115f05710000001b067f8d248d240313020500000000000000000000000001cc"), + Position.PREFIX_TEMP + 2, 28.75); + verifyPosition(decoder, binary( "676714002414B05AD43A7D03026B92B10C395499FFD7000000000701CC00002495000014203604067B")); diff --git a/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java b/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java index 8b7034ca8..570cd7506 100644 --- a/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java @@ -16,6 +16,12 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest { verifyNull(decoder, binary( "78780D01086471700328358100093F040D0A")); + verifyNotNull(decoder, binary( + "7878006919012105090303028f01007549e05a00bc9c5c5a007a8d1a5a0d0a")); + + verifyNotNull(decoder, binary( + "7878001719011910543607028f0100bc2e695a00bcb3635a00bc27c56400bc447b6400bc46c96400bc33ce6400bc64ca640d0a")); + verifyAttributes(decoder, binary( "797900de8c120b1502121b013137333d302c3232333d312c3238333d30303030303030302c3436333d30303030303035362c3437333d30303030303030662c3438333d30303030303031312c3242333d30303030303030302c3244333d30303030313839632c3335333d30303030313661382c3336333d30303032386163382c3339333d30303030303230612c3330333d30303030303561612c3439333d30303030303030302c3441333d4b4e4146323431434d4b353031343235352c3341333d30303030303338352c3530333d30303030c0041df0940f89c06700000000c800910d0a")); @@ -172,6 +178,9 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest { verifyAttributes(decoder, binary( "7979003F940D110315102A202141494F494C2C30322C3030382E3239302C3032392E3630302C3531394A2C303430302C3030382E3433302C302C30302C4142001678EA0D0A")); + verifyAttributes(decoder, binary( + "79790039940d2141494f494c2c30322c3030322e3732302c3032392e3530302c3532344a2c303130302c3030332e3430302c302c30302c393309ad72000d0a")); + verifyNull(decoder, binary( "79790005840016BB1A0D0A")); diff --git a/test/org/traccar/protocol/H02ProtocolDecoderTest.java b/test/org/traccar/protocol/H02ProtocolDecoderTest.java index acfb96c82..4a5eadf52 100644 --- a/test/org/traccar/protocol/H02ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/H02ProtocolDecoderTest.java @@ -11,6 +11,9 @@ public class H02ProtocolDecoderTest extends ProtocolTest { H02ProtocolDecoder decoder = new H02ProtocolDecoder(null); + verifyNotNull(decoder, buffer( + "*hq,356327081001239,VP1,V,470,002,92,3565,0Y92,19433,30Y92,1340,29#")); + verifyPosition(decoder, binary( "2435248308419329301047591808172627335900074412294E024138FEFFFFFFFF01120064BA73005ECC")); diff --git a/test/org/traccar/protocol/NeosProtocolDecoderTest.java b/test/org/traccar/protocol/NeosProtocolDecoderTest.java new file mode 100644 index 000000000..a8db30476 --- /dev/null +++ b/test/org/traccar/protocol/NeosProtocolDecoderTest.java @@ -0,0 +1,18 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolTest; + +public class NeosProtocolDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + NeosProtocolDecoder decoder = new NeosProtocolDecoder(null); + + verifyPosition(decoder, text( + ">12345678,1,1,070201,144111,W05829.2613,S3435.2313,,00,034,25,00,126-000,0,3,11111111*2d!\r\n")); + + } + +} diff --git a/test/org/traccar/protocol/SatsolProtocolDecoderTest.java b/test/org/traccar/protocol/SatsolProtocolDecoderTest.java new file mode 100644 index 000000000..45e919bbb --- /dev/null +++ b/test/org/traccar/protocol/SatsolProtocolDecoderTest.java @@ -0,0 +1,21 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolTest; + +public class SatsolProtocolDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + SatsolProtocolDecoder decoder = new SatsolProtocolDecoder(null); + + verifyPositions(decoder, binary( + "f0e1bf4cb2ec1600e1005f8791e901000000c959515c2cc24a03aeadcd010e01a800250001090201878e92e901000000cb59515c2dc24a03b8adcd018801a8001d0001080201325993e901000000cc59515c2fc24a03bfadcd01ab01a800220001080201dd8194e901000000cd59515c32c24a03ceadcd015801a8002500010802015f3795e905000900ce59515c32c24a03d8adcd01f600a700250001091401000000000000000000863496e901000000cf59515c34c24a03ddadcd019b00a700280001090201714197e904000600cf59515c34c24a03ddadcd019b00a7002800010a1401becd07001901")); + + verifyPositions(decoder, binary( + "22b5bf4cb2ec1600500122b37ba020001500cb5d2f5c68c24a0310aecd016200b1003d000004000177042700a501000000000000000101020100011e00a1657ca020001500cf5d2f5c68c24a03dbadcd013501b10097000004030177042700a501000000000000000101020101011e00816e7da003004800b95e2f5c89c24a03fbadcd010000aa00000000040601011038363133353930333632333039323600383933373530323730313030323335343836363000323537303237303132333534383636004d5453000000000066640101005700e515cf047ea001000000295f2f5c89c24a03fbadcd0100009a0000000106020106dc30a8030048006bc13e5c19c24a03bfadcd010000ad00000000050600011338363133353930333632333039323600383933373530323730313030323335343836363000323537303237303132333534383636004d5453000000000066640101005700e515")); + + } + +} diff --git a/test/org/traccar/protocol/T55ProtocolDecoderTest.java b/test/org/traccar/protocol/T55ProtocolDecoderTest.java index 6b286b485..c5737f367 100644 --- a/test/org/traccar/protocol/T55ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/T55ProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class T55ProtocolDecoderTest extends ProtocolTest { T55ProtocolDecoder decoder = new T55ProtocolDecoder(null); + verifyPosition(decoder, text( + "660420156A0066AA$GPRMC,122806.0,A,0119.212178,N,10355.000942,E,0.0,,230119,0.0,E,A*27")); + verifyNull(decoder, text( "$IMEI=355797031609284")); diff --git a/test/org/traccar/protocol/TotemProtocolDecoderTest.java b/test/org/traccar/protocol/TotemProtocolDecoderTest.java index c9990acdf..287c54968 100644 --- a/test/org/traccar/protocol/TotemProtocolDecoderTest.java +++ b/test/org/traccar/protocol/TotemProtocolDecoderTest.java @@ -11,6 +11,10 @@ public class TotemProtocolDecoderTest extends ProtocolTest { TotemProtocolDecoder decoder = new TotemProtocolDecoder(null); verifyPosition(decoder, text( + "$$0113AA862010037348253|588040001901220851494212000000753AE901655121700100000.800000002632.6084S02803.3289E29497E"), + position("2019-01-22 08:51:49.000", true, -26.54347, 28.05548)); + + verifyPosition(decoder, text( "$$011602867119025755430|50099800180420045019401400000000000000B8797D110816811201.500002132615.7037S02801.8099E056149")); verifyPosition(decoder, text( @@ -32,7 +36,8 @@ public class TotemProtocolDecoderTest extends ProtocolTest { "$$0128AA864244026065291|18001800140916020524401100000000000000000000000027BA0E57063100000001.200000002237.8119N11403.5075E05202D")); verifyPosition(decoder, text( - "$$0128AA867965024919124|10010800160223032415401203270321032103270189000027BA0E4E001800200001.000000002237.7581N11403.5088E000957")); + "$$0128AA867965024919124|10010800160223032415401203270321032103270189000027BA0E4E001800200001.000000002237.7581N11403.5088E000957"), + position("2016-02-23 03:24:15.000", false, 22.62930, 114.05848)); verifyPosition(decoder, text( "$$0108AA863835024426319|18004000160216160756411100007DCD0000111000000000.800000000316.3519N10228.5086E126522")); diff --git a/test/org/traccar/protocol/UproProtocolDecoderTest.java b/test/org/traccar/protocol/UproProtocolDecoderTest.java index ff7ead961..dbbe4591f 100644 --- a/test/org/traccar/protocol/UproProtocolDecoderTest.java +++ b/test/org/traccar/protocol/UproProtocolDecoderTest.java @@ -11,6 +11,9 @@ public class UproProtocolDecoderTest extends ProtocolTest { UproProtocolDecoder decoder = new UproProtocolDecoder(null); verifyPosition(decoder, buffer( + "*HQ200861810538000002,BA&A0206033302618209658563620115180119&B0100000040&C6328680=&F0039&R2710&V0036&T09&K50000&N04&P0200#")); + + verifyPosition(decoder, buffer( "*HQ200999999,AB1&A1656512233362911356523660000230618&B0100060010&C00000<6<&F0000&R2405&V0109&W0000003E&K00100&T65&X(k89860045191536000374)#")); verifyPosition(decoder, buffer( diff --git a/test/org/traccar/protocol/VtfmsProtocolDecoderTest.java b/test/org/traccar/protocol/VtfmsProtocolDecoderTest.java index 2d3940528..ede5dc7ac 100644 --- a/test/org/traccar/protocol/VtfmsProtocolDecoderTest.java +++ b/test/org/traccar/protocol/VtfmsProtocolDecoderTest.java @@ -11,6 +11,10 @@ public class VtfmsProtocolDecoderTest extends ProtocolTest { VtfmsProtocolDecoder decoder = new VtfmsProtocolDecoder(null); verifyPosition(decoder, text( + "(861359037432331,0EF87,00,0,21,2,01,,A,154559,230119,1101.4046,07656.3859,241,000,00078,00000,K,0000812,1,12.7,,,,,,1,0,0,0,1,1,1,+919566531111*+919994462226,)054"), + position("2019-01-23 15:45:59.000", true, 11.02341, 76.93977)); + + verifyPosition(decoder, text( "(865733028143493,00I76,00,000,,,,,A,133755,210617,10.57354,077.24912,SW,000,00598,00000,K,0017368,1,12.7,,,0.000,,,0,0,0,0,1,1,0,,)074")); verifyPosition(decoder, text( diff --git a/test/org/traccar/protocol/WatchProtocolEncoderTest.java b/test/org/traccar/protocol/WatchProtocolEncoderTest.java index e088a2b04..f55086082 100644 --- a/test/org/traccar/protocol/WatchProtocolEncoderTest.java +++ b/test/org/traccar/protocol/WatchProtocolEncoderTest.java @@ -43,7 +43,7 @@ public class WatchProtocolEncoderTest extends ProtocolTest { command.setDeviceId(1); command.setType(Command.TYPE_MESSAGE); command.set(Command.KEY_MESSAGE, "text"); - assertEquals("[CS*123456789012345*0010*MESSAGE,74657874]", encoder.encodeCommand(null, command)); + assertEquals("[CS*123456789012345*0018*MESSAGE,0074006500780074]", encoder.encodeCommand(null, command)); command = new Command(); command.setDeviceId(1); |