aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-09-05 16:04:53 +1200
committerGitHub <noreply@github.com>2017-09-05 16:04:53 +1200
commit2a49efdd97bb44c78afb27b00b57d14ed0f403ae (patch)
tree7f954059b508b4fd96d6976d3cd81ed2728a73f6 /test
parent99fd421c76c8e7491095a91630516f6d2db27034 (diff)
parent158071c9ff74c5435b8f51ea82215240acb69551 (diff)
downloadtrackermap-server-2a49efdd97bb44c78afb27b00b57d14ed0f403ae.tar.gz
trackermap-server-2a49efdd97bb44c78afb27b00b57d14ed0f403ae.tar.bz2
trackermap-server-2a49efdd97bb44c78afb27b00b57d14ed0f403ae.zip
Merge pull request #3502 from Abyss777/command_timezone
Accept timezone id instead of offset in commands
Diffstat (limited to 'test')
-rw-r--r--test/org/traccar/protocol/CityeasyProtocolEncoderTest.java4
-rw-r--r--test/org/traccar/protocol/Jt600ProtocolEncoderTest.java2
-rw-r--r--test/org/traccar/protocol/MeiligaoProtocolEncoderTest.java4
-rw-r--r--test/org/traccar/protocol/MiniFinderProtocolEncoderTest.java6
-rw-r--r--test/org/traccar/protocol/Pt502ProtocolEncoderTest.java2
-rw-r--r--test/org/traccar/protocol/WatchProtocolEncoderTest.java8
6 files changed, 13 insertions, 13 deletions
diff --git a/test/org/traccar/protocol/CityeasyProtocolEncoderTest.java b/test/org/traccar/protocol/CityeasyProtocolEncoderTest.java
index 96b3c2b74..7c03b7d5b 100644
--- a/test/org/traccar/protocol/CityeasyProtocolEncoderTest.java
+++ b/test/org/traccar/protocol/CityeasyProtocolEncoderTest.java
@@ -10,11 +10,11 @@ public class CityeasyProtocolEncoderTest extends ProtocolTest {
public void testEncode() throws Exception {
CityeasyProtocolEncoder encoder = new CityeasyProtocolEncoder();
-
+
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_SET_TIMEZONE);
- command.set(Command.KEY_TIMEZONE, 6 * 3600);
+ command.set(Command.KEY_TIMEZONE, "GMT+6");
verifyCommand(encoder, command, binary("5353001100080001680000000B60820D0A"));
diff --git a/test/org/traccar/protocol/Jt600ProtocolEncoderTest.java b/test/org/traccar/protocol/Jt600ProtocolEncoderTest.java
index 80802dc35..100d7492a 100644
--- a/test/org/traccar/protocol/Jt600ProtocolEncoderTest.java
+++ b/test/org/traccar/protocol/Jt600ProtocolEncoderTest.java
@@ -25,7 +25,7 @@ public class Jt600ProtocolEncoderTest extends ProtocolTest {
@Test
public void testSetTimezone() throws Exception {
command.setType(Command.TYPE_SET_TIMEZONE);
- command.set(Command.KEY_TIMEZONE, 240 * 60);
+ command.set(Command.KEY_TIMEZONE, "GMT+4");
assertEquals("(S09,1,240)", encoder.encodeCommand(command));
}
diff --git a/test/org/traccar/protocol/MeiligaoProtocolEncoderTest.java b/test/org/traccar/protocol/MeiligaoProtocolEncoderTest.java
index f9d77f8a6..ee4a869f9 100644
--- a/test/org/traccar/protocol/MeiligaoProtocolEncoderTest.java
+++ b/test/org/traccar/protocol/MeiligaoProtocolEncoderTest.java
@@ -10,7 +10,7 @@ public class MeiligaoProtocolEncoderTest extends ProtocolTest {
public void testEncode() throws Exception {
MeiligaoProtocolEncoder encoder = new MeiligaoProtocolEncoder();
-
+
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_POSITION_SINGLE);
@@ -23,7 +23,7 @@ public class MeiligaoProtocolEncoderTest extends ProtocolTest {
verifyCommand(encoder, command, binary("40400013123456789012344102000a2f4f0d0a"));
command.setType(Command.TYPE_SET_TIMEZONE);
- command.set(Command.KEY_TIMEZONE, 480 * 60);
+ command.set(Command.KEY_TIMEZONE, "GMT+8");
verifyCommand(encoder, command, binary("4040001412345678901234413234383030ad0d0a"));
diff --git a/test/org/traccar/protocol/MiniFinderProtocolEncoderTest.java b/test/org/traccar/protocol/MiniFinderProtocolEncoderTest.java
index 99b250ebc..360ea0008 100644
--- a/test/org/traccar/protocol/MiniFinderProtocolEncoderTest.java
+++ b/test/org/traccar/protocol/MiniFinderProtocolEncoderTest.java
@@ -11,12 +11,12 @@ public class MiniFinderProtocolEncoderTest extends ProtocolTest {
public void testEncode() throws Exception {
MiniFinderProtocolEncoder encoder = new MiniFinderProtocolEncoder();
-
+
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_SET_TIMEZONE);
- command.set(Command.KEY_TIMEZONE, 3600);
-
+ command.set(Command.KEY_TIMEZONE, "GMT+1");
+
Assert.assertEquals("123456L+01", encoder.encodeCommand(command));
command = new Command();
diff --git a/test/org/traccar/protocol/Pt502ProtocolEncoderTest.java b/test/org/traccar/protocol/Pt502ProtocolEncoderTest.java
index ab6446010..62406d3f2 100644
--- a/test/org/traccar/protocol/Pt502ProtocolEncoderTest.java
+++ b/test/org/traccar/protocol/Pt502ProtocolEncoderTest.java
@@ -30,7 +30,7 @@ public class Pt502ProtocolEncoderTest extends ProtocolTest {
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_SET_TIMEZONE);
- command.set(Command.KEY_TIMEZONE, 8);
+ command.set(Command.KEY_TIMEZONE, "GMT+8");
Assert.assertEquals("#TMZ8\r\n", encoder.encodeCommand(command));
diff --git a/test/org/traccar/protocol/WatchProtocolEncoderTest.java b/test/org/traccar/protocol/WatchProtocolEncoderTest.java
index 7184d278e..cffe373cf 100644
--- a/test/org/traccar/protocol/WatchProtocolEncoderTest.java
+++ b/test/org/traccar/protocol/WatchProtocolEncoderTest.java
@@ -41,16 +41,16 @@ public class WatchProtocolEncoderTest extends ProtocolTest {
command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_SET_TIMEZONE);
- command.set(Command.KEY_TIMEZONE, 60 * 60);
+ command.set(Command.KEY_TIMEZONE, "Europe/Amsterdam");
Assert.assertEquals("[CS*123456789012345*0006*LZ,,+1]", encoder.encodeCommand(command));
- command.set(Command.KEY_TIMEZONE, 90 * 60);
+ command.set(Command.KEY_TIMEZONE, "GMT+01:30");
Assert.assertEquals("[CS*123456789012345*0008*LZ,,+1.5]", encoder.encodeCommand(command));
- command.set(Command.KEY_TIMEZONE, -60 * 60);
+ command.set(Command.KEY_TIMEZONE, "Atlantic/Azores");
Assert.assertEquals("[CS*123456789012345*0006*LZ,,-1]", encoder.encodeCommand(command));
- command.set(Command.KEY_TIMEZONE, -11 * 60 * 60 - 30 * 60);
+ command.set(Command.KEY_TIMEZONE, "GMT-11:30");
Assert.assertEquals("[CS*123456789012345*0009*LZ,,-11.5]", encoder.encodeCommand(command));
}