aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/protocol/Tk103ProtocolEncoderTest.java
diff options
context:
space:
mode:
authorValerii Vyshniak <valeravi@vi-soft.com.ua>2017-11-22 02:05:59 +0100
committerValerii Vyshniak <valeravi@vi-soft.com.ua>2017-11-22 02:05:59 +0100
commite5a8be1987aecf3735801165ee19c1bcdd4fcc05 (patch)
tree2704face5d94dd5aab2d4d224578ce33fab05dc9 /test/org/traccar/protocol/Tk103ProtocolEncoderTest.java
parent8d8bab8a2df30629fb612b0573b2bd5f46c4b05e (diff)
downloadtrackermap-server-e5a8be1987aecf3735801165ee19c1bcdd4fcc05.tar.gz
trackermap-server-e5a8be1987aecf3735801165ee19c1bcdd4fcc05.tar.bz2
trackermap-server-e5a8be1987aecf3735801165ee19c1bcdd4fcc05.zip
T580W: review comments fixes 3, re-implemented tk103 frame decoder
Diffstat (limited to 'test/org/traccar/protocol/Tk103ProtocolEncoderTest.java')
-rw-r--r--test/org/traccar/protocol/Tk103ProtocolEncoderTest.java32
1 files changed, 6 insertions, 26 deletions
diff --git a/test/org/traccar/protocol/Tk103ProtocolEncoderTest.java b/test/org/traccar/protocol/Tk103ProtocolEncoderTest.java
index f902268ce..0c16ccee6 100644
--- a/test/org/traccar/protocol/Tk103ProtocolEncoderTest.java
+++ b/test/org/traccar/protocol/Tk103ProtocolEncoderTest.java
@@ -31,10 +31,6 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest {
Assert.assertEquals("(123456789012345AP00)", encoder.encodeCommand(command));
- command.setDeviceId(2);
-
- Assert.assertEquals("[begin]sms2,*getposl*,[end]", encoder.encodeCommand(command));
-
}
@Test
@@ -49,10 +45,6 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest {
Assert.assertEquals("(123456789012345AR00003C0000)", encoder.encodeCommand(command));
- command.setDeviceId(2);
-
- Assert.assertEquals("[begin]sms2,*routetrack*99*,[end]", encoder.encodeCommand(command));
-
}
@Test
@@ -66,10 +58,6 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest {
Assert.assertEquals("(123456789012345AR0000000000)", encoder.encodeCommand(command));
- command.setDeviceId(2);
-
- Assert.assertEquals("[begin]sms2,*routetrackoff*,[end]", encoder.encodeCommand(command));
-
}
@Test
@@ -83,10 +71,6 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest {
Assert.assertEquals("(123456789012345AP07)", encoder.encodeCommand(command));
- command.setDeviceId(2);
-
- Assert.assertEquals("[begin]sms2,*about*,[end]", encoder.encodeCommand(command));
-
}
@Test
@@ -100,10 +84,6 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest {
Assert.assertEquals("(123456789012345AT00)", encoder.encodeCommand(command));
- command.setDeviceId(2);
-
- Assert.assertEquals("[begin]sms2,88888888,[end]", encoder.encodeCommand(command));
-
}
@Test
@@ -125,7 +105,7 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest {
Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder();
Command command = new Command();
- command.setDeviceId(2);
+ command.setDeviceId(1);
command.setType(Command.TYPE_IDENTIFICATION);
Assert.assertEquals("[begin]sms2,999999,[end]", encoder.encodeCommand(command));
@@ -138,7 +118,7 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest {
Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder();
Command command = new Command();
- command.setDeviceId(2);
+ command.setDeviceId(1);
command.setType(Command.TYPE_ALARM_SOS);
command.set(Command.KEY_ENABLE, true);
@@ -152,7 +132,7 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest {
Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder();
Command command = new Command();
- command.setDeviceId(2);
+ command.setDeviceId(1);
command.setType(Command.TYPE_ALARM_SOS);
command.set(Command.KEY_ENABLE, false);
@@ -166,7 +146,7 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest {
Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder();
Command command = new Command();
- command.setDeviceId(2);
+ command.setDeviceId(1);
command.setType(Command.TYPE_CUSTOM);
command.set(Command.KEY_DATA, "any text is ok");
@@ -180,7 +160,7 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest {
Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder();
Command command = new Command();
- command.setDeviceId(2);
+ command.setDeviceId(1);
command.setType(Command.TYPE_SET_CONNECTION);
command.set(Command.KEY_SERVER, "1.2.3.4");
command.set(Command.KEY_PORT, "5555");
@@ -195,7 +175,7 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest {
Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder();
Command command = new Command();
- command.setDeviceId(2);
+ command.setDeviceId(1);
command.setType(Command.TYPE_SOS_NUMBER);
command.set(Command.KEY_INDEX, "0");
command.set(Command.KEY_PHONE, "+55555555555");