diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-07-14 23:43:23 +0300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-07-14 23:43:23 +0300 |
commit | ab81b1434504d9ed288079f2cf0eb81aaffa668c (patch) | |
tree | 4a7270b07b5add7b16d04da85971304e8ea7ce69 /test/org | |
parent | f421a3f7205966cc4359bc0e01ae5afbceb006fb (diff) | |
download | trackermap-server-ab81b1434504d9ed288079f2cf0eb81aaffa668c.tar.gz trackermap-server-ab81b1434504d9ed288079f2cf0eb81aaffa668c.tar.bz2 trackermap-server-ab81b1434504d9ed288079f2cf0eb81aaffa668c.zip |
Implement TEK733 protocol
Diffstat (limited to 'test/org')
-rw-r--r-- | test/org/traccar/protocol/TekFrameDecoderTest.java | 23 | ||||
-rw-r--r-- | test/org/traccar/protocol/TekProtocolDecoderTest.java | 24 |
2 files changed, 47 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/TekFrameDecoderTest.java b/test/org/traccar/protocol/TekFrameDecoderTest.java new file mode 100644 index 000000000..0446670d8 --- /dev/null +++ b/test/org/traccar/protocol/TekFrameDecoderTest.java @@ -0,0 +1,23 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolTest; + +public class TekFrameDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + TekFrameDecoder decoder = new TekFrameDecoder(); + + verifyFrame( + binary("020315048715E70861074028023219026200400A0340002C007F0009000000000000000000402842064028420641284206402844064128440640284406402844064028440641284406402844060010010C04052B000253000000000001060A0000000000000228330000FF0000FF360014B394"), + decoder.decode(null, null, binary("020315048715E70861074028023219026200400A0340002C007F0009000000000000000000402842064028420641284206402844064128440640284406402844064028440641284406402844060010010C04052B000253000000000001060A0000000000000228330000FF0000FF360014B394"))); + + verifyFrame( + binary("0501C2828E14750861075021004551047B00019700000082010F0A5B28770A5B28770A5B28760A5B28770A5B28770A5B28770A5B28770A5B28760A5B28760A5B28760A5B28770A5B28760A5B28760A5B28760A5D28770A5D28770A5D28770A5D28770A5D28770A5D28770A5D28770A5D28770A5D28770A5D28770A5F2877000000000000000000000000EEBA"), + decoder.decode(null, null, binary("0501C2828E14750861075021004551047B00019700000082010F0A5B28770A5B28770A5B28760A5B28770A5B28770A5B28770A5B28770A5B28760A5B28760A5B28760A5B28770A5B28760A5B28760A5B28760A5D28770A5D28770A5D28770A5D28770A5D28770A5D28770A5D28770A5D28770A5D28770A5D28770A5F2877000000000000000000000000EEBA"))); + + } + +} diff --git a/test/org/traccar/protocol/TekProtocolDecoderTest.java b/test/org/traccar/protocol/TekProtocolDecoderTest.java new file mode 100644 index 000000000..64bcf1285 --- /dev/null +++ b/test/org/traccar/protocol/TekProtocolDecoderTest.java @@ -0,0 +1,24 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolTest; + +public class TekProtocolDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + TekProtocolDecoder decoder = new TekProtocolDecoder(new TekProtocol()); + + verifyPosition(decoder, binary( + "0501E304E00E76086107502100455111492C33332C3137303935342E302C353235352E393933344E2C30303833322E34333935572C322E312C3133342E382C322C302E30302C302E302C302E302C3234303931352C30362C3C45")); + + verifyAttributes(decoder, binary( + "0501C2828E14750861075021004551047B00019700000082010F0A5B28770A5B28770A5B28760A5B28770A5B28770A5B28770A5B28770A5B28760A5B28760A5B28760A5B28770A5B28760A5B28760A5B28760A5D28770A5D28770A5D28770A5D28770A5D28770A5D28770A5D28770A5D28770A5D28770A5D28770A5F2877000000000000000000000000EEBA")); + + verifyAttributes(decoder, binary( + "0509220886157E0863835020373564087B00018C0000018003160A6E28790A6E28790A6E287A0A6E287A0A6E287A0A6E287A0A6E287A0A6E287A0A6E287A0A6E287A000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000BD35")); + + } + +} |