diff options
Diffstat (limited to 'test/org')
-rw-r--r-- | test/org/traccar/helper/ChannelBufferToolsTest.java | 11 | ||||
-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 { |