aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-09-04 18:01:43 +0500
committerAbyss777 <abyss@fox5.ru>2017-09-04 18:01:43 +0500
commit87392d9fbb0289b5486496b6e6b97db1ea84e2b7 (patch)
tree6d8413ad76307ee7bc52b5788dc202bb55762958 /test
parent99fd421c76c8e7491095a91630516f6d2db27034 (diff)
downloadtraccar-server-87392d9fbb0289b5486496b6e6b97db1ea84e2b7.tar.gz
traccar-server-87392d9fbb0289b5486496b6e6b97db1ea84e2b7.tar.bz2
traccar-server-87392d9fbb0289b5486496b6e6b97db1ea84e2b7.zip
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));
}