ocol;
-import java.util.List;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
import org.junit.Test;;
- }
-
- public Device getDeviceByImei(String imei) {
- Device device = new Device();
- device.setId(new Long{
- }
- }
-
@Test
public void testDecode() throws Exception {
- A
-
@Test
public void testDecode() throws Exception {
@@ -53,7 +33,6 @@ public class Gl100ProtocolDecoderTest {
//assertNotNull(decoder.decode(null, null,
// "AT+GTHBD=HeartBeat,359231030000010,20090101000000,11F0,0102120204"));
-
}
}
- public List getDevices() {
- return null;
- }
-
- public Device getDeviceByImei(String imei) {
- Device device = new Device();
- device.setId(new Long(1));
- device.setImei("10000000000000");
- return device;
- }
-
- public void setPosition(Position position) {
- }
- }
'>test/org/traccar/protocol/gl200/Gl200ProtocolDecoderTest.java
+++ b/
@@ -1,30 +1,10 @@-package org.traccar.protocol.gl200;
+package org.traccar.protocol;
-import java.util.List;
+import static org.junit.Assert.assertNotNull;
import org.junit.Test;
-import org.traccar.Device;
-import org.traccar.Position;
-import org.traccar.DataManager;
-import static org.junit.Assert.*;
public class Gl200ProtocolDecoderTest {
- private class TestDataManager implements DataManager {
- public List getDevices() {
- return null;
- }
-
- public Device getDeviceByImei(String imei) {
- Device device = new Device();
- device.setId(new Long(1));
- device.setImei("10000000000000");
- return device;
- }
-
- public void setPosition(Position position) {
- }
- }
-
@Test
public void testDecode() throws Exception {
@@ -1,30 +1,10 @@
-package org.traccar.protocol.gps103;
+package org.traccar.protocol;
-import java.util.List;
+import static org.junit.Assert.assertNotNull;
import org.junit.Test;
-import org.traccar.Device;
-import org.traccar.Position;
-import org.traccar.DataManager;
-import static org.junit.Assert.*;
public class Gps103ProtocolDecoderTest {
- private class TestDataManager implements DataManager {
- public List getDevices() {
- return null;
- }
-
- public Device getDeviceByImei(String imei) {
- Device device = new Device();
- device.setId(new Long(1));
- device.setImei("10000000000000");
- return device;
- }
-
- public void setPosition(Position position) {
- }
- }
-
@Test
public void testDecode() throws Exception {
@@ -0,0 +1,24 @@
+package org.traccar.protocol;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import org.junit.Test;
+
+public class T55ProtocolDecoderTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ T55ProtocolDecoder decoder = new T55ProtocolDecoder(new TestDataManager(), 0);
+
+ assertNull(decoder.decode(null, null, "$PGID,359853000144328*0F"));
+
+ assertNotNull(decoder.decode(null, null,
+ "$GPRMC,094907.000,A,6000.5332,N,03020.5192,E,1.17,60.26,091111,,*33"));
+
+ assertNotNull(decoder.decode(null, null,
+ "$GPRMC,115528.000,A,6000.5432,N,03020.4948,E,,,091111,,*06"));
+
+ }
+
+}
@@ -0,0 +1,18 @@
+package org.traccar.protocol;
+
+import static org.junit.Assert.assertNotNull;
+import org.junit.Test;
+
+public class Tk103ProtocolDecoderTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ Tk103ProtocolDecoder decoder = new Tk103ProtocolDecoder(new TestDataManager(), 0);
+
+ assertNotNull(decoder.decode(null, null,
+ "(035988863964BP05000035988863964110524A4241.7977N02318.7561E000.0123536356.5100000000L000946BB"));
+
+ }
+
+}
@@ -0,0 +1,18 @@
+package org.traccar.protocol;
+
+import static org.junit.Assert.assertNotNull;
+import org.junit.Test;
+
+public class Xexun2ProtocolDecoderTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ Xexun2ProtocolDecoder decoder = new Xexun2ProtocolDecoder(new TestDataManager(), 0);
+
+ assertNotNull(decoder.decode(null, null,
+ "111111120009,+436763737552,GPRMC,120009.590,A,4639.6774,N,01418.5737,E,0.00,0.00,111111,,,A*68,F,, imei:359853000144328,04,481.2,F:4.15V,0,139,2689,232,03,2725,0576"));
+
+ }
+
+}
@@ -1,30 +1,10 @@
-package org.traccar.protocol.xexun;
+package org.traccar.protocol;
-import java.util.List;
+import static org.junit.Assert.assertNotNull;
import org.junit.Test;
-import org.traccar.Device;
-import org.traccar.Position;
-import org.traccar.DataManager;
-import static org.junit.Assert.*;
public class XexunProtocolDecoderTest {
- private class TestDataManager implements DataManager {
- public List getDevices() {
- return null;
- }
-
- public Device getDeviceByImei(String imei) {
- Device device = new Device();
- device.setId(new Long(1));
- device.setImei("10000000000000");
- return device;
- }
-
- public void setPosition(Position position) {
- }
- }
-
@Test
public void testDecode() throws Exception {
@@ -1,43 +0,0 @@
-package org.traccar.protocol.t55;
-
-import java.util.List;
-import org.junit.Test;
-import org.traccar.Device;
-import org.traccar.Position;
-import org.traccar.DataManager;
-import static org.junit.Assert.*;
-
-public class T55ProtocolDecoderTest {
-
- private class TestDataManager implements DataManager {
- public List getDevices() {
- return null;
- }
-
- public Device getDeviceByImei(String imei) {
- Device device = new Device();
- device.setId(new Long(1));
- device.setImei("10000000000000");
- return device;
- }
-
- public void setPosition(Position position) {
- }
- }
-
- @Test
- public void testDecode() throws Exception {
-
- T55ProtocolDecoder decoder = new T55ProtocolDecoder(new TestDataManager(), 0);
-
- assertNull(decoder.decode(null, null, "$PGID,359853000144328*0F"));
-
- assertNotNull(decoder.decode(null, null,
- "$GPRMC,094907.000,A,6000.5332,N,03020.5192,E,1.17,60.26,091111,,*33"));
-
- assertNotNull(decoder.decode(null, null,
- "$GPRMC,115528.000,A,6000.5432,N,03020.4948,E,,,091111,,*06"));
-
- }
-
-}
@@ -1,38 +0,0 @@
-package org.traccar.protocol.tk103;
-
-import java.util.List;
-import org.junit.Test;
-import org.traccar.Device;
-import org.traccar.Position;
-import org.traccar.DataManager;
-import static org.junit.Assert.*;
-
-public class Tk103ProtocolDecoderTest {
-
- private class TestDataManager implements DataManager {
- public List getDevices() {
- return null;
- }
-
- public Device getDeviceByImei(String imei) {
- Device device = new Device();
- device.setId(new Long(1));
- device.setImei("10000000000000");
- return device;
- }
-
- public void setPosition(Position position) {
- }
- }
-
- @Test
- public void testDecode() throws Exception {
-
- Tk103ProtocolDecoder decoder = new Tk103ProtocolDecoder(new TestDataManager(), 0);
-
- assertNotNull(decoder.decode(null, null,
- "(035988863964BP05000035988863964110524A4241.7977N02318.7561E000.0123536356.5100000000L000946BB"));
-
- }
-
-}
@@ -1,38 +0,0 @@
-package org.traccar.protocol.xexun2;
-
-import java.util.List;
-import org.junit.Test;
-import org.traccar.Device;
-import org.traccar.Position;
-import org.traccar.DataManager;
-import static org.junit.Assert.*;
-
-public class Xexun2ProtocolDecoderTest {
-
- private class TestDataManager implements DataManager {
- public List getDevices() {
- return null;
- }
-
- public Device getDeviceByImei(String imei) {
- Device device = new Device();
- device.setId(new Long(1));
- device.setImei("10000000000000");
- return device;
- }
-
- public void setPosition(Position position) {
- }
- }
-
- @Test
- public void testDecode() throws Exception {
-
- Xexun2ProtocolDecoder decoder = new Xexun2ProtocolDecoder(new TestDataManager(), 0);
-
- assertNotNull(decoder.decode(null, null,
- "111111120009,+436763737552,GPRMC,120009.590,A,4639.6774,N,01418.5737,E,0.00,0.00,111111,,,A*68,F,, imei:359853000144328,04,481.2,F:4.15V,0,139,2689,232,03,2725,0576"));
-
- }
-
-}