diff options
Diffstat (limited to 'test/org/traccar/protocol')
7 files changed, 50 insertions, 2 deletions
diff --git a/test/org/traccar/protocol/EskyProtocolDecoderTest.java b/test/org/traccar/protocol/EskyProtocolDecoderTest.java index 0617ba8a9..5132f42c1 100644 --- a/test/org/traccar/protocol/EskyProtocolDecoderTest.java +++ b/test/org/traccar/protocol/EskyProtocolDecoderTest.java @@ -19,6 +19,9 @@ public class EskyProtocolDecoderTest extends ProtocolTest { verifyPosition(decoder, text( "EO;0;864906029196626;R;0+170808155352+0.00000+0.00000+0.00+0+0x1+0+0+0+1233")); + verifyPosition(decoder, text( + "ET;1;014682000989425;R;0+171216001250+33.34405+-111.96682+0.00+0+0x1+0+25598+0+1257+0")); + } } diff --git a/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java b/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java index 7f191d664..13bc6e38d 100644 --- a/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java @@ -19,8 +19,14 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest { verifyAttributes(decoder, binary( "78780B23C00122040001000818720D0A")); - /*verifyNotNull(decoder, binary( - "78782727110c070f1a338000000000000000000004002d81360104cb8a00bef30004030c02ff0004f4d20d0a"));*/ + verifyNotNull(decoder, binary( + "78782EA4110C0C02281BF6026C18720C38D22800149C1181CC00010000260E000000000615F8012C05041102FF001058FD0D0A")); + + verifyNotNull(decoder, binary( + "78787aa2110c0e06372c813601040000591200000000009d7c01040000591200000000009d7c01040000591200000000009d7c01040000591200000000009d7c01040000591200000000009d7c01040000591200000000009d7c01040000591200000000009d7c0104ff02001801eb4039d10000000000000004fabeb50d0a")); + + verifyNotNull(decoder, binary( + "78782727110c0b0e170f850450059107f461ae001c7e0a81360104cb8a00bef32806030c02ff000316b10d0a")); verifyNotNull(decoder, binary( "78782322110c070f1b0270000000000000000000040081360104cb8a00bef3000000000523030d0a")); diff --git a/test/org/traccar/protocol/HuabaoProtocolDecoderTest.java b/test/org/traccar/protocol/HuabaoProtocolDecoderTest.java index ba4c726ec..9ce1c6caa 100644 --- a/test/org/traccar/protocol/HuabaoProtocolDecoderTest.java +++ b/test/org/traccar/protocol/HuabaoProtocolDecoderTest.java @@ -11,6 +11,9 @@ public class HuabaoProtocolDecoderTest extends ProtocolTest { HuabaoProtocolDecoder decoder = new HuabaoProtocolDecoder(new HuabaoProtocol()); verifyPosition(decoder, binary( + "7e02000054093037612710000700000000000000010223aca000dc9dd800000000000017121417122133362a4d30302c34352c31313336393042383030313233303026303030303030303030303030263132333435363738393031323334353623897e")); + + verifyPosition(decoder, binary( "7e0200002c00160128561400020000000000040001005de1f7065c6cef00000000000017011710044201040000a9002a02000030011b3101030c7e")); verifyPosition(decoder, binary( diff --git a/test/org/traccar/protocol/OigoProtocolDecoderTest.java b/test/org/traccar/protocol/OigoProtocolDecoderTest.java index 452e40a78..af4720853 100644 --- a/test/org/traccar/protocol/OigoProtocolDecoderTest.java +++ b/test/org/traccar/protocol/OigoProtocolDecoderTest.java @@ -11,6 +11,9 @@ public class OigoProtocolDecoderTest extends ProtocolTest { OigoProtocolDecoder decoder = new OigoProtocolDecoder(new OigoProtocol()); verifyPosition(decoder, binary( + "7e002e000000146310002523830400001bfb000369150f310c0591594d062ac0c0141508011303cd63101604fd00000000")); + + verifyPosition(decoder, binary( "0103537820628365110310410790660962521813380026EE4EFF8593AA0065003E00794C020600100500000000")); verifyPosition(decoder, binary( diff --git a/test/org/traccar/protocol/TotemFrameDecoderTest.java b/test/org/traccar/protocol/TotemFrameDecoderTest.java index 2fbb8ec14..0d3e69465 100644 --- a/test/org/traccar/protocol/TotemFrameDecoderTest.java +++ b/test/org/traccar/protocol/TotemFrameDecoderTest.java @@ -12,6 +12,10 @@ public class TotemFrameDecoderTest extends ProtocolTest { TotemFrameDecoder decoder = new TotemFrameDecoder(); verifyFrame( + binary("24243030323542423836323031303033373239343836313345"), + decoder.decode(null, null, binary("24243030323542423836323031303033373239343836313345"))); + + verifyFrame( binary("24243030363545363836313137323033353932363639357c3137303931323135333235372c2d37392e3337333835332c34332e3736353631392c302c302c7c3441"), decoder.decode(null, null, binary("24243030363545363836313137323033353932363639357c3137303931323135333235372c2d37392e3337333835332c34332e3736353631392c302c302c7c3441"))); diff --git a/test/org/traccar/protocol/Tt8850ProtocolDecoderTest.java b/test/org/traccar/protocol/Tt8850ProtocolDecoderTest.java index 6c8302ed1..3e8c80e40 100644 --- a/test/org/traccar/protocol/Tt8850ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Tt8850ProtocolDecoderTest.java @@ -11,6 +11,9 @@ public class Tt8850ProtocolDecoderTest extends ProtocolTest { Tt8850ProtocolDecoder decoder = new Tt8850ProtocolDecoder(new Tt8850Protocol()); verifyPosition(decoder, text( + "\u0000\u0004,007F,0,GTFRI,020102,867844000667538,4142726856,0,0,1,3,1.6,0,997.3,-66.830786,10.483394,20171212171418,0734,0004,041A,4220,69,20171212171657,FF61")); + + verifyPosition(decoder, text( "\u0000\u0004,005F,0,GTFRI,020100,135790246811220,,0,0,1,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,90,20090214093254,11F0")); verifyPosition(decoder, text( diff --git a/test/org/traccar/protocol/XirgoProtocolEncoderTest.java b/test/org/traccar/protocol/XirgoProtocolEncoderTest.java new file mode 100644 index 000000000..dd2e939c9 --- /dev/null +++ b/test/org/traccar/protocol/XirgoProtocolEncoderTest.java @@ -0,0 +1,26 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolTest; +import org.traccar.model.Command; + +import static org.junit.Assert.assertEquals; + +public class XirgoProtocolEncoderTest extends ProtocolTest { + + @Test + public void testEncode() throws Exception { + + XirgoProtocolEncoder encoder = new XirgoProtocolEncoder(); + + Command command = new Command(); + command.setDeviceId(1); + command.setType(Command.TYPE_OUTPUT_CONTROL); + command.set(Command.KEY_INDEX, 0); + command.set(Command.KEY_DATA, 1); + + assertEquals("+XT:7005,2,1", encoder.encodeCommand(command)); + + } + +} |