aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-04-21 15:44:57 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-04-21 15:44:57 +1200
commitfcfef9101c90e160cc4543d367ec44866a18a16a (patch)
treefaa224bfb374e0a9e86eba4bb8c417293bb428c2 /test
parentd2c2f9ded136ffa594ec13f4d426d7e7c5b223cd (diff)
downloadtraccar-server-fcfef9101c90e160cc4543d367ec44866a18a16a.tar.gz
traccar-server-fcfef9101c90e160cc4543d367ec44866a18a16a.tar.bz2
traccar-server-fcfef9101c90e160cc4543d367ec44866a18a16a.zip
Add Progress unit testing
Diffstat (limited to 'test')
-rw-r--r--test/org/traccar/protocol/ProgressProtocolDecoderTest.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/ProgressProtocolDecoderTest.java b/test/org/traccar/protocol/ProgressProtocolDecoderTest.java
new file mode 100644
index 000000000..dd4203609
--- /dev/null
+++ b/test/org/traccar/protocol/ProgressProtocolDecoderTest.java
@@ -0,0 +1,31 @@
+package org.traccar.protocol;
+
+import org.jboss.netty.buffer.ChannelBuffers;
+import org.junit.Test;
+import org.traccar.helper.ChannelBufferTools;
+import org.traccar.helper.TestDataManager;
+
+import java.nio.ByteOrder;
+
+import static org.junit.Assert.assertNull;
+import static org.traccar.helper.DecoderVerifier.verify;
+
+public class ProgressProtocolDecoderTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ ProgressProtocolDecoder decoder = new ProgressProtocolDecoder(new TestDataManager(), null, null);
+
+ assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertHexString(
+ "020037000100000003003131310f003335343836383035313339303036320f00323530303136333832383531353535010000000100000000000000e6bb97b6"))));
+
+ /*verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertHexString(
+ "0a009f00700d000076b1345580feaf2720b7e71a0301000000327f39031f15d2b900ffffffffffffffff00ac2600000900040000000000000000000000000000e52a6810c20000000000001c49010000000000000000000000000d00000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000019000500eefff1ff0000000000000000000000000000000016151c91"))));
+
+ verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertHexString(
+ "0a009f00720d00008ab1345580feaf2720b7e71a0301000000327f39031f15d2b900ffffffffffffffff00ac2600000800050000000000000000000000000000e12a6810c10000000000001c49010000000000000000000000000d00000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000019000500eefff1ff00000000000000000000000000000000052a49f2"))));*/
+
+ }
+
+}