aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-04-06 21:32:12 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2019-04-06 21:32:12 -0700
commite6b0e38e6d250253b62c41dac3f01a9309a8de7f (patch)
tree4d5d43aea056c97b1d38153f8ad5fc85b0e8a42b /src/test/java/org
parent70fe57f3f5e3b0a10912e00b542fab07a4a8dfc7 (diff)
downloadtrackermap-server-e6b0e38e6d250253b62c41dac3f01a9309a8de7f.tar.gz
trackermap-server-e6b0e38e6d250253b62c41dac3f01a9309a8de7f.tar.bz2
trackermap-server-e6b0e38e6d250253b62c41dac3f01a9309a8de7f.zip
Implement Globalstar protocol
Diffstat (limited to 'src/test/java/org')
-rw-r--r--src/test/java/org/traccar/protocol/GlobalstarProtocolDecoderTest.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/test/java/org/traccar/protocol/GlobalstarProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/GlobalstarProtocolDecoderTest.java
new file mode 100644
index 000000000..625d697d7
--- /dev/null
+++ b/src/test/java/org/traccar/protocol/GlobalstarProtocolDecoderTest.java
@@ -0,0 +1,27 @@
+package org.traccar.protocol;
+
+import io.netty.handler.codec.http.HttpMethod;
+import org.junit.Test;
+import org.traccar.ProtocolTest;
+
+public class GlobalstarProtocolDecoderTest extends ProtocolTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ GlobalstarProtocolDecoder decoder = new GlobalstarProtocolDecoder(null);
+
+ verifyPositions(decoder, request(HttpMethod.POST, "/", buffer(
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>",
+ "<stuMessages xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://cody.glpconnect.com/XSD/StuMessage_Rev1_0_1.xsd\" timeStamp=\"17/02/2019 21:56:15 GMT\" messageID=\"2a471778dda31005850dc52bb93ae81a\">",
+ "<stuMessage>",
+ "<esn>0-2654816</esn>",
+ "<unixTime>1550440592</unixTime>",
+ "<gps>N</gps>",
+ "<payload length=\"9\" source=\"pc\" encoding=\"hex\">0x00337BA319B7280A00</payload>",
+ "</stuMessage>",
+ "</stuMessages>")));
+
+ }
+
+}