aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/org/traccar/helper/BcdUtilTest.java (renamed from test/org/traccar/helper/ChannelBufferToolsTest.java)8
-rw-r--r--test/org/traccar/protocol/CityeasyProtocolEncoderTest.java5
-rw-r--r--test/org/traccar/protocol/Gt06ProtocolEncoderTest.java5
-rw-r--r--test/org/traccar/protocol/KhdProtocolEncoderTest.java5
-rw-r--r--test/org/traccar/protocol/TramigoProtocolDecoderTest.java2
5 files changed, 5 insertions, 20 deletions
diff --git a/test/org/traccar/helper/ChannelBufferToolsTest.java b/test/org/traccar/helper/BcdUtilTest.java
index 6733a8f2a..8767ac890 100644
--- a/test/org/traccar/helper/ChannelBufferToolsTest.java
+++ b/test/org/traccar/helper/BcdUtilTest.java
@@ -4,12 +4,12 @@ import org.jboss.netty.buffer.ChannelBuffers;
import org.junit.Assert;
import org.junit.Test;
-public class ChannelBufferToolsTest {
+public class BcdUtilTest {
@Test
- public void testReadHexInteger() {
+ public void testReadInteger() {
byte[] buf = {0x01, (byte) 0x90, 0x34};
- int result = ChannelBufferTools.readHexInteger(
+ int result = BcdUtil.readInteger(
ChannelBuffers.wrappedBuffer(buf), 5);
Assert.assertEquals(1903, result);
}
@@ -17,7 +17,7 @@ public class ChannelBufferToolsTest {
@Test
public void testReadCoordinate() {
byte[] buf = {0x03, (byte) 0x85, 0x22, 0x59, 0x34};
- double result = ChannelBufferTools.readCoordinate(
+ double result = BcdUtil.readCoordinate(
ChannelBuffers.wrappedBuffer(buf));
Assert.assertEquals(38.870989, result, 0.00001);
}
diff --git a/test/org/traccar/protocol/CityeasyProtocolEncoderTest.java b/test/org/traccar/protocol/CityeasyProtocolEncoderTest.java
index 4ef3c48ef..96b3c2b74 100644
--- a/test/org/traccar/protocol/CityeasyProtocolEncoderTest.java
+++ b/test/org/traccar/protocol/CityeasyProtocolEncoderTest.java
@@ -1,14 +1,9 @@
package org.traccar.protocol;
-import org.jboss.netty.buffer.ChannelBuffers;
-import org.junit.Assert;
import org.junit.Test;
import org.traccar.ProtocolTest;
-import org.traccar.helper.ChannelBufferTools;
import org.traccar.model.Command;
-import javax.xml.bind.DatatypeConverter;
-
public class CityeasyProtocolEncoderTest extends ProtocolTest {
@Test
diff --git a/test/org/traccar/protocol/Gt06ProtocolEncoderTest.java b/test/org/traccar/protocol/Gt06ProtocolEncoderTest.java
index 71657c366..aceaef434 100644
--- a/test/org/traccar/protocol/Gt06ProtocolEncoderTest.java
+++ b/test/org/traccar/protocol/Gt06ProtocolEncoderTest.java
@@ -1,14 +1,9 @@
package org.traccar.protocol;
-import org.jboss.netty.buffer.ChannelBuffers;
-import org.junit.Assert;
import org.junit.Test;
import org.traccar.ProtocolTest;
-import org.traccar.helper.ChannelBufferTools;
import org.traccar.model.Command;
-import javax.xml.bind.DatatypeConverter;
-
public class Gt06ProtocolEncoderTest extends ProtocolTest {
@Test
diff --git a/test/org/traccar/protocol/KhdProtocolEncoderTest.java b/test/org/traccar/protocol/KhdProtocolEncoderTest.java
index e453deaf5..078b7c22e 100644
--- a/test/org/traccar/protocol/KhdProtocolEncoderTest.java
+++ b/test/org/traccar/protocol/KhdProtocolEncoderTest.java
@@ -1,14 +1,9 @@
package org.traccar.protocol;
-import org.jboss.netty.buffer.ChannelBuffers;
-import org.junit.Assert;
import org.junit.Test;
import org.traccar.ProtocolTest;
-import org.traccar.helper.ChannelBufferTools;
import org.traccar.model.Command;
-import javax.xml.bind.DatatypeConverter;
-
public class KhdProtocolEncoderTest extends ProtocolTest {
@Test
diff --git a/test/org/traccar/protocol/TramigoProtocolDecoderTest.java b/test/org/traccar/protocol/TramigoProtocolDecoderTest.java
index a11e69a6a..bc73d8f88 100644
--- a/test/org/traccar/protocol/TramigoProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/TramigoProtocolDecoderTest.java
@@ -42,7 +42,7 @@ public class TramigoProtocolDecoderTest extends ProtocolTest {
// Tramigo: Parked, 0.12 km E of McDonald's H.V. dela Costa, Makati, 11:07 Mar 27
// Tramigo: Moving, 0.90 km SE of Cranebrook Fire Station, Penrith, Sydney, AU, -33.70722, 150.71759, SE with speed 37 km/h, 19:48 Jan 4 EOF
- //verifyPosition(decoder, text( ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray(
+ //verifyPosition(decoder, text( ChannelBuffers.wrappedBuffer(BcdUtil.convertArray(
// new int[] {0x68,0x68,0x25,0x00,0x00,0x01,0x23,0x45,0x67,0x89,0x01,0x23,0x45,0x00,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x6B,0x3F,0x3E,0x02,0x6B,0x3F,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x0D,0x0A}))));
}