diff options
Diffstat (limited to 'src/test/java/org')
3 files changed, 42 insertions, 4 deletions
diff --git a/src/test/java/org/traccar/protocol/FutureWayFrameDecoderTest.java b/src/test/java/org/traccar/protocol/FutureWayFrameDecoderTest.java new file mode 100644 index 000000000..fb1e395f1 --- /dev/null +++ b/src/test/java/org/traccar/protocol/FutureWayFrameDecoderTest.java @@ -0,0 +1,19 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolTest; + +public class FutureWayFrameDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + FutureWayFrameDecoder decoder = new FutureWayFrameDecoder(); + + verifyFrame( + binary("34313030303030303346323030303032302c494d45493a3335343832383130303132363436312c62617474657279206c6576656c3a362c6e6574776f726b20747970653a372c4353513a323336463432"), + decoder.decode(null, null, binary("34313030303030303346323030303032302c494d45493a3335343832383130303132363436312c62617474657279206c6576656c3a362c6e6574776f726b20747970653a372c4353513a323336463432"))); + + } + +} diff --git a/src/test/java/org/traccar/protocol/FutureWayProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/FutureWayProtocolDecoderTest.java new file mode 100644 index 000000000..951b3bb20 --- /dev/null +++ b/src/test/java/org/traccar/protocol/FutureWayProtocolDecoderTest.java @@ -0,0 +1,21 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolTest; + +public class FutureWayProtocolDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + FutureWayProtocolDecoder decoder = new FutureWayProtocolDecoder(null); + + verifyNull(decoder, text( + "410000003F2000020,IMEI:354828100126461,battery level:6,network type:7,CSQ:236F42")); + + verifyPosition(decoder, text( + "410000009BA00004GPS:V,200902093333,0.000000N,0.000000E,0.000,0.000\r\nWIFI:3,1|90-67-1C-F7-21-6C|52&2|80-89-17-C6-79-A0|54&3|40-F4-20-EF-DD-2A|58\r\nLBS:460,0,46475066,69\r\n6A42")); + + } + +} diff --git a/src/test/java/org/traccar/protocol/XexunFrameDecoderTest.java b/src/test/java/org/traccar/protocol/XexunFrameDecoderTest.java index 8fc628bdb..b91cd0ebf 100644 --- a/src/test/java/org/traccar/protocol/XexunFrameDecoderTest.java +++ b/src/test/java/org/traccar/protocol/XexunFrameDecoderTest.java @@ -3,8 +3,6 @@ package org.traccar.protocol; import org.junit.Test; import org.traccar.ProtocolTest; -import static org.junit.Assert.assertEquals; - public class XexunFrameDecoderTest extends ProtocolTest { @Test @@ -12,11 +10,11 @@ public class XexunFrameDecoderTest extends ProtocolTest { XexunFrameDecoder decoder = new XexunFrameDecoder(); - assertEquals( + verifyFrame( binary("4750524d432c3230353933352e3030302c412c353134302e343335302c4e2c3530312e303638362c452c302e30302c302e30302c3132313031352c30302c303030302e302c412a37302c462c2c696d65693a3335393538373031343731383339322c"), decoder.decode(null, null, binary("313531303132313435392c2b33313635323435343932372c4750524d432c3230353933352e3030302c412c353134302e343335302c4e2c3530312e303638362c452c302e30302c302e30302c3132313031352c30302c303030302e302c412a37302c462c2c696d65693a3335393538373031343731383339322c31323249"))); - assertEquals( + verifyFrame( binary("4750524d432c3130333733312e3633362c412c343534352e353236362c4e2c30303434382e383235392c452c32312e31322c3237362e30312c3135303631352c2c2c412a35372c4c2c2c20696d65693a3031333934393030323032363637352c"), decoder.decode(null, null, binary("3135303631353132333733312c2b33333634373338343631312c4750524d432c3130333733312e3633362c412c343534352e353236362c4e2c30303434382e383235392c452c32312e31322c3237362e30312c3135303631352c2c2c412a35372c4c2c2c20696d65693a3031333934393030323032363637352c30342c333532322e392c463a332e3732562c302c3134322c32313734342c3230382c30312c303730322c394338430a0d"))); |