diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-01-25 20:14:42 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-01-26 08:41:45 +1300 |
commit | 87bdccbe9843e38174ad345b8e474b1cded9f985 (patch) | |
tree | 4b2f90ad2b9a5d32410ab9579fb4135b5ac95bfa /test/org/traccar/protocol | |
parent | 8535983fea8c09046c53f2ebf388bbf3fae594ce (diff) | |
download | trackermap-server-87bdccbe9843e38174ad345b8e474b1cded9f985.tar.gz trackermap-server-87bdccbe9843e38174ad345b8e474b1cded9f985.tar.bz2 trackermap-server-87bdccbe9843e38174ad345b8e474b1cded9f985.zip |
Static imports for junit
Diffstat (limited to 'test/org/traccar/protocol')
29 files changed, 159 insertions, 99 deletions
diff --git a/test/org/traccar/protocol/AdmProtocolEncoderTest.java b/test/org/traccar/protocol/AdmProtocolEncoderTest.java index 6d2452e26..fd4ea4af0 100644 --- a/test/org/traccar/protocol/AdmProtocolEncoderTest.java +++ b/test/org/traccar/protocol/AdmProtocolEncoderTest.java @@ -21,6 +21,8 @@ import org.junit.Test; import org.traccar.ProtocolTest; import org.traccar.model.Command; +import static org.junit.Assert.assertEquals; + public class AdmProtocolEncoderTest extends ProtocolTest { @Test @@ -31,13 +33,13 @@ public class AdmProtocolEncoderTest extends ProtocolTest { Command command = new Command(); command.setDeviceId(1); command.setType(Command.TYPE_GET_DEVICE_STATUS); - Assert.assertEquals("STATUS\r\n", encoder.encodeCommand(command)); + assertEquals("STATUS\r\n", encoder.encodeCommand(command)); command = new Command(); command.setDeviceId(1); command.setType(Command.TYPE_CUSTOM); command.set(Command.KEY_DATA, "INPUT 0"); - Assert.assertEquals("INPUT 0\r\n", encoder.encodeCommand(command)); + assertEquals("INPUT 0\r\n", encoder.encodeCommand(command)); } } diff --git a/test/org/traccar/protocol/AplicomFrameDecoderTest.java b/test/org/traccar/protocol/AplicomFrameDecoderTest.java index e000674db..6ba8f9334 100644 --- a/test/org/traccar/protocol/AplicomFrameDecoderTest.java +++ b/test/org/traccar/protocol/AplicomFrameDecoderTest.java @@ -4,6 +4,8 @@ import org.junit.Assert; import org.junit.Test; import org.traccar.ProtocolTest; +import static org.junit.Assert.assertEquals; + public class AplicomFrameDecoderTest extends ProtocolTest { @Test @@ -11,11 +13,11 @@ public class AplicomFrameDecoderTest extends ProtocolTest { AplicomFrameDecoder decoder = new AplicomFrameDecoder(); - Assert.assertEquals( + assertEquals( binary("44C20146B710C158DA009500B09F7700C054CA0EA454CA0EA403BE0BF6015D706B070000142A600000000000000002434946010801000754CA0EA4000000000000008400000000000000000000000000000000300000FE00FE0000000000000000000000000000000000000000000000000000000000000000000040502035000000000000020D0000030D0000040C0000040D0000050C0000050D0000058C0000060C"), decoder.decode(null, null, binary("33353733303030373030393233333644C20146B710C158DA009500B09F7700C054CA0EA454CA0EA403BE0BF6015D706B070000142A600000000000000002434946010801000754CA0EA4000000000000008400000000000000000000000000000000300000FE00FE0000000000000000000000000000000000000000000000000000000000000000000040502035000000000000020D0000030D0000040C0000040D0000050C0000050D0000058C0000060C"))); - Assert.assertEquals( + assertEquals( binary("44C20146B710C158DA009500B09F7700C054CA0EA454CA0EA403BE0BF6015D706B070000142A600000000000000002434946010801000754CA0EA4000000000000008400000000000000000000000000000000300000FE00FE0000000000000000000000000000000000000000000000000000000000000000000040502035000000000000020D0000030D0000040C0000040D0000050C0000050D0000058C0000060C"), decoder.decode(null, null, binary("44C20146B710C158DA009500B09F7700C054CA0EA454CA0EA403BE0BF6015D706B070000142A600000000000000002434946010801000754CA0EA4000000000000008400000000000000000000000000000000300000FE00FE0000000000000000000000000000000000000000000000000000000000000000000040502035000000000000020D0000030D0000040C0000040D0000050C0000050D0000058C0000060C"))); diff --git a/test/org/traccar/protocol/At2000FrameDecoderTest.java b/test/org/traccar/protocol/At2000FrameDecoderTest.java index c7a3dc0b1..52490c107 100644 --- a/test/org/traccar/protocol/At2000FrameDecoderTest.java +++ b/test/org/traccar/protocol/At2000FrameDecoderTest.java @@ -6,6 +6,8 @@ import org.traccar.ProtocolTest; import java.nio.ByteOrder; +import static org.junit.Assert.assertEquals; + public class At2000FrameDecoderTest extends ProtocolTest { @Test @@ -13,11 +15,11 @@ public class At2000FrameDecoderTest extends ProtocolTest { At2000FrameDecoder decoder = new At2000FrameDecoder(); - Assert.assertEquals( + assertEquals( binary(ByteOrder.LITTLE_ENDIAN, "01012f00000000000000000000000000003335363137333036343430373439320fad981997ae8e031fe10c0ea7641903ca32c0331df467233d2a9cd886fbeef8"), decoder.decode(null, null, binary(ByteOrder.LITTLE_ENDIAN, "01012f00000000000000000000000000003335363137333036343430373439320fad981997ae8e031fe10c0ea7641903ca32c0331df467233d2a9cd886fbeef8"))); - Assert.assertEquals( + assertEquals( binary(ByteOrder.LITTLE_ENDIAN, "893f0000000000000000000000000000e048b1a31deba3f5dbe8877f574877e6ed4d022b6611a10d80dfc4c0c11fa8aacf4a9de61528327e2b66843dd9c5d3a7cc9ee1d9c71a34bb482145d88b4fda3e"), decoder.decode(null, null, binary(ByteOrder.LITTLE_ENDIAN, "893f0000000000000000000000000000e048b1a31deba3f5dbe8877f574877e6ed4d022b6611a10d80dfc4c0c11fa8aacf4a9de61528327e2b66843dd9c5d3a7cc9ee1d9c71a34bb482145d88b4fda3e"))); diff --git a/test/org/traccar/protocol/AtrackFrameDecoderTest.java b/test/org/traccar/protocol/AtrackFrameDecoderTest.java index 93e804dc9..12ce783ad 100644 --- a/test/org/traccar/protocol/AtrackFrameDecoderTest.java +++ b/test/org/traccar/protocol/AtrackFrameDecoderTest.java @@ -4,6 +4,8 @@ import org.junit.Assert; import org.junit.Test; import org.traccar.ProtocolTest; +import static org.junit.Assert.assertEquals; + public class AtrackFrameDecoderTest extends ProtocolTest { @Test @@ -11,15 +13,15 @@ public class AtrackFrameDecoderTest extends ProtocolTest { AtrackFrameDecoder decoder = new AtrackFrameDecoder(); - Assert.assertEquals( + assertEquals( binary("244F4B0D0A"), decoder.decode(null, null, binary("244F4B0D0A"))); - Assert.assertEquals( + assertEquals( binary("fe0200014104d8f196820001"), decoder.decode(null, null, binary("fe0200014104d8f196820001"))); - Assert.assertEquals( + assertEquals( binary("40501e58003301e000014104d8f19682525ecd5d525ee344525ee35effc88815026ab4d70000020000104403de01000b0000000007d007d000"), decoder.decode(null, null, binary("40501e58003301e000014104d8f19682525ecd5d525ee344525ee35effc88815026ab4d70000020000104403de01000b0000000007d007d000"))); diff --git a/test/org/traccar/protocol/GalileoFrameDecoderTest.java b/test/org/traccar/protocol/GalileoFrameDecoderTest.java index 1decd73d3..049c16efa 100644 --- a/test/org/traccar/protocol/GalileoFrameDecoderTest.java +++ b/test/org/traccar/protocol/GalileoFrameDecoderTest.java @@ -6,6 +6,8 @@ import org.traccar.ProtocolTest; import java.nio.ByteOrder; +import static org.junit.Assert.assertEquals; + public class GalileoFrameDecoderTest extends ProtocolTest { @Test @@ -13,11 +15,11 @@ public class GalileoFrameDecoderTest extends ProtocolTest { GalileoFrameDecoder decoder = new GalileoFrameDecoder(); - Assert.assertEquals( + assertEquals( binary(ByteOrder.LITTLE_ENDIAN, "011780011102e603383633353931303238393630323437043200801c"), decoder.decode(null, null, binary(ByteOrder.LITTLE_ENDIAN, "011780011102e603383633353931303238393630323437043200801c"))); - Assert.assertEquals( + assertEquals( binary(ByteOrder.LITTLE_ENDIAN, "01d48304320010020520a5829f58300f50dc8a024c0965013300000000344102350740003a41e14b426610431b4459fa672a4500004601a050364c510000520000530000c000000000c100000000c200000000c300000000d80000dd00000000e293000000043200100105202d829f58300f50dc8a024c0965013300000000344102350740003a41d04b426110431b445702882a4500004601a050374c510000520000530000c000000000c100000000c200000000c300000000d80000dd00000000e29400000004320010000520b5819f58300f50dc8a024c0965013300000000344102350740003a419e4b426a10431c4456fab72a4500004601a050434c510000520000530000c000000000c100000000c200000000c300000000d80000dd00000000e29500000004320010ff04203d819f58300f50dc8a024c0965013300000000344102350740003a41874b426310431c4454fe572a4500004601a050334c510000520000530000c000000000c100000000c200000000c300000000d80000dd00000000e29600000004320010fe0420c5809f58300f50dc8a024c0965013300000000344102350840003a41a24b426710431c4457fea72a4500004601a050214c510000520000530000c000000000c100000000c200000000c300000000d80000dd00000000e29700000004320010fd04204d809f58300f50dc8a024c0965013300000000344102350840003a41a34b426310431c4455f6772a4500004601a0502e4c510000520000530000c000000000c100000000c200000000c300000000d80000dd00000000e29900000004320010fc0420d57f9f58300f50dc8a024c0965013300000000344102350840003a41bd4b426510431d4458fe672a4500004601a0501f4c510000520000530000c000000000c100000000c200000000c300000000d80000dd00000000e29700000004320010fb04205d7f9f58300f50dc8a024c0965013300000000344102350840003a41b54b426310431d4456fa772a4500004601a0502d4c510000520000530000c000000000c100000000c200000000c300000000d80000dd00000000e29500000004320010fa0420e57e9f58300f50dc8a024c0965013300000000344102350840003a41b24b426210431e4454fa872a4500004601a050fe4b510000520000530000c000000000c100000000c200000000c300000000d80000dd00000000e29000000004320010f904206d7e9f58300f50dc8a024c0965013300000000344102350a40003a41af4b426710431f4458fea72a4500004601a0500a4c510000520000530000c000000000c100000000c200000000c300000000d80000dd00000000e28900000067c5"), decoder.decode(null, null, binary(ByteOrder.LITTLE_ENDIAN, "01d48304320010020520a5829f58300f50dc8a024c0965013300000000344102350740003a41e14b426610431b4459fa672a4500004601a050364c510000520000530000c000000000c100000000c200000000c300000000d80000dd00000000e293000000043200100105202d829f58300f50dc8a024c0965013300000000344102350740003a41d04b426110431b445702882a4500004601a050374c510000520000530000c000000000c100000000c200000000c300000000d80000dd00000000e29400000004320010000520b5819f58300f50dc8a024c0965013300000000344102350740003a419e4b426a10431c4456fab72a4500004601a050434c510000520000530000c000000000c100000000c200000000c300000000d80000dd00000000e29500000004320010ff04203d819f58300f50dc8a024c0965013300000000344102350740003a41874b426310431c4454fe572a4500004601a050334c510000520000530000c000000000c100000000c200000000c300000000d80000dd00000000e29600000004320010fe0420c5809f58300f50dc8a024c0965013300000000344102350840003a41a24b426710431c4457fea72a4500004601a050214c510000520000530000c000000000c100000000c200000000c300000000d80000dd00000000e29700000004320010fd04204d809f58300f50dc8a024c0965013300000000344102350840003a41a34b426310431c4455f6772a4500004601a0502e4c510000520000530000c000000000c100000000c200000000c300000000d80000dd00000000e29900000004320010fc0420d57f9f58300f50dc8a024c0965013300000000344102350840003a41bd4b426510431d4458fe672a4500004601a0501f4c510000520000530000c000000000c100000000c200000000c300000000d80000dd00000000e29700000004320010fb04205d7f9f58300f50dc8a024c0965013300000000344102350840003a41b54b426310431d4456fa772a4500004601a0502d4c510000520000530000c000000000c100000000c200000000c300000000d80000dd00000000e29500000004320010fa0420e57e9f58300f50dc8a024c0965013300000000344102350840003a41b24b426210431e4454fa872a4500004601a050fe4b510000520000530000c000000000c100000000c200000000c300000000d80000dd00000000e29000000004320010f904206d7e9f58300f50dc8a024c0965013300000000344102350a40003a41af4b426710431f4458fea72a4500004601a0500a4c510000520000530000c000000000c100000000c200000000c300000000d80000dd00000000e28900000067c5"))); diff --git a/test/org/traccar/protocol/GatorProtocolDecoderTest.java b/test/org/traccar/protocol/GatorProtocolDecoderTest.java index 6d4dc06e8..ae6240b3e 100644 --- a/test/org/traccar/protocol/GatorProtocolDecoderTest.java +++ b/test/org/traccar/protocol/GatorProtocolDecoderTest.java @@ -4,12 +4,14 @@ import org.junit.Assert; import org.junit.Test; import org.traccar.ProtocolTest; +import static org.junit.Assert.assertEquals; + public class GatorProtocolDecoderTest extends ProtocolTest { @Test public void testDecodeId() { - Assert.assertEquals("3512345006", GatorProtocolDecoder.decodeId(12, 162, 50, 134)); + assertEquals("3512345006", GatorProtocolDecoder.decodeId(12, 162, 50, 134)); } diff --git a/test/org/traccar/protocol/Gl200FrameDecoderTest.java b/test/org/traccar/protocol/Gl200FrameDecoderTest.java index 54c35f084..2112ce466 100644 --- a/test/org/traccar/protocol/Gl200FrameDecoderTest.java +++ b/test/org/traccar/protocol/Gl200FrameDecoderTest.java @@ -4,6 +4,8 @@ import org.junit.Assert; import org.junit.Test; import org.traccar.ProtocolTest; +import static org.junit.Assert.assertEquals; + public class Gl200FrameDecoderTest extends ProtocolTest { @Test @@ -11,15 +13,15 @@ public class Gl200FrameDecoderTest extends ProtocolTest { Gl200FrameDecoder decoder = new Gl200FrameDecoder(); - Assert.assertEquals( + assertEquals( binary("2b41434b017f244501010108676231303000000000ffff07e1070b03112d054dfe030d0a"), decoder.decode(null, null, binary("2b41434b017f244501010108676231303000000000ffff07e1070b03112d054dfe030d0a"))); - Assert.assertEquals( + assertEquals( binary("2b4556540c00fc1fbf005c4501010108563254030003430564312a41090100000000003f007dff75a11a025c6a7807e1070a14041202680003189c1ac500000000000000000000000000000000000007e1070b041134054e5c6e0d0a"), decoder.decode(null, null, binary("2b4556540c00fc1fbf005c4501010108563254030003430564312a41090100000000003f007dff75a11a025c6a7807e1070a14041202680003189c1ac500000000000000000000000000000000000007e1070b041134054e5c6e0d0a"))); - Assert.assertEquals( + assertEquals( binary("2b524553503a47545354522c3430303330302c3836323336353033303134323238392c474c3530302c302c302c302c33392e342c39332c312c302e332c31372c3130352e382c32352e3934343234302c34342e3430333733362c32303137303532393134303533302c303232362c303030312c353643322c373038342c2c2c2c32303137303532393136303533302c30324441"), decoder.decode(null, null, binary("2b524553503a47545354522c3430303330302c3836323336353033303134323238392c474c3530302c302c302c302c33392e342c39332c312c302e332c31372c3130352e382c32352e3934343234302c34342e3430333733362c32303137303532393134303533302c303232362c303030312c353643322c373038342c2c2c2c32303137303532393136303533302c3032444124"))); diff --git a/test/org/traccar/protocol/Gps056FrameDecoderTest.java b/test/org/traccar/protocol/Gps056FrameDecoderTest.java index a5b5c5bbd..58c64f59e 100644 --- a/test/org/traccar/protocol/Gps056FrameDecoderTest.java +++ b/test/org/traccar/protocol/Gps056FrameDecoderTest.java @@ -4,6 +4,8 @@ import org.junit.Assert; import org.junit.Test; import org.traccar.ProtocolTest; +import static org.junit.Assert.assertEquals; + public class Gps056FrameDecoderTest extends ProtocolTest { @Test @@ -11,11 +13,11 @@ public class Gps056FrameDecoderTest extends ProtocolTest { Gps056FrameDecoder decoder = new Gps056FrameDecoder(); - Assert.assertEquals( + assertEquals( binary("242435314750534c5f30323836323436323033333738323934361905110f160b0b7710584e1cbd1b9b4500005b100300fb0a071700ffff23"), decoder.decode(null, null, binary("242435314750534c5f30323836323436323033333738323934361905110f160b0b7710584e1cbd1b9b4500005b100300fb0a071700ffff230030"))); - Assert.assertEquals( + assertEquals( binary("242432354c4f474e5f3131383632343632303333373832393436322e3123"), decoder.decode(null, null, binary("242432354c4f474e5f3131383632343632303333373832393436322e3123"))); diff --git a/test/org/traccar/protocol/Gps103ProtocolEncoderTest.java b/test/org/traccar/protocol/Gps103ProtocolEncoderTest.java index 54c520c21..cfb1d5b90 100644 --- a/test/org/traccar/protocol/Gps103ProtocolEncoderTest.java +++ b/test/org/traccar/protocol/Gps103ProtocolEncoderTest.java @@ -5,6 +5,8 @@ import org.junit.Test; import org.traccar.ProtocolTest; import org.traccar.model.Command; +import static org.junit.Assert.assertEquals; + public class Gps103ProtocolEncoderTest extends ProtocolTest { @Test @@ -17,7 +19,7 @@ public class Gps103ProtocolEncoderTest extends ProtocolTest { command.setType(Command.TYPE_POSITION_PERIODIC); command.set(Command.KEY_FREQUENCY, 300); - Assert.assertEquals("**,imei:123456789012345,C,05m", encoder.encodeCommand(command)); + assertEquals("**,imei:123456789012345,C,05m", encoder.encodeCommand(command)); } @@ -31,7 +33,7 @@ public class Gps103ProtocolEncoderTest extends ProtocolTest { command.setType(Command.TYPE_CUSTOM); command.set(Command.KEY_DATA, "H,080"); - Assert.assertEquals("**,imei:123456789012345,H,080", encoder.encodeCommand(command)); + assertEquals("**,imei:123456789012345,H,080", encoder.encodeCommand(command)); } diff --git a/test/org/traccar/protocol/GranitFrameDecoderTest.java b/test/org/traccar/protocol/GranitFrameDecoderTest.java index cf84c2026..aa5a5b580 100644 --- a/test/org/traccar/protocol/GranitFrameDecoderTest.java +++ b/test/org/traccar/protocol/GranitFrameDecoderTest.java @@ -6,6 +6,8 @@ import org.junit.Assert; import org.junit.Test; import org.traccar.ProtocolTest; +import static org.junit.Assert.assertEquals; + public class GranitFrameDecoderTest extends ProtocolTest { @Test @@ -13,33 +15,33 @@ public class GranitFrameDecoderTest extends ProtocolTest { GranitFrameDecoder decoder = new GranitFrameDecoder(); - Assert.assertEquals( + assertEquals( binary("2b525243427e1a003e2934757c57b8b03c38d279b4e61e9bd7006b000000001c00002a4533"), decoder.decode(null, null, binary(ByteOrder.LITTLE_ENDIAN, "2b525243427e1a003e2934757c57b8b03c38d279b4e61e9bd7006b000000001c00002a45330d0a"))); - Assert.assertEquals( + assertEquals( binary("2b525243427e1a000d0a34757c57b8b03c38d279b4e61e9bd7006b000000001c00002a4533"), decoder.decode(null, null, binary(ByteOrder.LITTLE_ENDIAN, "2b525243427e1a000d0a34757c57b8b03c38d279b4e61e9bd7006b000000001c00002a45330d0a"))); - Assert.assertEquals( + assertEquals( binary("4f4b"), decoder.decode(null, null, binary(ByteOrder.LITTLE_ENDIAN, "4f4b0d0a2b525243427e1a000d0a34757c57b8b03c38d279b4e61e9bd7006b000000001c00002a45330d0a"))); - Assert.assertEquals( + assertEquals( binary("2b444441547e84003e290401d01690737c57b8903c383c7fa0e5081b64006b000000001c0000b8803c388e7fe7e5102197006c000000001c0000b8813c38ad7f02e6042035006c000000001d0000b8813c38bf7f13e6001d1e006c000000001d0000b8813c38bf7f13e6001d00006c000000001d0000b8903c38977f34e6091065006c000000001e000014002a3932"), decoder.decode(null, null, binary(ByteOrder.LITTLE_ENDIAN, "2b444441547e84003e290401d01690737c57b8903c383c7fa0e5081b64006b000000001c0000b8803c388e7fe7e5102197006c000000001c0000b8813c38ad7f02e6042035006c000000001d0000b8813c38bf7f13e6001d1e006c000000001d0000b8813c38bf7f13e6001d00006c000000001d0000b8903c38977f34e6091065006c000000001e000014002a39320d0a"))); - Assert.assertEquals( + assertEquals( binary("2b444441547e84003e290401d41680747c57f8a03c38987f50e6005300006c000000001c0000f8b03c38987f50e6005300006c000000001c0000fefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefe14002a4346"), decoder.decode(null, null, binary(ByteOrder.LITTLE_ENDIAN, "2b444441547e84003e290401d41680747c57f8a03c38987f50e6005300006c000000001c0000f8b03c38987f50e6005300006c000000001c0000fefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefe14002a43460d0a"))); - Assert.assertEquals( + assertEquals( binary("2b49444e543a204e6176696761746f722e30347820204669726d776172652076657273696f6e202030373132474c4e202a3231"), decoder.decode(null, null, binary(ByteOrder.LITTLE_ENDIAN, "2b49444e543a204e6176696761746f722e30347820204669726d776172652076657273696f6e202030373132474c4e202a32310d0a"))); - Assert.assertEquals( + assertEquals( binary("4552524f522057524f4e4720434845434b53554d5f31"), decoder.decode(null, null, binary(ByteOrder.LITTLE_ENDIAN, "4552524f522057524f4e4720434845434b53554d5f310d0a"))); diff --git a/test/org/traccar/protocol/H02FrameDecoderTest.java b/test/org/traccar/protocol/H02FrameDecoderTest.java index 3ced35d53..214f1c9fa 100644 --- a/test/org/traccar/protocol/H02FrameDecoderTest.java +++ b/test/org/traccar/protocol/H02FrameDecoderTest.java @@ -4,6 +4,8 @@ import org.junit.Assert; import org.junit.Test; import org.traccar.ProtocolTest; +import static org.junit.Assert.assertEquals; + public class H02FrameDecoderTest extends ProtocolTest { @Test @@ -11,23 +13,23 @@ public class H02FrameDecoderTest extends ProtocolTest { H02FrameDecoder decoder = new H02FrameDecoder(0); - Assert.assertEquals( + assertEquals( binary("2a48512c3335353438383032303131333931312c56312c3031323934352c412c353233312e37393238332c4e2c30313332342e31303731382c452c302e30352c302c3137303231372c464646464646464623"), decoder.decode(null, null, binary("2a48512c3335353438383032303131333931312c56312c3031323934352c412c353233312e37393238332c4e2c30313332342e31303731382c452c302e30352c302c3137303231372c4646464646464646230d0a"))); - Assert.assertEquals( + assertEquals( binary("2441060116601245431311165035313006004318210e000000fffffbffff0024"), decoder.decode(null, null, binary("2441060116601245431311165035313006004318210e000000fffffbffff0024"))); - Assert.assertEquals( + assertEquals( binary("2441060116601245431311165035313006004318210e000000fffffbffff0024"), decoder.decode(null, null, binary("2441060116601245431311165035313006004318210e000000fffffbffff00242a48512c343130363031313636302c56312c3132343535322c412c353033352e333132392c4e2c30303433312e383231312c452c3030302e32302c3030302c3133313131362c464646464642464623"))); - Assert.assertEquals( + assertEquals( binary("2a48512c3335333538383036303031353536382c56312c3139333530352c412c3830392e303031302c532c333435342e383939372c572c302e30302c302e30302c3239313031332c65666666666266662c3030303264342c3030303030622c3030353338352c3030353261612c323523"), decoder.decode(null, null, binary("2a48512c3335333538383036303031353536382c56312c3139333530352c412c3830392e303031302c532c333435342e383939372c572c302e30302c302e30302c3239313031332c65666666666266662c3030303264342c3030303030622c3030353338352c3030353261612c323523"))); - Assert.assertEquals( + assertEquals( binary("24430025645511183817091319355128000465632432000100ffe7fbffff0000"), decoder.decode(null, null, binary("24430025645511183817091319355128000465632432000100ffe7fbffff0000"))); @@ -38,7 +40,7 @@ public class H02FrameDecoderTest extends ProtocolTest { H02FrameDecoder decoder = new H02FrameDecoder(0); - Assert.assertEquals( + assertEquals( binary("24410600082621532131081504419390060740418306000000fffffbfdff0015060000002c02dc0c000000001f"), decoder.decode(null, null, binary("24410600082621532131081504419390060740418306000000fffffbfdff0015060000002c02dc0c000000001f"))); @@ -49,19 +51,19 @@ public class H02FrameDecoderTest extends ProtocolTest { H02FrameDecoder decoder = new H02FrameDecoder(0); - Assert.assertEquals( + assertEquals( binary("2a48512c343230363131393133302c4e42522c3130323430332c3233382c312c302c372c313131312c323236342c36332c313131312c323236352c35382c313131312c323236362c35302c313131312c333133352c33372c313131312c3630352c33332c313131312c343932302c33302c313131312c3630372c32382c3131303131372c46464646444646462c3623"), decoder.decode(null, null, binary("2a48512c343230363131393133302c4e42522c3130323430332c3233382c312c302c372c313131312c323236342c36332c313131312c323236352c35382c313131312c323236362c35302c313131312c333133352c33372c313131312c3630352c33332c313131312c343932302c33302c313131312c3630372c32382c3131303131372c46464646444646462c3623"))); - Assert.assertEquals( + assertEquals( binary("2442061191301024031101175540227006012321670c000095fffffbffff001f00000001f800ee010000000032"), decoder.decode(null, null, binary("2442061191301024031101175540227006012321670c000095fffffbffff001f00000001f800ee010000000032"))); - Assert.assertEquals( + assertEquals( binary("5800009814991024031101175540227006012321670c000095fffffbffff0033"), decoder.decode(null, null, binary("5800009814991024031101175540227006012321670c000095fffffbffff0033"))); - Assert.assertEquals( + assertEquals( binary("2a48512c343230363131393133302c4e42522c3130323431362c3233382c312c302c372c313131312c323236342c35332c313131312c323236352c36302c313131312c323236362c34342c313131312c333133352c34332c313131312c3630352c33392c313131312c343932302c32392c313131312c3630372c32342c3131303131372c46464646464246462c3623"), decoder.decode(null, null, binary("2a48512c343230363131393133302c4e42522c3130323431362c3233382c312c302c372c313131312c323236342c35332c313131312c323236352c36302c313131312c323236362c34342c313131312c333133352c34332c313131312c3630352c33392c313131312c343932302c32392c313131312c3630372c32342c3131303131372c46464646464246462c3623"))); diff --git a/test/org/traccar/protocol/H02ProtocolEncoderTest.java b/test/org/traccar/protocol/H02ProtocolEncoderTest.java index f0369eeeb..bf3978385 100644 --- a/test/org/traccar/protocol/H02ProtocolEncoderTest.java +++ b/test/org/traccar/protocol/H02ProtocolEncoderTest.java @@ -6,6 +6,8 @@ import org.junit.Test; import org.traccar.ProtocolTest; import org.traccar.model.Command; +import static org.junit.Assert.assertEquals; + public class H02ProtocolEncoderTest extends ProtocolTest { private H02ProtocolEncoder encoder = new H02ProtocolEncoder(); @@ -18,7 +20,7 @@ public class H02ProtocolEncoderTest extends ProtocolTest { command.setDeviceId(1); command.setType(Command.TYPE_ALARM_ARM); - Assert.assertEquals("*HQ,123456789012345,SCF,010203,0,0#", encoder.encodeCommand(command, time)); + assertEquals("*HQ,123456789012345,SCF,010203,0,0#", encoder.encodeCommand(command, time)); } @Test @@ -28,7 +30,7 @@ public class H02ProtocolEncoderTest extends ProtocolTest { command.setDeviceId(1); command.setType(Command.TYPE_ALARM_DISARM); - Assert.assertEquals("*HQ,123456789012345,SCF,010203,1,1#", encoder.encodeCommand(command, time)); + assertEquals("*HQ,123456789012345,SCF,010203,1,1#", encoder.encodeCommand(command, time)); } @Test @@ -38,7 +40,7 @@ public class H02ProtocolEncoderTest extends ProtocolTest { command.setDeviceId(1); command.setType(Command.TYPE_ENGINE_STOP); - Assert.assertEquals("*HQ,123456789012345,S20,010203,1,3,10,3,5,5,3,5,3,5,3,5#", encoder.encodeCommand(command, time)); + assertEquals("*HQ,123456789012345,S20,010203,1,3,10,3,5,5,3,5,3,5,3,5#", encoder.encodeCommand(command, time)); } @Test @@ -48,7 +50,7 @@ public class H02ProtocolEncoderTest extends ProtocolTest { command.setDeviceId(1); command.setType(Command.TYPE_ENGINE_RESUME); - Assert.assertEquals("*HQ,123456789012345,S20,010203,0,0#", encoder.encodeCommand(command, time)); + assertEquals("*HQ,123456789012345,S20,010203,0,0#", encoder.encodeCommand(command, time)); } @Test @@ -59,7 +61,7 @@ public class H02ProtocolEncoderTest extends ProtocolTest { command.set(Command.KEY_FREQUENCY, 10); command.setType(Command.TYPE_POSITION_PERIODIC); - Assert.assertEquals("*HQ,123456789012345,S71,010203,22,10#", encoder.encodeCommand(command, time)); + assertEquals("*HQ,123456789012345,S71,010203,22,10#", encoder.encodeCommand(command, time)); } } diff --git a/test/org/traccar/protocol/HuaShengFrameDecoderTest.java b/test/org/traccar/protocol/HuaShengFrameDecoderTest.java index c3f5c585f..dc2536319 100644 --- a/test/org/traccar/protocol/HuaShengFrameDecoderTest.java +++ b/test/org/traccar/protocol/HuaShengFrameDecoderTest.java @@ -4,6 +4,8 @@ import org.junit.Assert; import org.junit.Test; import org.traccar.ProtocolTest; +import static org.junit.Assert.assertEquals; + public class HuaShengFrameDecoderTest extends ProtocolTest { @Test @@ -11,19 +13,19 @@ public class HuaShengFrameDecoderTest extends ProtocolTest { HuaShengFrameDecoder decoder = new HuaShengFrameDecoder(); - Assert.assertEquals( + assertEquals( binary("c0010c00120060000000000004000600010100c0"), decoder.decode(null, null, binary("c0010c00120060000000000004000600010100c0"))); - Assert.assertEquals( + assertEquals( binary("c0010c003e0002000000000010020012a0014f42445f3347315f56312e302e330013a0043335353835353035303434303635380006a08701000006a0a1035fc0"), decoder.decode(null, null, binary("c0010c003e0002000000000010020012a0014f42445f3347315f56312e302e330013a0043335353835353035303434303635380006a08701000006a0a1035fc0"))); - Assert.assertEquals( + assertEquals( binary("c00000003faa0000000000003ea5a5005a3f00c000000031363037303530373132353700e6d186ffcc7a25002201160010000000010015000000000000000000c0"), decoder.decode(null, null, binary("c00000003faa0000000000003ea5a5005a3f00dbdc00000031363037303530373132353700e6d186ffcc7a25002201160010000000010015000000000000000000c0"))); - Assert.assertEquals( + assertEquals( binary("C000000041AA00000000000030C000000031353035323630373538323800ADDCC100226AEF0000000000120005000100151206EF0504E99975002903EB80556492CEC0"), decoder.decode(null, null, binary("C000000041AA00000000000030DBDC00000031353035323630373538323800ADDCC100226AEF0000000000120005000100151206EF0504E99975002903EB80556492CEC0"))); diff --git a/test/org/traccar/protocol/HuabaoFrameDecoderTest.java b/test/org/traccar/protocol/HuabaoFrameDecoderTest.java index ad828bdb4..98caf1dca 100644 --- a/test/org/traccar/protocol/HuabaoFrameDecoderTest.java +++ b/test/org/traccar/protocol/HuabaoFrameDecoderTest.java @@ -4,6 +4,8 @@ import org.junit.Assert; import org.junit.Test; import org.traccar.ProtocolTest; +import static org.junit.Assert.assertEquals; + public class HuabaoFrameDecoderTest extends ProtocolTest { @Test @@ -11,7 +13,7 @@ public class HuabaoFrameDecoderTest extends ProtocolTest { HuabaoFrameDecoder decoder = new HuabaoFrameDecoder(); - Assert.assertEquals( + assertEquals( binary("7e307e087d557e"), decoder.decode(null, null, binary("7e307d02087d01557e"))); diff --git a/test/org/traccar/protocol/L100FrameDecoderTest.java b/test/org/traccar/protocol/L100FrameDecoderTest.java index f474fa678..ab70678d5 100644 --- a/test/org/traccar/protocol/L100FrameDecoderTest.java +++ b/test/org/traccar/protocol/L100FrameDecoderTest.java @@ -4,6 +4,8 @@ import org.junit.Assert; import org.junit.Test; import org.traccar.ProtocolTest; +import static org.junit.Assert.assertEquals; + public class L100FrameDecoderTest extends ProtocolTest { @Test @@ -11,11 +13,11 @@ public class L100FrameDecoderTest extends ProtocolTest { L100FrameDecoder decoder = new L100FrameDecoder(); - Assert.assertEquals( + assertEquals( binary("200141544c3335363839353033373533333734352c244750524d432c3131313731392e3030302c412c323833382e303034352c4e2c30373731332e333730372c452c302e30302c2c3132303831302c2c2c412a3735242c2330313130303131313030313031302c4e2e432c4e2e432c4e2e432c31323334352e36372c33312e342c342e322c32312c4d43432c4d4e432c4c41432c43656c6c494441544c027a"), decoder.decode(null, null, binary("200141544c3335363839353033373533333734352c244750524d432c3131313731392e3030302c412c323833382e303034352c4e2c30373731332e333730372c452c302e30302c2c3132303831302c2c2c412a3735242c2330313130303131313030313031302c4e2e432c4e2e432c4e2e432c31323334352e36372c33312e342c342e322c32312c4d43432c4d4e432c4c41432c43656c6c494441544c027a"))); - Assert.assertEquals( + assertEquals( binary("200341544c3335363839353033373533333734352c244750524d432c3131313731392e3030302c412c323833382e303034352c4e2c30373731332e333730372c452c302e30302c2c3132303831302c2c2c412a3735244c4f432c436f6e6e61756768742043697263757320c2a0436f6e6e617567687420506c61636520c2a04e65772044656c686920c2a044656c6869c2a0496e6469612c2330313130303130313130313031302c322e332c33352e36372c38302c31323334352e36372c33312e342c342e322c32312c4d43432c4d4e432c4c41432c43656c6c494441544c047a"), decoder.decode(null, null, binary("200341544c3335363839353033373533333734352c244750524d432c3131313731392e3030302c412c323833382e303034352c4e2c30373731332e333730372c452c302e30302c2c3132303831302c2c2c412a3735244c4f432c436f6e6e61756768742043697263757320c2a0436f6e6e617567687420506c61636520c2a04e65772044656c686920c2a044656c6869c2a0496e6469612c2330313130303130313130313031302c322e332c33352e36372c38302c31323334352e36372c33312e342c342e322c32312c4d43432c4d4e432c4c41432c43656c6c494441544c047a"))); diff --git a/test/org/traccar/protocol/MeiligaoFrameDecoderTest.java b/test/org/traccar/protocol/MeiligaoFrameDecoderTest.java index 9b02b646c..214936514 100644 --- a/test/org/traccar/protocol/MeiligaoFrameDecoderTest.java +++ b/test/org/traccar/protocol/MeiligaoFrameDecoderTest.java @@ -4,6 +4,9 @@ import org.junit.Assert; import org.junit.Test; import org.traccar.ProtocolTest; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + public class MeiligaoFrameDecoderTest extends ProtocolTest { @Test @@ -11,14 +14,14 @@ public class MeiligaoFrameDecoderTest extends ProtocolTest { MeiligaoFrameDecoder decoder = new MeiligaoFrameDecoder(); - Assert.assertNull( + assertNull( decoder.decode(null, null, binary("00"))); - Assert.assertEquals( + assertEquals( binary("2424007b8621700151517899553233323835372e3030302c562c333632372e313835342c4e2c30313034352e323130392c452c302e30302c372c3239303131332c2c2a31347c302e307c347c303030307c303030382c303030357c303235443030303230303541374432327c30367c303030314530353527f40d0a"), decoder.decode(null, null, binary("2424007B8621700151517899553233323835372E3030302C562C333632372E313835342C4E2C30313034352E323130392C452C302E30302C372C3239303131332C2C2A31347C302E307C347C303030307C303030382C303030357C303235443030303230303541374432327C30367C303030314530353527F40D0A"))); - Assert.assertEquals( + assertEquals( binary("2424007b8621700151517899553233323835372e3030302c562c333632372e313835342c4e2c30313034352e323130392c452c302e30302c372c3239303131332c2c2a31347c302e307c347c303030307c303030382c303030357c303235443030303230303541374432327c30367c303030314530353527f40d0a"), decoder.decode(null, null, binary("002424007B8621700151517899553233323835372E3030302C562C333632372E313835342C4E2C30313034352E323130392C452C302E30302C372C3239303131332C2C2A31347C302E307C347C303030307C303030382C303030357C303235443030303230303541374432327C30367C303030314530353527F40D0A"))); diff --git a/test/org/traccar/protocol/MeitrackFrameDecoderTest.java b/test/org/traccar/protocol/MeitrackFrameDecoderTest.java index d86e532c3..f0afee02e 100644 --- a/test/org/traccar/protocol/MeitrackFrameDecoderTest.java +++ b/test/org/traccar/protocol/MeitrackFrameDecoderTest.java @@ -4,6 +4,8 @@ import org.junit.Assert; import org.junit.Test; import org.traccar.ProtocolTest; +import static org.junit.Assert.assertEquals; + public class MeitrackFrameDecoderTest extends ProtocolTest { @Test @@ -11,7 +13,7 @@ public class MeitrackFrameDecoderTest extends ProtocolTest { MeitrackFrameDecoder decoder = new MeitrackFrameDecoder(); - Assert.assertEquals( + assertEquals( binary("24244e3132372c3836333037313031333830333036362c4141412c33352c2d312e3330323638302c33362e3835323133352c3135303430393231313032362c412c392c302c302e312c302c352c313635332c343039362c33323634382c3633397c30327c313030347c3930432c303030302c307c307c307c3346467c3330302c2a37430d0a"), decoder.decode(null, null, binary("24244e3132372c3836333037313031333830333036362c4141412c33352c2d312e3330323638302c33362e3835323133352c3135303430393231313032362c412c392c302c302e312c302c352c313635332c343039362c33323634382c3633397c30327c313030347c3930432c303030302c307c307c307c3346467c3330302c2a37430d0a"))); diff --git a/test/org/traccar/protocol/MeitrackProtocolEncoderTest.java b/test/org/traccar/protocol/MeitrackProtocolEncoderTest.java index 771712420..a2b0ae6fd 100644 --- a/test/org/traccar/protocol/MeitrackProtocolEncoderTest.java +++ b/test/org/traccar/protocol/MeitrackProtocolEncoderTest.java @@ -5,6 +5,8 @@ import org.junit.Test; import org.traccar.ProtocolTest; import org.traccar.model.Command; +import static org.junit.Assert.assertEquals; + public class MeitrackProtocolEncoderTest extends ProtocolTest { @Test @@ -16,14 +18,14 @@ public class MeitrackProtocolEncoderTest extends ProtocolTest { command.setDeviceId(1); command.setType(Command.TYPE_POSITION_SINGLE); - Assert.assertEquals("@@Q25,123456789012345,A10*68\r\n", encoder.encodeCommand(command)); + assertEquals("@@Q25,123456789012345,A10*68\r\n", encoder.encodeCommand(command)); command.setDeviceId(1); command.setType(Command.TYPE_SEND_SMS); command.set(Command.KEY_PHONE, "15360853789"); command.set(Command.KEY_MESSAGE, "Meitrack"); - Assert.assertEquals("@@f48,123456789012345,C02,0,15360853789,Meitrack*B0\r\n", encoder.encodeCommand(command)); + assertEquals("@@f48,123456789012345,C02,0,15360853789,Meitrack*B0\r\n", encoder.encodeCommand(command)); } diff --git a/test/org/traccar/protocol/MiniFinderProtocolEncoderTest.java b/test/org/traccar/protocol/MiniFinderProtocolEncoderTest.java index 360ea0008..d446c228c 100644 --- a/test/org/traccar/protocol/MiniFinderProtocolEncoderTest.java +++ b/test/org/traccar/protocol/MiniFinderProtocolEncoderTest.java @@ -5,6 +5,8 @@ import org.junit.Test; import org.traccar.ProtocolTest; import org.traccar.model.Command; +import static org.junit.Assert.assertEquals; + public class MiniFinderProtocolEncoderTest extends ProtocolTest { @Test @@ -17,7 +19,7 @@ public class MiniFinderProtocolEncoderTest extends ProtocolTest { command.setType(Command.TYPE_SET_TIMEZONE); command.set(Command.KEY_TIMEZONE, "GMT+1"); - Assert.assertEquals("123456L+01", encoder.encodeCommand(command)); + assertEquals("123456L+01", encoder.encodeCommand(command)); command = new Command(); command.setDeviceId(1); @@ -25,7 +27,7 @@ public class MiniFinderProtocolEncoderTest extends ProtocolTest { command.set(Command.KEY_INDEX, 2); command.set(Command.KEY_PHONE, "1111111111"); - Assert.assertEquals("123456C1,1111111111", encoder.encodeCommand(command)); + assertEquals("123456C1,1111111111", encoder.encodeCommand(command)); } diff --git a/test/org/traccar/protocol/NvsFrameDecoderTest.java b/test/org/traccar/protocol/NvsFrameDecoderTest.java index 54dc0fbdd..b03e3826c 100644 --- a/test/org/traccar/protocol/NvsFrameDecoderTest.java +++ b/test/org/traccar/protocol/NvsFrameDecoderTest.java @@ -4,6 +4,8 @@ import org.junit.Assert; import org.junit.Test; import org.traccar.ProtocolTest; +import static org.junit.Assert.assertEquals; + public class NvsFrameDecoderTest extends ProtocolTest { @Test @@ -11,11 +13,11 @@ public class NvsFrameDecoderTest extends ProtocolTest { NvsFrameDecoder decoder = new NvsFrameDecoder(); - Assert.assertEquals( + assertEquals( binary("0012333537303430303630303137383234312e38"), decoder.decode(null, null, binary("0012333537303430303630303137383234312e38"))); - Assert.assertEquals( + assertEquals( binary("cccccccc0073000144b9ddf2aca002015694823d1f165d80902139a44f00aa001e1400000103000a080115001a001d001e0141004001f00065001301061600001700001800004231da430000440000085000000000480000000049000000004a0000000047ffffffff6900000004c700000000e10000000100954a"), decoder.decode(null, null, binary("cccccccc0073000144b9ddf2aca002015694823d1f165d80902139a44f00aa001e1400000103000a080115001a001d001e0141004001f00065001301061600001700001800004231da430000440000085000000000480000000049000000004a0000000047ffffffff6900000004c700000000e10000000100954a"))); diff --git a/test/org/traccar/protocol/Pt502ProtocolEncoderTest.java b/test/org/traccar/protocol/Pt502ProtocolEncoderTest.java index 39ca2fe65..5438eb366 100644 --- a/test/org/traccar/protocol/Pt502ProtocolEncoderTest.java +++ b/test/org/traccar/protocol/Pt502ProtocolEncoderTest.java @@ -5,6 +5,8 @@ import org.junit.Test; import org.traccar.ProtocolTest; import org.traccar.model.Command; +import static org.junit.Assert.assertEquals; + public class Pt502ProtocolEncoderTest extends ProtocolTest { @Test @@ -17,7 +19,7 @@ public class Pt502ProtocolEncoderTest extends ProtocolTest { command.setType(Command.TYPE_CUSTOM); command.set(Command.KEY_DATA, "#PTI300"); - Assert.assertEquals("#PTI300\r\n", encoder.encodeCommand(command)); + assertEquals("#PTI300\r\n", encoder.encodeCommand(command)); } @@ -32,7 +34,7 @@ public class Pt502ProtocolEncoderTest extends ProtocolTest { command.set(Command.KEY_INDEX, 2); command.set(Command.KEY_DATA, 1); - Assert.assertEquals("#OPC2,1\r\n", encoder.encodeCommand(command)); + assertEquals("#OPC2,1\r\n", encoder.encodeCommand(command)); } @@ -46,7 +48,7 @@ public class Pt502ProtocolEncoderTest extends ProtocolTest { command.setType(Command.TYPE_SET_TIMEZONE); command.set(Command.KEY_TIMEZONE, "GMT+8"); - Assert.assertEquals("#TMZ8\r\n", encoder.encodeCommand(command)); + assertEquals("#TMZ8\r\n", encoder.encodeCommand(command)); } @@ -61,7 +63,7 @@ public class Pt502ProtocolEncoderTest extends ProtocolTest { command.setType(Command.TYPE_ALARM_SPEED); command.set(Command.KEY_DATA, 120); - Assert.assertEquals("#SPD120\r\n", encoder.encodeCommand(command)); + assertEquals("#SPD120\r\n", encoder.encodeCommand(command)); } diff --git a/test/org/traccar/protocol/Tk103ProtocolEncoderTest.java b/test/org/traccar/protocol/Tk103ProtocolEncoderTest.java index 7e04dcb81..6b38035ed 100644 --- a/test/org/traccar/protocol/Tk103ProtocolEncoderTest.java +++ b/test/org/traccar/protocol/Tk103ProtocolEncoderTest.java @@ -7,6 +7,8 @@ import org.traccar.TestIdentityManager; import org.traccar.model.Command; import org.traccar.model.Device; +import static org.junit.Assert.assertEquals; + public class Tk103ProtocolEncoderTest extends ProtocolTest { @Test @@ -18,7 +20,7 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest { command.setDeviceId(1); command.setType(Command.TYPE_ENGINE_STOP); - Assert.assertEquals("(123456789012345AV010)", encoder.encodeCommand(command)); + assertEquals("(123456789012345AV010)", encoder.encodeCommand(command)); } @@ -31,7 +33,7 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest { command.setDeviceId(1); command.setType(Command.TYPE_POSITION_SINGLE); - Assert.assertEquals("(123456789012345AP00)", encoder.encodeCommand(command)); + assertEquals("(123456789012345AP00)", encoder.encodeCommand(command)); } @@ -45,7 +47,7 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest { command.setType(Command.TYPE_POSITION_PERIODIC); command.set(Command.KEY_FREQUENCY, 60); - Assert.assertEquals("(123456789012345AR00003C0000)", encoder.encodeCommand(command)); + assertEquals("(123456789012345AR00003C0000)", encoder.encodeCommand(command)); } @@ -58,7 +60,7 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest { command.setDeviceId(1); command.setType(Command.TYPE_POSITION_STOP); - Assert.assertEquals("(123456789012345AR0000000000)", encoder.encodeCommand(command)); + assertEquals("(123456789012345AR0000000000)", encoder.encodeCommand(command)); } @@ -71,7 +73,7 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest { command.setDeviceId(1); command.setType(Command.TYPE_GET_VERSION); - Assert.assertEquals("(123456789012345AP07)", encoder.encodeCommand(command)); + assertEquals("(123456789012345AP07)", encoder.encodeCommand(command)); } @@ -84,7 +86,7 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest { command.setDeviceId(1); command.setType(Command.TYPE_REBOOT_DEVICE); - Assert.assertEquals("(123456789012345AT00)", encoder.encodeCommand(command)); + assertEquals("(123456789012345AT00)", encoder.encodeCommand(command)); } @@ -97,7 +99,7 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest { command.setDeviceId(1); command.setType(Command.TYPE_SET_ODOMETER); - Assert.assertEquals("(123456789012345AX01)", encoder.encodeCommand(command)); + assertEquals("(123456789012345AX01)", encoder.encodeCommand(command)); } @@ -110,7 +112,7 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest { command.setDeviceId(1); command.setType(Command.TYPE_POSITION_SINGLE); - Assert.assertEquals("[begin]sms2,*getposl*,[end]", encoder.encodeCommand(command)); + assertEquals("[begin]sms2,*getposl*,[end]", encoder.encodeCommand(command)); } @@ -123,7 +125,7 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest { command.setDeviceId(1); command.setType(Command.TYPE_POSITION_PERIODIC); - Assert.assertEquals("[begin]sms2,*routetrack*99*,[end]", encoder.encodeCommand(command)); + assertEquals("[begin]sms2,*routetrack*99*,[end]", encoder.encodeCommand(command)); } @@ -136,7 +138,7 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest { command.setDeviceId(1); command.setType(Command.TYPE_POSITION_STOP); - Assert.assertEquals("[begin]sms2,*routetrackoff*,[end]", encoder.encodeCommand(command)); + assertEquals("[begin]sms2,*routetrackoff*,[end]", encoder.encodeCommand(command)); } @@ -149,7 +151,7 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest { command.setDeviceId(1); command.setType(Command.TYPE_GET_VERSION); - Assert.assertEquals("[begin]sms2,*about*,[end]", encoder.encodeCommand(command)); + assertEquals("[begin]sms2,*about*,[end]", encoder.encodeCommand(command)); } @@ -162,7 +164,7 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest { command.setDeviceId(1); command.setType(Command.TYPE_REBOOT_DEVICE); - Assert.assertEquals("[begin]sms2,88888888,[end]", encoder.encodeCommand(command)); + assertEquals("[begin]sms2,88888888,[end]", encoder.encodeCommand(command)); } @@ -175,7 +177,7 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest { command.setDeviceId(1); command.setType(Command.TYPE_IDENTIFICATION); - Assert.assertEquals("[begin]sms2,999999,[end]", encoder.encodeCommand(command)); + assertEquals("[begin]sms2,999999,[end]", encoder.encodeCommand(command)); } @@ -189,7 +191,7 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest { command.setType(Command.TYPE_ALARM_SOS); command.set(Command.KEY_ENABLE, true); - Assert.assertEquals("[begin]sms2,*soson*,[end]", encoder.encodeCommand(command)); + assertEquals("[begin]sms2,*soson*,[end]", encoder.encodeCommand(command)); } @@ -203,7 +205,7 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest { command.setType(Command.TYPE_ALARM_SOS); command.set(Command.KEY_ENABLE, false); - Assert.assertEquals("[begin]sms2,*sosoff*,[end]", encoder.encodeCommand(command)); + assertEquals("[begin]sms2,*sosoff*,[end]", encoder.encodeCommand(command)); } @@ -217,7 +219,7 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest { command.setType(Command.TYPE_CUSTOM); command.set(Command.KEY_DATA, "any text is ok"); - Assert.assertEquals("[begin]sms2,any text is ok,[end]", encoder.encodeCommand(command)); + assertEquals("[begin]sms2,any text is ok,[end]", encoder.encodeCommand(command)); } @@ -232,7 +234,7 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest { command.set(Command.KEY_SERVER, "1.2.3.4"); command.set(Command.KEY_PORT, "5555"); - Assert.assertEquals("[begin]sms2,*setip*1*2*3*4*5555*,[end]", encoder.encodeCommand(command)); + assertEquals("[begin]sms2,*setip*1*2*3*4*5555*,[end]", encoder.encodeCommand(command)); } @@ -248,7 +250,7 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest { command.set(Command.KEY_PHONE, "+55555555555"); command.set(Command.KEY_DEVICE_PASSWORD, "232323"); - Assert.assertEquals("[begin]sms2,*master*232323*+55555555555*,[end]", encoder.encodeCommand(command)); + assertEquals("[begin]sms2,*master*232323*+55555555555*,[end]", encoder.encodeCommand(command)); } diff --git a/test/org/traccar/protocol/TotemProtocolEncoderTest.java b/test/org/traccar/protocol/TotemProtocolEncoderTest.java index 4415f6c0a..d17f70405 100644 --- a/test/org/traccar/protocol/TotemProtocolEncoderTest.java +++ b/test/org/traccar/protocol/TotemProtocolEncoderTest.java @@ -5,6 +5,8 @@ import org.junit.Test; import org.traccar.ProtocolTest; import org.traccar.model.Command; +import static org.junit.Assert.assertEquals; + public class TotemProtocolEncoderTest extends ProtocolTest { @Test @@ -17,7 +19,7 @@ public class TotemProtocolEncoderTest extends ProtocolTest { command.setType(Command.TYPE_ENGINE_STOP); command.set(Command.KEY_DEVICE_PASSWORD, "000000"); - Assert.assertEquals("*000000,025,C,1#", encoder.encodeCommand(command)); + assertEquals("*000000,025,C,1#", encoder.encodeCommand(command)); } diff --git a/test/org/traccar/protocol/UlbotechFrameDecoderTest.java b/test/org/traccar/protocol/UlbotechFrameDecoderTest.java index 03a4fb336..b0af435b8 100644 --- a/test/org/traccar/protocol/UlbotechFrameDecoderTest.java +++ b/test/org/traccar/protocol/UlbotechFrameDecoderTest.java @@ -4,6 +4,8 @@ import org.junit.Assert; import org.junit.Test; import org.traccar.ProtocolTest; +import static org.junit.Assert.assertEquals; + public class UlbotechFrameDecoderTest extends ProtocolTest { @Test @@ -11,15 +13,15 @@ public class UlbotechFrameDecoderTest extends ProtocolTest { UlbotechFrameDecoder decoder = new UlbotechFrameDecoder(); - Assert.assertEquals( + assertEquals( binary("f8010103515810532780699f7e2e3f010e015ee4c906bde45c00000000008b0304004000000404002c776005060373193622110b00240b00fee8ffff807dffff606d0b00fee9af000000af0000000b00feee7d78807dffffffff100101cc2af8"), decoder.decode(null, null, binary("f8010103515810532780699f7e2e3f010e015ee4c906bde45c00000000008b0304004000000404002c776005060373193622110b00240b00fee8ffff807dffff606d0b00fee9af000000af0000000b00feee7d78807dffffffff100101cc2af8"))); - Assert.assertEquals( + assertEquals( binary("2a545330312c33353430343330353133383934363023"), decoder.decode(null, null, binary("2a545330312c33353430343330353133383934363023"))); - Assert.assertEquals( + assertEquals( binary("f8010108679650230646339de69054010e015ee17506bde2c60000000000ac0304024000000404000009f705060390181422170711310583410c0000310d00312f834131018608040003130a100101136cf8"), decoder.decode(null, null, binary("f8010108679650230646339de69054010e015ee17506bde2c60000000000ac0304024000000404000009f70005060390181422170711310583410c0000310d00312f834131018608040003130a100101136cf8"))); diff --git a/test/org/traccar/protocol/VtfmsFrameDecoderTest.java b/test/org/traccar/protocol/VtfmsFrameDecoderTest.java index e5897549b..c9ee8ae20 100644 --- a/test/org/traccar/protocol/VtfmsFrameDecoderTest.java +++ b/test/org/traccar/protocol/VtfmsFrameDecoderTest.java @@ -4,6 +4,8 @@ import org.junit.Assert; import org.junit.Test; import org.traccar.ProtocolTest; +import static org.junit.Assert.assertEquals; + public class VtfmsFrameDecoderTest extends ProtocolTest { @Test @@ -11,7 +13,7 @@ public class VtfmsFrameDecoderTest extends ProtocolTest { VtfmsFrameDecoder decoder = new VtfmsFrameDecoder(); - Assert.assertEquals( + assertEquals( buffer("(863071010087648,0HK44,00,000,14,2,9,,A,114946,180313,11.0244,076.9768,282,000,00000,00000,K,0000128,1,12.8,,200,2.501,,4.001,0,0,0,0,0,0,0,,)105"), decoder.decode(null, null, buffer("(863071010087648,0HK44,00,000,14,2,9,,A,114946,180313,11.0244,076.9768,282,000,00000,00000,K,0000128,1,12.8,,200,2.501,,4.001,0,0,0,0,0,0,0,,)105"))); diff --git a/test/org/traccar/protocol/WatchProtocolEncoderTest.java b/test/org/traccar/protocol/WatchProtocolEncoderTest.java index cffe373cf..a87afbfc5 100644 --- a/test/org/traccar/protocol/WatchProtocolEncoderTest.java +++ b/test/org/traccar/protocol/WatchProtocolEncoderTest.java @@ -5,6 +5,8 @@ import org.junit.Test; import org.traccar.ProtocolTest; import org.traccar.model.Command; +import static org.junit.Assert.assertEquals; + public class WatchProtocolEncoderTest extends ProtocolTest { @Test @@ -17,41 +19,41 @@ public class WatchProtocolEncoderTest extends ProtocolTest { command = new Command(); command.setDeviceId(1); command.setType(Command.TYPE_REBOOT_DEVICE); - Assert.assertEquals("[CS*123456789012345*0005*RESET]", encoder.encodeCommand(command)); + assertEquals("[CS*123456789012345*0005*RESET]", encoder.encodeCommand(command)); command = new Command(); command.setDeviceId(1); command.setType(Command.TYPE_SOS_NUMBER); command.set(Command.KEY_INDEX, 1); command.set(Command.KEY_PHONE, "123456789"); - Assert.assertEquals("[CS*123456789012345*000e*SOS1,123456789]", encoder.encodeCommand(command)); + assertEquals("[CS*123456789012345*000e*SOS1,123456789]", encoder.encodeCommand(command)); command = new Command(); command.setDeviceId(1); command.setType(Command.TYPE_VOICE_MESSAGE); command.set(Command.KEY_DATA, "3333"); - Assert.assertEquals("[CS*123456789012345*0005*TK,33]", encoder.encodeCommand(command)); + assertEquals("[CS*123456789012345*0005*TK,33]", encoder.encodeCommand(command)); command = new Command(); command.setDeviceId(1); command.setType(Command.TYPE_CUSTOM); command.set(Command.KEY_DATA, "WORK,6-9,11-13,13-15,17-19"); - Assert.assertEquals("[CS*123456789012345*001a*WORK,6-9,11-13,13-15,17-19]", encoder.encodeCommand(command)); + assertEquals("[CS*123456789012345*001a*WORK,6-9,11-13,13-15,17-19]", encoder.encodeCommand(command)); command = new Command(); command.setDeviceId(1); command.setType(Command.TYPE_SET_TIMEZONE); command.set(Command.KEY_TIMEZONE, "Europe/Amsterdam"); - Assert.assertEquals("[CS*123456789012345*0006*LZ,,+1]", encoder.encodeCommand(command)); + assertEquals("[CS*123456789012345*0006*LZ,,+1]", encoder.encodeCommand(command)); command.set(Command.KEY_TIMEZONE, "GMT+01:30"); - Assert.assertEquals("[CS*123456789012345*0008*LZ,,+1.5]", encoder.encodeCommand(command)); + assertEquals("[CS*123456789012345*0008*LZ,,+1.5]", encoder.encodeCommand(command)); command.set(Command.KEY_TIMEZONE, "Atlantic/Azores"); - Assert.assertEquals("[CS*123456789012345*0006*LZ,,-1]", encoder.encodeCommand(command)); + assertEquals("[CS*123456789012345*0006*LZ,,-1]", encoder.encodeCommand(command)); command.set(Command.KEY_TIMEZONE, "GMT-11:30"); - Assert.assertEquals("[CS*123456789012345*0009*LZ,,-11.5]", encoder.encodeCommand(command)); + assertEquals("[CS*123456789012345*0009*LZ,,-11.5]", encoder.encodeCommand(command)); } diff --git a/test/org/traccar/protocol/WondexFrameDecoderTest.java b/test/org/traccar/protocol/WondexFrameDecoderTest.java index 2b401aa18..8eb80da9a 100644 --- a/test/org/traccar/protocol/WondexFrameDecoderTest.java +++ b/test/org/traccar/protocol/WondexFrameDecoderTest.java @@ -4,6 +4,9 @@ import org.junit.Assert; import org.junit.Test; import org.traccar.ProtocolTest; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + public class WondexFrameDecoderTest extends ProtocolTest { @Test @@ -11,14 +14,14 @@ public class WondexFrameDecoderTest extends ProtocolTest { WondexFrameDecoder decoder = new WondexFrameDecoder(); - Assert.assertNull( + assertNull( decoder.decode(null, null, binary("f0d70b0001ca9a3b"))); - Assert.assertEquals( + assertEquals( binary("313034343938393630312c32303133303332333039353531352c31332e3537323737362c35322e3430303833382c302c3030302c37322c302c32"), decoder.decode(null, null, binary("313034343938393630312c32303133303332333039353531352c31332e3537323737362c35322e3430303833382c302c3030302c37322c302c320d0a"))); - Assert.assertEquals(binary("d0d70b0001ca9a3b"), + assertEquals(binary("d0d70b0001ca9a3b"), decoder.decode(null, null, binary("d0d70b0001ca9a3b"))); } diff --git a/test/org/traccar/protocol/WondexProtocolEncoderTest.java b/test/org/traccar/protocol/WondexProtocolEncoderTest.java index fb038a18b..7c5fa572c 100644 --- a/test/org/traccar/protocol/WondexProtocolEncoderTest.java +++ b/test/org/traccar/protocol/WondexProtocolEncoderTest.java @@ -5,6 +5,8 @@ import org.junit.Test; import org.traccar.ProtocolTest;
import org.traccar.model.Command;
+import static org.junit.Assert.assertEquals;
+
public class WondexProtocolEncoderTest extends ProtocolTest {
@Test
public void testEncode() throws Exception {
@@ -16,7 +18,7 @@ public class WondexProtocolEncoderTest extends ProtocolTest { command.setType(Command.TYPE_POSITION_SINGLE);
command.set(Command.KEY_DEVICE_PASSWORD, "0000");
- Assert.assertEquals("$WP+GETLOCATION=0000", encoder.encodeCommand(command));
+ assertEquals("$WP+GETLOCATION=0000", encoder.encodeCommand(command));
}
diff --git a/test/org/traccar/protocol/XexunFrameDecoderTest.java b/test/org/traccar/protocol/XexunFrameDecoderTest.java index 5627623ba..cdf30965c 100644 --- a/test/org/traccar/protocol/XexunFrameDecoderTest.java +++ b/test/org/traccar/protocol/XexunFrameDecoderTest.java @@ -4,6 +4,8 @@ import org.junit.Assert; import org.junit.Test; import org.traccar.ProtocolTest; +import static org.junit.Assert.assertEquals; + public class XexunFrameDecoderTest extends ProtocolTest { @Test @@ -11,11 +13,11 @@ public class XexunFrameDecoderTest extends ProtocolTest { XexunFrameDecoder decoder = new XexunFrameDecoder(); - Assert.assertEquals( + assertEquals( binary("4750524d432c3230353933352e3030302c412c353134302e343335302c4e2c3530312e303638362c452c302e30302c302e30302c3132313031352c30302c303030302e302c412a37302c462c2c696d65693a3335393538373031343731383339322c"), decoder.decode(null, null, binary("313531303132313435392c2b33313635323435343932372c4750524d432c3230353933352e3030302c412c353134302e343335302c4e2c3530312e303638362c452c302e30302c302e30302c3132313031352c30302c303030302e302c412a37302c462c2c696d65693a3335393538373031343731383339322c31323249"))); - Assert.assertEquals( + assertEquals( binary("4750524d432c3130333733312e3633362c412c343534352e353236362c4e2c30303434382e383235392c452c32312e31322c3237362e30312c3135303631352c2c2c412a35372c4c2c2c20696d65693a3031333934393030323032363637352c"), decoder.decode(null, null, binary("3135303631353132333733312c2b33333634373338343631312c4750524d432c3130333733312e3633362c412c343534352e353236362c4e2c30303434382e383235392c452c32312e31322c3237362e30312c3135303631352c2c2c412a35372c4c2c2c20696d65693a3031333934393030323032363637352c30342c333532322e392c463a332e3732562c302c3134322c32313734342c3230382c30312c303730322c394338430a0d"))); |