aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/protocol/PiligrimProtocolDecoderTest.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-22 15:26:17 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-22 15:26:17 +1300
commit1ca95d099df96d576a0eaddc6e42b5b41aed3e06 (patch)
tree65ae84eb5e301317263fd72c31cc54922c71eb96 /test/org/traccar/protocol/PiligrimProtocolDecoderTest.java
parent122a26d2822f35b27b9cb0b217916d6b821d9654 (diff)
downloadtrackermap-server-1ca95d099df96d576a0eaddc6e42b5b41aed3e06.tar.gz
trackermap-server-1ca95d099df96d576a0eaddc6e42b5b41aed3e06.tar.bz2
trackermap-server-1ca95d099df96d576a0eaddc6e42b5b41aed3e06.zip
Refactor protocol unit testing
Diffstat (limited to 'test/org/traccar/protocol/PiligrimProtocolDecoderTest.java')
-rw-r--r--test/org/traccar/protocol/PiligrimProtocolDecoderTest.java14
1 files changed, 4 insertions, 10 deletions
diff --git a/test/org/traccar/protocol/PiligrimProtocolDecoderTest.java b/test/org/traccar/protocol/PiligrimProtocolDecoderTest.java
index eef6cc65e..bd5c2460f 100644
--- a/test/org/traccar/protocol/PiligrimProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/PiligrimProtocolDecoderTest.java
@@ -1,14 +1,9 @@
package org.traccar.protocol;
-import org.jboss.netty.buffer.ChannelBuffers;
-import org.jboss.netty.handler.codec.http.DefaultHttpRequest;
import org.jboss.netty.handler.codec.http.HttpMethod;
-import org.jboss.netty.handler.codec.http.HttpRequest;
-import org.jboss.netty.handler.codec.http.HttpVersion;
-import static org.traccar.helper.DecoderVerifier.verify;
import org.junit.Test;
-import org.traccar.helper.ChannelBufferTools;
+import org.traccar.ProtocolDecoderTest;
public class PiligrimProtocolDecoderTest extends ProtocolDecoderTest {
@@ -17,10 +12,9 @@ public class PiligrimProtocolDecoderTest extends ProtocolDecoderTest {
PiligrimProtocolDecoder decoder = new PiligrimProtocolDecoder(new PiligrimProtocol());
- HttpRequest msg1 = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, "/bingps?imei=868204005544720&csq=18&vout=00&vin=4050&dataid=00000000");
- msg1.setContent(ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString(
- "fff2200d4110061a32354f3422310062000a0005173b0000a101000300005e00fff2200d4110100932354f2b22310042000b000e173b00009f01000700006000")));
- verify(decoder.decode(null, null, msg1));
+ verifyPositions(decoder, request(HttpMethod.POST,
+ "/bingps?imei=868204005544720&csq=18&vout=00&vin=4050&dataid=00000000",
+ binary("fff2200d4110061a32354f3422310062000a0005173b0000a101000300005e00fff2200d4110100932354f2b22310042000b000e173b00009f01000700006000")));
}