aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-29 16:40:01 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-29 16:40:01 +1300
commit35b82397627fa48505861ec69da34fa9164a60b5 (patch)
treea931e017c32e6447f9110a235af33a98928cff83 /test
parent9a7e9e1b5822351c2c7aec8d6f1fde5b637afaaf (diff)
downloadtraccar-server-35b82397627fa48505861ec69da34fa9164a60b5.tar.gz
traccar-server-35b82397627fa48505861ec69da34fa9164a60b5.tar.bz2
traccar-server-35b82397627fa48505861ec69da34fa9164a60b5.zip
Support GL200 info messages
Diffstat (limited to 'test')
-rw-r--r--test/org/traccar/ProtocolDecoderTest.java6
-rw-r--r--test/org/traccar/protocol/Gl200ProtocolDecoderTest.java10
2 files changed, 11 insertions, 5 deletions
diff --git a/test/org/traccar/ProtocolDecoderTest.java b/test/org/traccar/ProtocolDecoderTest.java
index 925f457a1..e52ea4695 100644
--- a/test/org/traccar/ProtocolDecoderTest.java
+++ b/test/org/traccar/ProtocolDecoderTest.java
@@ -51,10 +51,10 @@ public class ProtocolDecoderTest {
protected void verifyAttributes(BaseProtocolDecoder decoder, Object object) throws Exception {
Object decodedObject = decoder.decode(null, null, object);
- Assert.assertNotNull(decodedObject);
- Assert.assertTrue(decodedObject instanceof Position);
+ Assert.assertNotNull("position is null", decodedObject);
+ Assert.assertTrue("not a position", decodedObject instanceof Position);
Position position = (Position) decodedObject;
- Assert.assertFalse(position.getAttributes().isEmpty());
+ Assert.assertFalse("no attributes", position.getAttributes().isEmpty());
}
protected void verifyPosition(BaseProtocolDecoder decoder, Object object) throws Exception {
diff --git a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java
index 9a124143d..4596a5c90 100644
--- a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java
@@ -9,7 +9,13 @@ public class Gl200ProtocolDecoderTest extends ProtocolDecoderTest {
public void testDecode() throws Exception {
Gl200ProtocolDecoder decoder = new Gl200ProtocolDecoder(new Gl200Protocol());
-
+
+ verifyAttributes(decoder, text(
+ "+RESP:GTINF,1F0101,135790246811220,1G1JC5444R7252367,,16,898600810906F8048812,16,0,1,12000,,4.2,0,0,,,20090214013254,,,,,,+0800,0,20090214093254,11F0$"));
+
+ verifyAttributes(decoder, text(
+ "+RESP:GTFRI,120113,555564055560555,,1,1,1,,,,,,,,0282,0380,f080,cabf,6900,79,20140824165629,0001$"));
+
verifyPosition(decoder, text(
"+RESP:GTFRI,0F0106,862193020451183,,,10,1,1,0.0,163,,-57.513617,-25.368191,20150918182145,,,,,,21235.0,,,,0,210100,,,,20150918182149,00B8$"));
@@ -123,7 +129,7 @@ public class Gl200ProtocolDecoderTest extends ProtocolDecoderTest {
verifyNothing(decoder, text(
"\u0000\u0004,0017,0,GTPNA,,867844000400914,,0,0,1,0,,,,0,0,,,,,,99,20150404190153,0601$"));
-
+
verifyPosition(decoder, text(
"\u0000\u0004,0017,0,GTEPN,,867844000400914,,0,0,1,0,0.0,0,1717.4,-75.598445,6.278578,20150405003116,,,,,95,20150405003358,0607$"));