aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar
diff options
context:
space:
mode:
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")));
+
+ }
+
+}