aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-30 18:06:09 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-30 18:06:09 +1300
commitea342be81728290bb529bcecfd9a68874c8b46a6 (patch)
treea2c5392b652c10cc0830b54cef3aa7a295cbb722 /test
parent6cec14dfbbf59e14efd43ab147e70b9f5803aec5 (diff)
downloadtrackermap-server-ea342be81728290bb529bcecfd9a68874c8b46a6.tar.gz
trackermap-server-ea342be81728290bb529bcecfd9a68874c8b46a6.tar.bz2
trackermap-server-ea342be81728290bb529bcecfd9a68874c8b46a6.zip
Implement new CastelCom protocol
Diffstat (limited to 'test')
-rw-r--r--test/org/traccar/ProtocolDecoderTest.java4
-rw-r--r--test/org/traccar/protocol/CastelProtocolDecoderTest.java3
2 files changed, 5 insertions, 2 deletions
diff --git a/test/org/traccar/ProtocolDecoderTest.java b/test/org/traccar/ProtocolDecoderTest.java
index df8eb4e10..95f00e5d1 100644
--- a/test/org/traccar/ProtocolDecoderTest.java
+++ b/test/org/traccar/ProtocolDecoderTest.java
@@ -68,7 +68,7 @@ public class ProtocolDecoderTest {
protected void verifyPositions(BaseProtocolDecoder decoder, Object object) throws Exception {
Object decodedObject = decoder.decode(null, null, object);
Assert.assertNotNull(decodedObject);
- Assert.assertTrue(decodedObject instanceof List);
+ Assert.assertTrue("not a list", decodedObject instanceof List);
Assert.assertFalse("list if empty", ((List) decodedObject).isEmpty());
for (Object item : (List) decodedObject) {
verifyDecodedPosition(item);
@@ -78,7 +78,7 @@ public class ProtocolDecoderTest {
protected void verifyPositions(BaseProtocolDecoder decoder, Object object, Position position) throws Exception {
Object decodedObject = decoder.decode(null, null, object);
Assert.assertNotNull(decodedObject);
- Assert.assertTrue(decodedObject instanceof List);
+ Assert.assertTrue("not a list", decodedObject instanceof List);
Assert.assertFalse("list if empty", ((List) decodedObject).isEmpty());
for (Object item : (List) decodedObject) {
verifyDecodedPosition(item, position);
diff --git a/test/org/traccar/protocol/CastelProtocolDecoderTest.java b/test/org/traccar/protocol/CastelProtocolDecoderTest.java
index be4cab227..fe1514738 100644
--- a/test/org/traccar/protocol/CastelProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/CastelProtocolDecoderTest.java
@@ -13,6 +13,9 @@ public class CastelProtocolDecoderTest extends ProtocolDecoderTest {
CastelProtocolDecoder decoder = new CastelProtocolDecoder(new CastelProtocol());
+ verifyPosition(decoder, binary(ByteOrder.LITTLE_ENDIAN,
+ "40405c000c363131313530303030393536000000000000000040011c0a0f0e362dca53cd0860831303000000000300000000ff000000000000007ba083a650542d3639305f56312e312e320050542d3639302056312e32008a020d0a"));
+
verifyNothing(decoder, binary(ByteOrder.LITTLE_ENDIAN,
"4040450004323132474c31313433303035303033000000000040082ca89b55a6a99b555c57000000000000c40200000b0000001400036401111f000302f5533bd653f10d0a"));