aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-08-23 01:19:09 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2013-08-23 01:19:09 +1200
commitcaa4fd747981075ed47315fffc5bbd18268278bd (patch)
treeea03028dce590667c5c289e1dc2962d6ca3dddea /test/org/traccar
parentf94f4ea8f327a6d89cf3b484296bd4d97f2dde9f (diff)
downloadtrackermap-server-caa4fd747981075ed47315fffc5bbd18268278bd.tar.gz
trackermap-server-caa4fd747981075ed47315fffc5bbd18268278bd.tar.bz2
trackermap-server-caa4fd747981075ed47315fffc5bbd18268278bd.zip
Added OsmAnd protocol
Diffstat (limited to 'test/org/traccar')
-rw-r--r--test/org/traccar/protocol/OsmAndProtocolDecoderTest.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/OsmAndProtocolDecoderTest.java b/test/org/traccar/protocol/OsmAndProtocolDecoderTest.java
new file mode 100644
index 000000000..9fb44b2ff
--- /dev/null
+++ b/test/org/traccar/protocol/OsmAndProtocolDecoderTest.java
@@ -0,0 +1,25 @@
+package org.traccar.protocol;
+
+import org.jboss.netty.handler.codec.http.DefaultHttpRequest;
+import org.jboss.netty.handler.codec.http.HttpMethod;
+import org.jboss.netty.handler.codec.http.HttpVersion;
+import static org.junit.Assert.assertNotNull;
+import org.junit.Test;
+
+public class OsmAndProtocolDecoderTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ OsmAndProtocolDecoder decoder = new OsmAndProtocolDecoder(null);
+ decoder.setDataManager(new TestDataManager());
+
+ assertNotNull(decoder.decode(null, null, new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET,
+ "/?id=123456&timestamp=1377177267&lat=60.0&lon=30.0&speed=0.0&bearing=0.0&altitude=0&hdop=0.0")));
+
+ assertNotNull(decoder.decode(null, null, new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET,
+ "/?id=123456&timestamp=1377177267&lat=60.0&lon=30.0")));
+
+ }
+
+}