aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar
diff options
context:
space:
mode:
authoruser <user@laptop.(none)>2012-10-21 21:42:46 +1300
committeruser <user@laptop.(none)>2012-10-21 21:42:46 +1300
commit0af1cebf1e2f3f719edf5391252fcd4004a75157 (patch)
treed897174c4890a8f4039e24f44020c02411c7c902 /test/org/traccar
parenta3441d3bcd02ec48e408957dfdc61dc6850bc339 (diff)
downloadtrackermap-server-0af1cebf1e2f3f719edf5391252fcd4004a75157.tar.gz
trackermap-server-0af1cebf1e2f3f719edf5391252fcd4004a75157.tar.bz2
trackermap-server-0af1cebf1e2f3f719edf5391252fcd4004a75157.zip
JT600 protocol fix
Diffstat (limited to 'test/org/traccar')
-rw-r--r--test/org/traccar/helper/ChannelBufferToolsTest.java11
-rw-r--r--test/org/traccar/protocol/Jt600ProtocolDecoderTest.java (renamed from test/org/traccar/protocol/Jt600ProtocolDecoderTest1.java)2
2 files changed, 12 insertions, 1 deletions
diff --git a/test/org/traccar/helper/ChannelBufferToolsTest.java b/test/org/traccar/helper/ChannelBufferToolsTest.java
index 16ff036b8..792770dab 100644
--- a/test/org/traccar/helper/ChannelBufferToolsTest.java
+++ b/test/org/traccar/helper/ChannelBufferToolsTest.java
@@ -20,4 +20,15 @@ public class ChannelBufferToolsTest {
factory.getBuffer(buf, 0, buf.length), 5);
assertEquals(1903, result);
}
+
+ @Test
+ public void testReadHexString() {
+ byte[] buf = {0x01,(byte)0x90,0x34};
+ String result = ChannelBufferTools.readHexString(
+ factory.getBuffer(buf, 0, buf.length), 5);
+ assertEquals("01903", result);
+
+ result = Long.valueOf(result).toString();
+ assertEquals("1903", result);
+ }
}
diff --git a/test/org/traccar/protocol/Jt600ProtocolDecoderTest1.java b/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java
index cdf8f1568..c08ca0605 100644
--- a/test/org/traccar/protocol/Jt600ProtocolDecoderTest1.java
+++ b/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java
@@ -5,7 +5,7 @@ import org.jboss.netty.buffer.ChannelBuffers;
import static org.junit.Assert.assertNotNull;
import org.junit.Test;
-public class Jt600ProtocolDecoderTest1 {
+public class Jt600ProtocolDecoderTest {
@Test
public void testDecode() throws Exception {