aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/protocol/CellocatorProtocolDecoderTest.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-11-09 19:01:19 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2013-11-09 19:01:19 +1300
commitcf0565caceee6856328e481dd23600ed2590c88a (patch)
tree9d2cc8cf8d3eb27b36412eb492ad702581891f1c /test/org/traccar/protocol/CellocatorProtocolDecoderTest.java
parentf9ecee5b732b0c82c8a95bebdb5e275ea479cccc (diff)
downloadtrackermap-server-cf0565caceee6856328e481dd23600ed2590c88a.tar.gz
trackermap-server-cf0565caceee6856328e481dd23600ed2590c88a.tar.bz2
trackermap-server-cf0565caceee6856328e481dd23600ed2590c88a.zip
Improve unit test verification
Diffstat (limited to 'test/org/traccar/protocol/CellocatorProtocolDecoderTest.java')
-rw-r--r--test/org/traccar/protocol/CellocatorProtocolDecoderTest.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/org/traccar/protocol/CellocatorProtocolDecoderTest.java b/test/org/traccar/protocol/CellocatorProtocolDecoderTest.java
index 5d5594fcb..2788e6ba1 100644
--- a/test/org/traccar/protocol/CellocatorProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/CellocatorProtocolDecoderTest.java
@@ -1,8 +1,9 @@
package org.traccar.protocol;
+import org.traccar.helper.TestDataManager;
import java.nio.ByteOrder;
import org.jboss.netty.buffer.ChannelBuffers;
-import static org.junit.Assert.assertNotNull;
+import static org.traccar.helper.DecoderVerifier.verify;
import org.junit.Test;
import org.traccar.helper.ChannelBufferTools;
@@ -15,13 +16,13 @@ public class CellocatorProtocolDecoderTest {
decoder.setDataManager(new TestDataManager());
int[] buf1 = {0x4D,0x43,0x47,0x50,0x00,0x06,0x00,0x00,0x00,0x08,0x1A,0x02,0x02,0x12,0x04,0x00,0x00,0x00,0x21,0x00,0x62,0x30,0x00,0x00,0x00,0x6B,0x00,0xE1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE5,0xA1,0x00,0x04,0x02,0x06,0x61,0x4E,0xA3,0x03,0x18,0x1A,0x57,0x03,0x4E,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0x25,0x07,0x14,0x03,0xD6,0x07,0x49};
- assertNotNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertArray(buf1))));
+ verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertArray(buf1))));
int[] buf2 = {0x4d,0x43,0x47,0x50,0x00,0x01,0x01,0x00,0x00,0x08,0x01,0x1f,0x04,0x18,0x04,0x00,0x00,0x00,0x20,0x01,0x00,0x00,0x00,0x00,0x00,0x5e,0x75,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x54,0x85,0x00,0x04,0x02,0x04,0xda,0x4d,0xa3,0x03,0x67,0x19,0x57,0x03,0xe8,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x14,0x15,0x10,0x07,0xdd,0x07,0xf7};
- assertNotNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertArray(buf2))));
+ verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertArray(buf2))));
int[] buf3 = {0x4d,0x43,0x47,0x50,0x00,0x5e,0x93,0x01,0x00,0x08,0x01,0x02,0x04,0x18,0x04,0x00,0x00,0x00,0x20,0x0f,0x20,0x00,0x00,0x00,0x00,0x5e,0x75,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5a,0xf4,0x00,0x04,0x02,0x04,0xda,0x4d,0xa3,0x03,0x67,0x19,0x57,0x03,0xe8,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x1a,0x11,0x1e,0x08,0xdd,0x07,0x60};
- assertNotNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertArray(buf3))));
+ verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertArray(buf3))));
}