diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-04-23 15:49:56 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-04-23 15:49:56 +1200 |
commit | 2a3fad9496decd83f06ae5abf067f8d4337ec741 (patch) | |
tree | 69837f0bf89cf6ff78915d70380118575cc5c47a /test/org/traccar | |
parent | a8d2a0170b7ac891ffe784320ac2d1389f11bf68 (diff) | |
download | trackermap-server-2a3fad9496decd83f06ae5abf067f8d4337ec741.tar.gz trackermap-server-2a3fad9496decd83f06ae5abf067f8d4337ec741.tar.bz2 trackermap-server-2a3fad9496decd83f06ae5abf067f8d4337ec741.zip |
Major code refacroting
Diffstat (limited to 'test/org/traccar')
84 files changed, 179 insertions, 164 deletions
diff --git a/test/org/traccar/DetectorHandlerTest.java b/test/org/traccar/DetectorHandlerTest.java index f506856af..109747748 100644 --- a/test/org/traccar/DetectorHandlerTest.java +++ b/test/org/traccar/DetectorHandlerTest.java @@ -30,7 +30,7 @@ public class DetectorHandlerTest { pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "\r\n", "\n", ";")); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new Gps103ProtocolDecoder(new TestDataManager(), null, null)); + pipeline.addLast("objectDecoder", new Gps103ProtocolDecoder(null)); DetectorHandler.checkPipeline("gps103", pipeline, ChannelBuffers.copiedBuffer( "imei:869039001186913,tracker,1308282156,0,F,215630.000,A,5602.11015,N,9246.30767,E,1.4,,175.9,;", Charset.defaultCharset()));*/ diff --git a/test/org/traccar/helper/TestDataManager.java b/test/org/traccar/helper/TestDataManager.java index a54c1f7a3..a74669add 100644 --- a/test/org/traccar/helper/TestDataManager.java +++ b/test/org/traccar/helper/TestDataManager.java @@ -12,7 +12,7 @@ public class TestDataManager extends DataManager { } @Override - public Device getDeviceByImei(String imei) { + public Device getDeviceByUniqueId(String imei) { Device device = new Device(); device.setId(new Long(1)); device.setImei("123456789012345"); diff --git a/test/org/traccar/protocol/ApelProtocolDecoderTest.java b/test/org/traccar/protocol/ApelProtocolDecoderTest.java index 3d96563f6..f6899a6ad 100644 --- a/test/org/traccar/protocol/ApelProtocolDecoderTest.java +++ b/test/org/traccar/protocol/ApelProtocolDecoderTest.java @@ -7,12 +7,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class ApelProtocolDecoderTest { +public class ApelProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - ApelProtocolDecoder decoder = new ApelProtocolDecoder(new TestDataManager(), null, null); + ApelProtocolDecoder decoder = new ApelProtocolDecoder(null); /*byte[] buf1 = {0x40,0x4E,0x54,0x43,0x01,0x00,0x00,0x00,0x7B,0x00,0x00,0x00,0x13,0x00,0x44,0x34,0x2A,0x3E,0x53,0x3A,0x38,0x36,0x31,0x37,0x38,0x35,0x30,0x30,0x35,0x32,0x30,0x35,0x30,0x37,0x39}; assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, buf1)));*/ diff --git a/test/org/traccar/protocol/AplicomProtocolDecoderTest.java b/test/org/traccar/protocol/AplicomProtocolDecoderTest.java index cdbc4dab9..af41e8c03 100644 --- a/test/org/traccar/protocol/AplicomProtocolDecoderTest.java +++ b/test/org/traccar/protocol/AplicomProtocolDecoderTest.java @@ -6,12 +6,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import org.junit.Test;
import org.traccar.helper.ChannelBufferTools;
-public class AplicomProtocolDecoderTest {
+public class AplicomProtocolDecoderTest extends ProtocolDecoderTest {
@Test
public void testDecode() throws Exception {
- AplicomProtocolDecoder decoder = new AplicomProtocolDecoder(new TestDataManager(), null, null);
+ AplicomProtocolDecoder decoder = new AplicomProtocolDecoder(null);
verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString(
"44C20143720729D6840043031fff7191C0450ef906450ef90603b20b8003b20b80066465b3870ce30f010ce30ce3003200001520000000030aa200003b13000000320300000bcb17acff0099000186a002"))));
diff --git a/test/org/traccar/protocol/Ardi01ProtocolDecoderTest.java b/test/org/traccar/protocol/Ardi01ProtocolDecoderTest.java index 7e4a2eb95..90993475e 100644 --- a/test/org/traccar/protocol/Ardi01ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Ardi01ProtocolDecoderTest.java @@ -6,12 +6,12 @@ import org.traccar.helper.TestDataManager; import static org.junit.Assert.assertNull; import static org.traccar.helper.DecoderVerifier.verify; -public class Ardi01ProtocolDecoderTest { +public class Ardi01ProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Ardi01ProtocolDecoder decoder = new Ardi01ProtocolDecoder(new TestDataManager(), null, null); + Ardi01ProtocolDecoder decoder = new Ardi01ProtocolDecoder(null); verify(decoder.decode(null, null, "013227003054776,20141010052719,24.4736042,56.8445807,110,289,40,7,5,78,-1")); diff --git a/test/org/traccar/protocol/AtrackProtocolDecoderTest.java b/test/org/traccar/protocol/AtrackProtocolDecoderTest.java index 043c843c0..34f34c957 100644 --- a/test/org/traccar/protocol/AtrackProtocolDecoderTest.java +++ b/test/org/traccar/protocol/AtrackProtocolDecoderTest.java @@ -7,12 +7,12 @@ import static org.junit.Assert.assertNull; import org.junit.Test; import org.traccar.helper.ChannelBufferTools; -public class AtrackProtocolDecoderTest { +public class AtrackProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - AtrackProtocolDecoder decoder = new AtrackProtocolDecoder(new TestDataManager(), null, null); + AtrackProtocolDecoder decoder = new AtrackProtocolDecoder(null); assertNull(decoder.decode(null, null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( "fe0200014104d8f196820001")))); diff --git a/test/org/traccar/protocol/AutoFon45ProtocolDecoderTest.java b/test/org/traccar/protocol/AutoFon45ProtocolDecoderTest.java index 2665c7cab..26c25833b 100644 --- a/test/org/traccar/protocol/AutoFon45ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/AutoFon45ProtocolDecoderTest.java @@ -8,10 +8,10 @@ import org.traccar.helper.TestDataManager; import static org.junit.Assert.assertNull; import static org.traccar.helper.DecoderVerifier.verify; -public class AutoFon45ProtocolDecoderTest { +public class AutoFon45ProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - AutoFon45ProtocolDecoder decoder = new AutoFon45ProtocolDecoder(new TestDataManager(), null, null); + AutoFon45ProtocolDecoder decoder = new AutoFon45ProtocolDecoder(null); assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( "41032125656985547543619173484002123481")))); diff --git a/test/org/traccar/protocol/AutoFonProtocolDecoderTest.java b/test/org/traccar/protocol/AutoFonProtocolDecoderTest.java index 7e0e13541..ded0aca6f 100644 --- a/test/org/traccar/protocol/AutoFonProtocolDecoderTest.java +++ b/test/org/traccar/protocol/AutoFonProtocolDecoderTest.java @@ -8,12 +8,12 @@ import org.traccar.helper.TestDataManager; import static org.junit.Assert.assertNull;
import static org.traccar.helper.DecoderVerifier.verify;
-public class AutoFonProtocolDecoderTest {
+public class AutoFonProtocolDecoderTest extends ProtocolDecoderTest {
@Test
public void testDecode() throws Exception {
- AutoFonProtocolDecoder decoder = new AutoFonProtocolDecoder(new TestDataManager(), null, null);
+ AutoFonProtocolDecoder decoder = new AutoFonProtocolDecoder(null);
assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString(
"10556103592310314825728F"))));
diff --git a/test/org/traccar/protocol/BceProtocolDecoderTest.java b/test/org/traccar/protocol/BceProtocolDecoderTest.java index ded4ec291..356a6fba1 100644 --- a/test/org/traccar/protocol/BceProtocolDecoderTest.java +++ b/test/org/traccar/protocol/BceProtocolDecoderTest.java @@ -9,12 +9,12 @@ import org.traccar.helper.ChannelBufferTools; import static org.traccar.helper.DecoderVerifier.verify; import org.traccar.helper.TestDataManager; -public class BceProtocolDecoderTest { +public class BceProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - BceProtocolDecoder decoder = new BceProtocolDecoder(new TestDataManager(), null, null); + BceProtocolDecoder decoder = new BceProtocolDecoder(null); verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertHexString( "be76619c834601004200a0003fd769c568ffc3db0079161d420683a9414918b1150000000000d102660167040000000000009f06357f0000a401042ea415e10232000000000000000000000051")))); diff --git a/test/org/traccar/protocol/BoxProtocolDecoderTest.java b/test/org/traccar/protocol/BoxProtocolDecoderTest.java index 94404d4bc..a864d62dd 100644 --- a/test/org/traccar/protocol/BoxProtocolDecoderTest.java +++ b/test/org/traccar/protocol/BoxProtocolDecoderTest.java @@ -5,12 +5,12 @@ import org.traccar.helper.TestDataManager; import static org.traccar.helper.DecoderVerifier.verify; import org.junit.Test; -public class BoxProtocolDecoderTest { +public class BoxProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - BoxProtocolDecoder decoder = new BoxProtocolDecoder(new TestDataManager(), null, null); + BoxProtocolDecoder decoder = new BoxProtocolDecoder(null); assertNull(decoder.decode(null, null, "H,BT,358281002435893,081028142432,F5813D19,6D6E6DC2")); diff --git a/test/org/traccar/protocol/CalAmpProtocolDecoderTest.java b/test/org/traccar/protocol/CalAmpProtocolDecoderTest.java index 5e72fdf26..5f2e5bfce 100644 --- a/test/org/traccar/protocol/CalAmpProtocolDecoderTest.java +++ b/test/org/traccar/protocol/CalAmpProtocolDecoderTest.java @@ -8,12 +8,12 @@ import org.traccar.helper.TestDataManager; import static org.junit.Assert.assertNull; import static org.traccar.helper.DecoderVerifier.verify; -public class CalAmpProtocolDecoderTest { +public class CalAmpProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - CalAmpProtocolDecoder decoder = new CalAmpProtocolDecoder(new TestDataManager(), null, null); + CalAmpProtocolDecoder decoder = new CalAmpProtocolDecoder(null); assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( "830545321041830101010300010000333862000023c301000000004532104183ffffff353816051610691f420040163953294fffffffffffffffff8996604211639032949f4f54413a317c303b302c317c343b302c34004f5441535441543a302c302c302c302c302c222200564255533a342c322e302e302c343533323130343138332c5630312e30332e30312e34302c5630312e30332e30312e33312c2c0056494e2d494e464f3a56494e3d31464d5a5537324539355a4137303032362c4445562d5245474e3d55532c535256522d5245474e3d555300")), null)); diff --git a/test/org/traccar/protocol/CarTrackProtocolDecoderTest.java b/test/org/traccar/protocol/CarTrackProtocolDecoderTest.java index fa19f485f..05e2402a6 100644 --- a/test/org/traccar/protocol/CarTrackProtocolDecoderTest.java +++ b/test/org/traccar/protocol/CarTrackProtocolDecoderTest.java @@ -4,12 +4,12 @@ import org.traccar.helper.TestDataManager; import static org.traccar.helper.DecoderVerifier.verify; import org.junit.Test; -public class CarTrackProtocolDecoderTest { +public class CarTrackProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - CarTrackProtocolDecoder decoder = new CarTrackProtocolDecoder(new TestDataManager(), null, null); + CarTrackProtocolDecoder decoder = new CarTrackProtocolDecoder(null); verify(decoder.decode(null, null, "$$2222234???????&A9955&B102904.000,A,2233.0655,N,11404.9440,E,0.00,,030109,,*17|6.3|&C0100000100&D000024?>&E10000000&Y00100020")); diff --git a/test/org/traccar/protocol/CarscopProtocolDecoderTest.java b/test/org/traccar/protocol/CarscopProtocolDecoderTest.java index 8c75c2437..04217dcd6 100644 --- a/test/org/traccar/protocol/CarscopProtocolDecoderTest.java +++ b/test/org/traccar/protocol/CarscopProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class CarscopProtocolDecoderTest { +public class CarscopProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - CarscopProtocolDecoder decoder = new CarscopProtocolDecoder(new TestDataManager(), null, null); + CarscopProtocolDecoder decoder = new CarscopProtocolDecoder(null); verify(decoder.decode(null, null, "*040331141830UB05123456789012345061825A2934.0133N10627.2544E000.0040331309.6200000000L000000")); diff --git a/test/org/traccar/protocol/CellocatorProtocolDecoderTest.java b/test/org/traccar/protocol/CellocatorProtocolDecoderTest.java index 3825430e3..74b7e305e 100644 --- a/test/org/traccar/protocol/CellocatorProtocolDecoderTest.java +++ b/test/org/traccar/protocol/CellocatorProtocolDecoderTest.java @@ -7,12 +7,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import org.junit.Test; import org.traccar.helper.ChannelBufferTools; -public class CellocatorProtocolDecoderTest { +public class CellocatorProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - CellocatorProtocolDecoder decoder = new CellocatorProtocolDecoder(new TestDataManager(), null, null); + CellocatorProtocolDecoder decoder = new CellocatorProtocolDecoder(null); verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertHexString( "4D4347500006000000081A02021204000000210062300000006B00E100000000000000000000E5A100040206614EA303181A57034E1200000000000000001525071403D60749")))); diff --git a/test/org/traccar/protocol/EasyTrackProtocolDecoderTest.java b/test/org/traccar/protocol/EasyTrackProtocolDecoderTest.java index 8a62e0f14..de746751a 100644 --- a/test/org/traccar/protocol/EasyTrackProtocolDecoderTest.java +++ b/test/org/traccar/protocol/EasyTrackProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class EasyTrackProtocolDecoderTest { +public class EasyTrackProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - EasyTrackProtocolDecoder decoder = new EasyTrackProtocolDecoder(new TestDataManager(), null, null); + EasyTrackProtocolDecoder decoder = new EasyTrackProtocolDecoder(null); assertNull(decoder.decode(null, null, "*ET,135790246811221,GZ,0001,0005")); diff --git a/test/org/traccar/protocol/EelinkProtocolDecoderTest.java b/test/org/traccar/protocol/EelinkProtocolDecoderTest.java index 58f8d71ad..6bf7d7143 100644 --- a/test/org/traccar/protocol/EelinkProtocolDecoderTest.java +++ b/test/org/traccar/protocol/EelinkProtocolDecoderTest.java @@ -7,12 +7,12 @@ import static org.junit.Assert.assertNull; import org.junit.Test; import org.traccar.helper.ChannelBufferTools; -public class EelinkProtocolDecoderTest { +public class EelinkProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - EelinkProtocolDecoder decoder = new EelinkProtocolDecoder(new TestDataManager(), null, null); + EelinkProtocolDecoder decoder = new EelinkProtocolDecoder(null); assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( "676701000b001b035418804661834901")))); diff --git a/test/org/traccar/protocol/EnforaProtocolDecoderTest.java b/test/org/traccar/protocol/EnforaProtocolDecoderTest.java index 5c1a015be..7e67a300f 100644 --- a/test/org/traccar/protocol/EnforaProtocolDecoderTest.java +++ b/test/org/traccar/protocol/EnforaProtocolDecoderTest.java @@ -9,12 +9,12 @@ import org.junit.Test; import org.traccar.helper.ChannelBufferTools; import static org.traccar.helper.DecoderVerifier.verify; -public class EnforaProtocolDecoderTest { +public class EnforaProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - EnforaProtocolDecoder decoder = new EnforaProtocolDecoder(new TestDataManager(), null, null); + EnforaProtocolDecoder decoder = new EnforaProtocolDecoder(null); assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( "000A08002020202020303131303730303030353730323637")))); diff --git a/test/org/traccar/protocol/Ev603ProtocolDecoderTest.java b/test/org/traccar/protocol/Ev603ProtocolDecoderTest.java index 0fd062e97..b56a92c16 100644 --- a/test/org/traccar/protocol/Ev603ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Ev603ProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class Ev603ProtocolDecoderTest { +public class Ev603ProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Ev603ProtocolDecoder decoder = new Ev603ProtocolDecoder(new TestDataManager(), null, null); + Ev603ProtocolDecoder decoder = new Ev603ProtocolDecoder(null); assertNull(decoder.decode(null, null, "!1,123456789012345")); diff --git a/test/org/traccar/protocol/FreedomProtocolDecoderTest.java b/test/org/traccar/protocol/FreedomProtocolDecoderTest.java index e58de3bb1..b39b7a0cd 100644 --- a/test/org/traccar/protocol/FreedomProtocolDecoderTest.java +++ b/test/org/traccar/protocol/FreedomProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class FreedomProtocolDecoderTest { +public class FreedomProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - FreedomProtocolDecoder decoder = new FreedomProtocolDecoder(new TestDataManager(), null, null); + FreedomProtocolDecoder decoder = new FreedomProtocolDecoder(null); verify(decoder.decode(null, null, "IMEI,353358011714362,2014/05/22, 20:49:32, N, Lat:4725.9624, E, Lon:01912.5483, Spd:5.05")); diff --git a/test/org/traccar/protocol/GalileoProtocolDecoderTest.java b/test/org/traccar/protocol/GalileoProtocolDecoderTest.java index abe41b839..b79de9fbf 100644 --- a/test/org/traccar/protocol/GalileoProtocolDecoderTest.java +++ b/test/org/traccar/protocol/GalileoProtocolDecoderTest.java @@ -8,12 +8,12 @@ import org.junit.Test; import org.traccar.helper.ChannelBufferTools; import static org.traccar.helper.DecoderVerifier.verify; -public class GalileoProtocolDecoderTest { +public class GalileoProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - GalileoProtocolDecoder decoder = new GalileoProtocolDecoder(new TestDataManager(), null, null); + GalileoProtocolDecoder decoder = new GalileoProtocolDecoder(null); assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertHexString( "011380033836383230343030313534393038370432008590")))); diff --git a/test/org/traccar/protocol/GatorProtocolDecoderTest.java b/test/org/traccar/protocol/GatorProtocolDecoderTest.java index 24cf1ed1f..6bcd829e3 100644 --- a/test/org/traccar/protocol/GatorProtocolDecoderTest.java +++ b/test/org/traccar/protocol/GatorProtocolDecoderTest.java @@ -6,12 +6,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import org.junit.Test; import org.traccar.helper.ChannelBufferTools; -public class GatorProtocolDecoderTest { +public class GatorProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - GatorProtocolDecoder decoder = new GatorProtocolDecoder(new TestDataManager(), null, null); + GatorProtocolDecoder decoder = new GatorProtocolDecoder(null); verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( "24248000260009632d141121072702059226180104367500000000c04700079c0c34000ad80b00ff000a0d")))); diff --git a/test/org/traccar/protocol/Gl100ProtocolDecoderTest.java b/test/org/traccar/protocol/Gl100ProtocolDecoderTest.java index 0d5a5bc24..08003e155 100644 --- a/test/org/traccar/protocol/Gl100ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gl100ProtocolDecoderTest.java @@ -5,12 +5,12 @@ import org.traccar.helper.TestDataManager; import static org.traccar.helper.DecoderVerifier.verify; import org.junit.Test; -public class Gl100ProtocolDecoderTest { +public class Gl100ProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Gl100ProtocolDecoder decoder = new Gl100ProtocolDecoder(new TestDataManager(), null, null); + Gl100ProtocolDecoder decoder = new Gl100ProtocolDecoder(null); assertNull(decoder.decode(null, null, "AT+GTHBD=HeartBeat,359231030000010,20090101000000,11F0,0102120204")); diff --git a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java index f30f08a63..10f3100f5 100644 --- a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class Gl200ProtocolDecoderTest { +public class Gl200ProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Gl200ProtocolDecoder decoder = new Gl200ProtocolDecoder(new TestDataManager(), null, null); + Gl200ProtocolDecoder decoder = new Gl200ProtocolDecoder(null); verify(decoder.decode(null, null, "+RESP:GTFRI,1A0200,860599000165464,CRI001,0,0,1,2,,41,,-71.153137,42.301634,20150328020301,,,,,280.3,55,20150327220351,320C")); diff --git a/test/org/traccar/protocol/GlobalSatProtocolDecoderTest.java b/test/org/traccar/protocol/GlobalSatProtocolDecoderTest.java index 9f9173c28..67e0f965f 100644 --- a/test/org/traccar/protocol/GlobalSatProtocolDecoderTest.java +++ b/test/org/traccar/protocol/GlobalSatProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class GlobalSatProtocolDecoderTest { +public class GlobalSatProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - GlobalSatProtocolDecoder decoder = new GlobalSatProtocolDecoder(new TestDataManager(), null, null); + GlobalSatProtocolDecoder decoder = new GlobalSatProtocolDecoder(null); assertNull(decoder.decode(null, null, "GSh,131826789036289,3,M,ea04*3d")); diff --git a/test/org/traccar/protocol/GoSafeProtocolDecoderTest.java b/test/org/traccar/protocol/GoSafeProtocolDecoderTest.java index 08f4a4fb6..75d5b0121 100644 --- a/test/org/traccar/protocol/GoSafeProtocolDecoderTest.java +++ b/test/org/traccar/protocol/GoSafeProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class GoSafeProtocolDecoderTest { +public class GoSafeProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - GoSafeProtocolDecoder decoder = new GoSafeProtocolDecoder(new TestDataManager(), null, null); + GoSafeProtocolDecoder decoder = new GoSafeProtocolDecoder(null); assertNull(decoder.decode(null, null, null, "*GS16,351535058709775")); diff --git a/test/org/traccar/protocol/GotopProtocolDecoderTest.java b/test/org/traccar/protocol/GotopProtocolDecoderTest.java index b30ac5534..bfeaf9e2e 100644 --- a/test/org/traccar/protocol/GotopProtocolDecoderTest.java +++ b/test/org/traccar/protocol/GotopProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class GotopProtocolDecoderTest { +public class GotopProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - GotopProtocolDecoder decoder = new GotopProtocolDecoder(new TestDataManager(), null, null); + GotopProtocolDecoder decoder = new GotopProtocolDecoder(null); assertNull(decoder.decode(null, null, "")); diff --git a/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java b/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java index 53a092598..71e2194bd 100644 --- a/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class Gps103ProtocolDecoderTest { +public class Gps103ProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Gps103ProtocolDecoder decoder = new Gps103ProtocolDecoder(new TestDataManager(), null, null); + Gps103ProtocolDecoder decoder = new Gps103ProtocolDecoder(null); // Log on request assertNull(decoder.decode(null, null, null, "##,imei:359586015829802,A")); diff --git a/test/org/traccar/protocol/GpsGateProtocolDecoderTest.java b/test/org/traccar/protocol/GpsGateProtocolDecoderTest.java index 812f63873..d50f03d39 100644 --- a/test/org/traccar/protocol/GpsGateProtocolDecoderTest.java +++ b/test/org/traccar/protocol/GpsGateProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class GpsGateProtocolDecoderTest { +public class GpsGateProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - GpsGateProtocolDecoder decoder = new GpsGateProtocolDecoder(new TestDataManager(), null, null); + GpsGateProtocolDecoder decoder = new GpsGateProtocolDecoder(null); assertNull(decoder.decode(null, null, "$FRLIN,,user1,8IVHF*7A")); diff --git a/test/org/traccar/protocol/Gt02ProtocolDecoderTest.java b/test/org/traccar/protocol/Gt02ProtocolDecoderTest.java index 11fc4ff97..539fe2612 100644 --- a/test/org/traccar/protocol/Gt02ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gt02ProtocolDecoderTest.java @@ -7,12 +7,12 @@ import org.traccar.helper.ChannelBufferTools; import static org.traccar.helper.DecoderVerifier.verify; import org.traccar.helper.TestDataManager; -public class Gt02ProtocolDecoderTest { +public class Gt02ProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Gt02ProtocolDecoder decoder = new Gt02ProtocolDecoder(new TestDataManager(), null, null); + Gt02ProtocolDecoder decoder = new Gt02ProtocolDecoder(null); verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( "68682500000123456789012345000110010101010101026B3F3E026B3F3E000000000000000000010D0A")))); diff --git a/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java b/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java index c0af74538..aee675b2e 100644 --- a/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java @@ -7,12 +7,12 @@ import org.junit.Test; import org.traccar.helper.ChannelBufferTools; import static org.traccar.helper.DecoderVerifier.verify; -public class Gt06ProtocolDecoderTest { +public class Gt06ProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Gt06ProtocolDecoder decoder = new Gt06ProtocolDecoder(new TestDataManager(), null, null); + Gt06ProtocolDecoder decoder = new Gt06ProtocolDecoder(null); assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( "787811010123456789012345100B3201000171930D0A")))); diff --git a/test/org/traccar/protocol/H02ProtocolDecoderTest.java b/test/org/traccar/protocol/H02ProtocolDecoderTest.java index cb8e55517..443462a57 100644 --- a/test/org/traccar/protocol/H02ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/H02ProtocolDecoderTest.java @@ -8,12 +8,12 @@ import static org.junit.Assert.assertNull; import org.junit.Test; import org.traccar.helper.ChannelBufferTools; -public class H02ProtocolDecoderTest { +public class H02ProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - H02ProtocolDecoder decoder = new H02ProtocolDecoder(new TestDataManager(), null, null); + H02ProtocolDecoder decoder = new H02ProtocolDecoder(null); verify(decoder.decode(null, null, ChannelBuffers.copiedBuffer( "*HQ,1451316409,V1,030149,A,-23-29.0095,S,-46-51.5852,W,2.4,065,070315,FFFFFFFF#", Charset.defaultCharset()))); diff --git a/test/org/traccar/protocol/HaicomProtocolDecoderTest.java b/test/org/traccar/protocol/HaicomProtocolDecoderTest.java index f35bf78e3..13659d040 100644 --- a/test/org/traccar/protocol/HaicomProtocolDecoderTest.java +++ b/test/org/traccar/protocol/HaicomProtocolDecoderTest.java @@ -4,12 +4,12 @@ import org.traccar.helper.TestDataManager; import static org.traccar.helper.DecoderVerifier.verify; import org.junit.Test; -public class HaicomProtocolDecoderTest { +public class HaicomProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - HaicomProtocolDecoder decoder = new HaicomProtocolDecoder(new TestDataManager(), null, null); + HaicomProtocolDecoder decoder = new HaicomProtocolDecoder(null); verify(decoder.decode(null, null, "$GPRS123456789012345,602S19A,100915,063515,7240649312041079,0019,3156,111000,10004,0000,11111,00LH#V037")); diff --git a/test/org/traccar/protocol/IntellitracProtocolDecoderTest.java b/test/org/traccar/protocol/IntellitracProtocolDecoderTest.java index 33c3fd3cd..28e5a3ae7 100644 --- a/test/org/traccar/protocol/IntellitracProtocolDecoderTest.java +++ b/test/org/traccar/protocol/IntellitracProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class IntellitracProtocolDecoderTest { +public class IntellitracProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - IntellitracProtocolDecoder decoder = new IntellitracProtocolDecoder(new TestDataManager(), null, null); + IntellitracProtocolDecoder decoder = new IntellitracProtocolDecoder(null); assertNull(decoder.decode(null, null, "$OK:TRACKING")); diff --git a/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java b/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java index 7cbab2836..8f5f4db55 100644 --- a/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java @@ -7,12 +7,12 @@ import org.jboss.netty.buffer.ChannelBuffers; import static org.traccar.helper.DecoderVerifier.verify; import org.junit.Test; -public class Jt600ProtocolDecoderTest { +public class Jt600ProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Jt600ProtocolDecoder decoder = new Jt600ProtocolDecoder(new TestDataManager(), null, null); + Jt600ProtocolDecoder decoder = new Jt600ProtocolDecoder(null); verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( "24311021600111001B16021105591022329862114046227B0598095080012327951435161F")))); diff --git a/test/org/traccar/protocol/KhdProtocolDecoderTest.java b/test/org/traccar/protocol/KhdProtocolDecoderTest.java index 9593bf6d1..5d9e4ef2c 100644 --- a/test/org/traccar/protocol/KhdProtocolDecoderTest.java +++ b/test/org/traccar/protocol/KhdProtocolDecoderTest.java @@ -7,12 +7,12 @@ import static org.junit.Assert.assertNull; import org.junit.Test; import org.traccar.helper.ChannelBufferTools; -public class KhdProtocolDecoderTest { +public class KhdProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - KhdProtocolDecoder decoder = new KhdProtocolDecoder(new TestDataManager(), null, null); + KhdProtocolDecoder decoder = new KhdProtocolDecoder(null); assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( "2929b1000605162935b80d")))); diff --git a/test/org/traccar/protocol/LaipacProtocolDecoderTest.java b/test/org/traccar/protocol/LaipacProtocolDecoderTest.java index fcfa4e98e..e74c2d411 100644 --- a/test/org/traccar/protocol/LaipacProtocolDecoderTest.java +++ b/test/org/traccar/protocol/LaipacProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class LaipacProtocolDecoderTest { +public class LaipacProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - LaipacProtocolDecoder decoder = new LaipacProtocolDecoder(new TestDataManager(), null, null); + LaipacProtocolDecoder decoder = new LaipacProtocolDecoder(null); assertNull(decoder.decode(null, null, "$AVSYS,99999999,V1.50,SN0000103,32768*15")); diff --git a/test/org/traccar/protocol/M2mProtocolDecoderTest.java b/test/org/traccar/protocol/M2mProtocolDecoderTest.java index 346cdbedb..ceb248fb5 100644 --- a/test/org/traccar/protocol/M2mProtocolDecoderTest.java +++ b/test/org/traccar/protocol/M2mProtocolDecoderTest.java @@ -7,12 +7,12 @@ import static org.junit.Assert.assertNull; import org.junit.Test; import org.traccar.helper.ChannelBufferTools; -public class M2mProtocolDecoderTest { +public class M2mProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - M2mProtocolDecoder decoder = new M2mProtocolDecoder(new TestDataManager(), null, null); + M2mProtocolDecoder decoder = new M2mProtocolDecoder(null); assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( "235A3C2A2624215C287D70212A21254C7C6421220B0B0B")))); diff --git a/test/org/traccar/protocol/ManPowerProtocolDecoderTest.java b/test/org/traccar/protocol/ManPowerProtocolDecoderTest.java index 235778dd2..d5a722019 100644 --- a/test/org/traccar/protocol/ManPowerProtocolDecoderTest.java +++ b/test/org/traccar/protocol/ManPowerProtocolDecoderTest.java @@ -4,12 +4,12 @@ import org.traccar.helper.TestDataManager; import static org.traccar.helper.DecoderVerifier.verify; import org.junit.Test; -public class ManPowerProtocolDecoderTest { +public class ManPowerProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - ManPowerProtocolDecoder decoder = new ManPowerProtocolDecoder(new TestDataManager(), null, null); + ManPowerProtocolDecoder decoder = new ManPowerProtocolDecoder(null); verify(decoder.decode(null, null, "simei:352581250259539,,,tracker,51,24,1.73,130426023608,A,3201.5462,N,03452.2975,E,0.01,28B9,1DED,425,01,1x0x0*0x1*60x+2,en-us,")); diff --git a/test/org/traccar/protocol/MegastekProtocolDecoderTest.java b/test/org/traccar/protocol/MegastekProtocolDecoderTest.java index 7a25ff340..dd044990f 100644 --- a/test/org/traccar/protocol/MegastekProtocolDecoderTest.java +++ b/test/org/traccar/protocol/MegastekProtocolDecoderTest.java @@ -4,12 +4,12 @@ import org.traccar.helper.TestDataManager; import static org.traccar.helper.DecoderVerifier.verify; import org.junit.Test; -public class MegastekProtocolDecoderTest { +public class MegastekProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - MegastekProtocolDecoder decoder = new MegastekProtocolDecoder(new TestDataManager(), null, null); + MegastekProtocolDecoder decoder = new MegastekProtocolDecoder(null); verify(decoder.decode(null, null, "STX,GerAL22,$GPRMC,174752.000,A,3637.060059,S,6416.2354,W,0.00,0.00,030812,,,A*55,F,,imei:861785000249353,05,180.6,Battery=100%,,1,722,310,0FA6,39D0;8F")); diff --git a/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java b/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java index 212e2301a..7d3353016 100644 --- a/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java +++ b/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java @@ -7,12 +7,12 @@ import static org.junit.Assert.assertNull; import org.junit.Test; import org.traccar.helper.ChannelBufferTools; -public class MeiligaoProtocolDecoderTest { +public class MeiligaoProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - MeiligaoProtocolDecoder decoder = new MeiligaoProtocolDecoder(new TestDataManager(), null, null); + MeiligaoProtocolDecoder decoder = new MeiligaoProtocolDecoder(null); assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( "24240000123456FFFFFFFF50008B9B0D0A")))); diff --git a/test/org/traccar/protocol/MeitrackProtocolDecoderTest.java b/test/org/traccar/protocol/MeitrackProtocolDecoderTest.java index f031a5f15..339cddde5 100644 --- a/test/org/traccar/protocol/MeitrackProtocolDecoderTest.java +++ b/test/org/traccar/protocol/MeitrackProtocolDecoderTest.java @@ -8,12 +8,12 @@ import org.junit.Test; import org.traccar.helper.ChannelBufferTools; import static org.traccar.helper.DecoderVerifier.verify; -public class MeitrackProtocolDecoderTest { +public class MeitrackProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - MeitrackProtocolDecoder decoder = new MeitrackProtocolDecoder(new TestDataManager(), null, null); + MeitrackProtocolDecoder decoder = new MeitrackProtocolDecoder(null); verify(decoder.decode(null, null, ChannelBuffers.copiedBuffer( "$$I152,013949004569813,AAA,37,54.739468,25.273648,150208173414,A,5,24,0,73,1.5,165,74,3381,246|1|0065|118A,0000,0003|0003|0000|08D4|0002,006380DF,,1,0008*7C", Charset.defaultCharset()))); diff --git a/test/org/traccar/protocol/MiniFinderProtocolDecoderTest.java b/test/org/traccar/protocol/MiniFinderProtocolDecoderTest.java index c377a11c8..27c88216f 100644 --- a/test/org/traccar/protocol/MiniFinderProtocolDecoderTest.java +++ b/test/org/traccar/protocol/MiniFinderProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class MiniFinderProtocolDecoderTest { +public class MiniFinderProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - MiniFinderProtocolDecoder decoder = new MiniFinderProtocolDecoder(new TestDataManager(), null, null); + MiniFinderProtocolDecoder decoder = new MiniFinderProtocolDecoder(null); assertNull(decoder.decode(null, null, "!1,860719020212696")); diff --git a/test/org/traccar/protocol/MtxProtocolDecoderTest.java b/test/org/traccar/protocol/MtxProtocolDecoderTest.java index f003780cd..2d027cbf8 100644 --- a/test/org/traccar/protocol/MtxProtocolDecoderTest.java +++ b/test/org/traccar/protocol/MtxProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class MtxProtocolDecoderTest { +public class MtxProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - MtxProtocolDecoder decoder = new MtxProtocolDecoder(new TestDataManager(), null, null); + MtxProtocolDecoder decoder = new MtxProtocolDecoder(null); verify(decoder.decode(null, null, "#MTX,353815011138124,20101226,195550,41.6296399,002.3611174,000,035,000000.00,X,X,1111,000,0,0")); diff --git a/test/org/traccar/protocol/NavigilProtocolDecoderTest.java b/test/org/traccar/protocol/NavigilProtocolDecoderTest.java index 6f58f83d1..ab72d887f 100644 --- a/test/org/traccar/protocol/NavigilProtocolDecoderTest.java +++ b/test/org/traccar/protocol/NavigilProtocolDecoderTest.java @@ -8,12 +8,12 @@ import org.junit.Test; import org.traccar.helper.ChannelBufferTools; import static org.traccar.helper.DecoderVerifier.verify; -public class NavigilProtocolDecoderTest { +public class NavigilProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - NavigilProtocolDecoder decoder = new NavigilProtocolDecoder(new TestDataManager(), null, null); + NavigilProtocolDecoder decoder = new NavigilProtocolDecoder(null); assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertHexString( "01004300040020000000f60203080200e7cd0f510c0000003b00000000000000")))); diff --git a/test/org/traccar/protocol/NavisProtocolDecoderTest.java b/test/org/traccar/protocol/NavisProtocolDecoderTest.java index 82dcc0ba1..bdc656b10 100644 --- a/test/org/traccar/protocol/NavisProtocolDecoderTest.java +++ b/test/org/traccar/protocol/NavisProtocolDecoderTest.java @@ -8,12 +8,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class NavisProtocolDecoderTest { +public class NavisProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - NavisProtocolDecoder decoder = new NavisProtocolDecoder(new TestDataManager(), null, null); + NavisProtocolDecoder decoder = new NavisProtocolDecoder(null); assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertHexString( "404E5443010000007B000000130044342A3E533A383631373835303035323035303739")))); diff --git a/test/org/traccar/protocol/NoranProtocolDecoderTest.java b/test/org/traccar/protocol/NoranProtocolDecoderTest.java index 1c80bb399..b7c05a62e 100644 --- a/test/org/traccar/protocol/NoranProtocolDecoderTest.java +++ b/test/org/traccar/protocol/NoranProtocolDecoderTest.java @@ -8,12 +8,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import org.junit.Test; import org.traccar.helper.ChannelBufferTools; -public class NoranProtocolDecoderTest { +public class NoranProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - NoranProtocolDecoder decoder = new NoranProtocolDecoder(new TestDataManager(), null, null); + NoranProtocolDecoder decoder = new NoranProtocolDecoder(null); assertNull(decoder.decode(null, null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertHexString( "0f0000004e52303946303431353500")))); diff --git a/test/org/traccar/protocol/OrionProtocolDecoderTest.java b/test/org/traccar/protocol/OrionProtocolDecoderTest.java index d41ea5b91..66243ecf3 100644 --- a/test/org/traccar/protocol/OrionProtocolDecoderTest.java +++ b/test/org/traccar/protocol/OrionProtocolDecoderTest.java @@ -8,12 +8,12 @@ import org.junit.Test; import org.traccar.helper.ChannelBufferTools; import static org.traccar.helper.DecoderVerifier.verify; -public class OrionProtocolDecoderTest { +public class OrionProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - OrionProtocolDecoder decoder = new OrionProtocolDecoder(new TestDataManager(), null, null); + OrionProtocolDecoder decoder = new OrionProtocolDecoder(null); verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertHexString( "5057000137bf6236235a0331b5c6e402a3b5ecff5102980003000e0c1d172936080e0c1d172936b03b01000882050000008e080000000000008c0300940500000084030085030003067600900113150000000000000000000000000000000000000004a4c8")))); diff --git a/test/org/traccar/protocol/OsmAndProtocolDecoderTest.java b/test/org/traccar/protocol/OsmAndProtocolDecoderTest.java index 94b0eb91b..0d20dc959 100644 --- a/test/org/traccar/protocol/OsmAndProtocolDecoderTest.java +++ b/test/org/traccar/protocol/OsmAndProtocolDecoderTest.java @@ -7,12 +7,12 @@ import org.jboss.netty.handler.codec.http.HttpVersion; import static org.traccar.helper.DecoderVerifier.verify; import org.junit.Test; -public class OsmAndProtocolDecoderTest { +public class OsmAndProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - OsmAndProtocolDecoder decoder = new OsmAndProtocolDecoder(new TestDataManager(), null, null); + OsmAndProtocolDecoder decoder = new OsmAndProtocolDecoder(null); verify(decoder.decode(null, null, new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/?lat=49.60688&lon=6.15788×tamp=2014-06-04+09%3A10%3A11&altitude=384.7&speed=0.0&id=353861053849681"))); diff --git a/test/org/traccar/protocol/PiligrimProtocolDecoderTest.java b/test/org/traccar/protocol/PiligrimProtocolDecoderTest.java index 62e19ad85..354606817 100644 --- a/test/org/traccar/protocol/PiligrimProtocolDecoderTest.java +++ b/test/org/traccar/protocol/PiligrimProtocolDecoderTest.java @@ -11,12 +11,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import org.junit.Test; import org.traccar.helper.ChannelBufferTools; -public class PiligrimProtocolDecoderTest { +public class PiligrimProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - PiligrimProtocolDecoder decoder = new PiligrimProtocolDecoder(new TestDataManager(), null, null); + PiligrimProtocolDecoder decoder = new PiligrimProtocolDecoder(null); HttpRequest msg1 = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, "/bingps?imei=868204005544720&csq=18&vout=00&vin=4050&dataid=00000000"); msg1.setContent(ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( diff --git a/test/org/traccar/protocol/ProgressProtocolDecoderTest.java b/test/org/traccar/protocol/ProgressProtocolDecoderTest.java index dd4203609..e12f96279 100644 --- a/test/org/traccar/protocol/ProgressProtocolDecoderTest.java +++ b/test/org/traccar/protocol/ProgressProtocolDecoderTest.java @@ -10,12 +10,12 @@ import java.nio.ByteOrder; import static org.junit.Assert.assertNull; import static org.traccar.helper.DecoderVerifier.verify; -public class ProgressProtocolDecoderTest { +public class ProgressProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - ProgressProtocolDecoder decoder = new ProgressProtocolDecoder(new TestDataManager(), null, null); + ProgressProtocolDecoder decoder = new ProgressProtocolDecoder(null); assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertHexString( "020037000100000003003131310f003335343836383035313339303036320f00323530303136333832383531353535010000000100000000000000e6bb97b6")))); diff --git a/test/org/traccar/protocol/ProtocolDecoderTest.java b/test/org/traccar/protocol/ProtocolDecoderTest.java new file mode 100644 index 000000000..766a30284 --- /dev/null +++ b/test/org/traccar/protocol/ProtocolDecoderTest.java @@ -0,0 +1,15 @@ +package org.traccar.protocol; + +import org.traccar.Context; +import org.traccar.helper.TestDataManager; + +public class ProtocolDecoderTest { + + static { + try { + Context.init(new TestDataManager()); + } catch(Exception error) { + } + } + +} diff --git a/test/org/traccar/protocol/Pt3000ProtocolDecoderTest.java b/test/org/traccar/protocol/Pt3000ProtocolDecoderTest.java index 3aba53b69..22c1d5069 100644 --- a/test/org/traccar/protocol/Pt3000ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Pt3000ProtocolDecoderTest.java @@ -4,12 +4,12 @@ import org.traccar.helper.TestDataManager; import static org.traccar.helper.DecoderVerifier.verify; import org.junit.Test; -public class Pt3000ProtocolDecoderTest { +public class Pt3000ProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Pt3000ProtocolDecoder decoder = new Pt3000ProtocolDecoder(new TestDataManager(), null, null); + Pt3000ProtocolDecoder decoder = new Pt3000ProtocolDecoder(null); verify(decoder.decode(null, null, "%356939010012099,$GPRMC,124945.752,A,4436.6245,N,01054.4634,E,0.11,358.52,060408,,,A,+393334347445,N028d")); diff --git a/test/org/traccar/protocol/Pt502ProtocolDecoderTest.java b/test/org/traccar/protocol/Pt502ProtocolDecoderTest.java index eb99e9d37..0f63c6fd7 100644 --- a/test/org/traccar/protocol/Pt502ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Pt502ProtocolDecoderTest.java @@ -4,12 +4,12 @@ import org.traccar.helper.TestDataManager; import static org.traccar.helper.DecoderVerifier.verify; import org.junit.Test; -public class Pt502ProtocolDecoderTest { +public class Pt502ProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Pt502ProtocolDecoder decoder = new Pt502ProtocolDecoder(new TestDataManager(), null, null); + Pt502ProtocolDecoder decoder = new Pt502ProtocolDecoder(null); verify(decoder.decode(null, null, "$POS,6094,205523.000,A,1013.6223,N,06728.4248,W,0.0,99.3,011112,,,A/00000,00000/0/23895000//")); diff --git a/test/org/traccar/protocol/RitiProtocolDecoderTest.java b/test/org/traccar/protocol/RitiProtocolDecoderTest.java index b949e1376..d94772cd8 100644 --- a/test/org/traccar/protocol/RitiProtocolDecoderTest.java +++ b/test/org/traccar/protocol/RitiProtocolDecoderTest.java @@ -8,12 +8,12 @@ import org.traccar.helper.ChannelBufferTools; import static org.traccar.helper.DecoderVerifier.verify; import org.traccar.helper.TestDataManager; -public class RitiProtocolDecoderTest { +public class RitiProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - RitiProtocolDecoder decoder = new RitiProtocolDecoder(new TestDataManager(), null, null); + RitiProtocolDecoder decoder = new RitiProtocolDecoder(null); verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertHexString( "3b2864a3056300006d40000003000000000000000000000000244750524d432c3231313734332e3030302c412c313335372e333637352c4e2c31303033362e363939322c452c302e30302c2c3031303931342c2c2c412a37380d0a00000000000000000000000000000000040404")))); diff --git a/test/org/traccar/protocol/RuptelaProtocolDecoderTest.java b/test/org/traccar/protocol/RuptelaProtocolDecoderTest.java index 84949b534..22c0b6c87 100644 --- a/test/org/traccar/protocol/RuptelaProtocolDecoderTest.java +++ b/test/org/traccar/protocol/RuptelaProtocolDecoderTest.java @@ -6,12 +6,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import org.junit.Test; import org.traccar.helper.ChannelBufferTools; -public class RuptelaProtocolDecoderTest { +public class RuptelaProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - RuptelaProtocolDecoder decoder = new RuptelaProtocolDecoder(new TestDataManager(), null, null); + RuptelaProtocolDecoder decoder = new RuptelaProtocolDecoder(null); verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( "007900000b1a2a5585c30100024e9c036900000f101733208ff45e07b31b570a001009090605011b1a020003001c01ad01021d338e16000002960000601a41014bc16d004e9c038400000f104fdf20900d20075103b00a001308090605011b1a020003001c01ad01021d33b116000002960000601a41014bc1ea0028f9")))); diff --git a/test/org/traccar/protocol/SanavProtocolDecoderTest.java b/test/org/traccar/protocol/SanavProtocolDecoderTest.java index 6405ee281..c7b1335a1 100644 --- a/test/org/traccar/protocol/SanavProtocolDecoderTest.java +++ b/test/org/traccar/protocol/SanavProtocolDecoderTest.java @@ -4,12 +4,12 @@ import org.traccar.helper.TestDataManager; import static org.traccar.helper.DecoderVerifier.verify; import org.junit.Test; -public class SanavProtocolDecoderTest { +public class SanavProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - SanavProtocolDecoder decoder = new SanavProtocolDecoder(new TestDataManager(), null, null); + SanavProtocolDecoder decoder = new SanavProtocolDecoder(null); verify(decoder.decode(null, null, "imei=352024028982787&rmc=$GPRMC,103048.000,A,4735.0399,N,01905.2895,E,0.00,0.00,171013,,*05,AUTO-4095mv")); diff --git a/test/org/traccar/protocol/SkypatrolProtocolDecoderTest.java b/test/org/traccar/protocol/SkypatrolProtocolDecoderTest.java index 5873a78d9..942ada8b4 100644 --- a/test/org/traccar/protocol/SkypatrolProtocolDecoderTest.java +++ b/test/org/traccar/protocol/SkypatrolProtocolDecoderTest.java @@ -6,12 +6,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import org.junit.Test; import org.traccar.helper.ChannelBufferTools; -public class SkypatrolProtocolDecoderTest { +public class SkypatrolProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - SkypatrolProtocolDecoder decoder = new SkypatrolProtocolDecoder(new TestDataManager(), null, null); + SkypatrolProtocolDecoder decoder = new SkypatrolProtocolDecoder(null); verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( "0005021004FFFFFFFF0000000D313134373735383300CB000000000E11070C010184D032FB3841370000000016072B000017050032000000000000024E0C071116072C105900050000000000050000000000050000000003100260B7363B6306C11A00B73637F206BF19B73637F106B50EB73638B106BB0BB7363B6106B80AB73637F306B709000000000000000000C")))); diff --git a/test/org/traccar/protocol/Stl060ProtocolDecoderTest.java b/test/org/traccar/protocol/Stl060ProtocolDecoderTest.java index c1f499e4b..a4f953198 100644 --- a/test/org/traccar/protocol/Stl060ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Stl060ProtocolDecoderTest.java @@ -4,12 +4,12 @@ import org.traccar.helper.TestDataManager; import static org.traccar.helper.DecoderVerifier.verify; import org.junit.Test; -public class Stl060ProtocolDecoderTest { +public class Stl060ProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Stl060ProtocolDecoder decoder = new Stl060ProtocolDecoder(new TestDataManager(), null, null); + Stl060ProtocolDecoder decoder = new Stl060ProtocolDecoder(null); verify(decoder.decode(null, null, "$1,357804048043099,D001,AP29AW0963,23/02/14,14:06:54,17248488N,078342226E,0.08,193.12,1,1,1,1,1,A")); diff --git a/test/org/traccar/protocol/SuntechProtocolDecoderTest.java b/test/org/traccar/protocol/SuntechProtocolDecoderTest.java index f3a18f70a..96bf1ea95 100644 --- a/test/org/traccar/protocol/SuntechProtocolDecoderTest.java +++ b/test/org/traccar/protocol/SuntechProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class SuntechProtocolDecoderTest { +public class SuntechProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - SuntechProtocolDecoder decoder = new SuntechProtocolDecoder(new TestDataManager(), null, null); + SuntechProtocolDecoder decoder = new SuntechProtocolDecoder(null); assertNull(decoder.decode(null, null, "SA200ALV;317652")); diff --git a/test/org/traccar/protocol/SyrusProtocolDecoderTest.java b/test/org/traccar/protocol/SyrusProtocolDecoderTest.java index 9b2457c99..4482d30cb 100644 --- a/test/org/traccar/protocol/SyrusProtocolDecoderTest.java +++ b/test/org/traccar/protocol/SyrusProtocolDecoderTest.java @@ -5,12 +5,12 @@ import org.traccar.helper.TestDataManager; import static org.traccar.helper.DecoderVerifier.verify; import org.junit.Test; -public class SyrusProtocolDecoderTest { +public class SyrusProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - SyrusProtocolDecoder decoder = new SyrusProtocolDecoder(new TestDataManager(), null, null, false); + SyrusProtocolDecoder decoder = new SyrusProtocolDecoder(null, false); assertNotNull(decoder.decode(null, null, ">RPV00000+3739438-1220384601512612;ID=1234;*7F")); diff --git a/test/org/traccar/protocol/T55ProtocolDecoderTest.java b/test/org/traccar/protocol/T55ProtocolDecoderTest.java index 48f462775..4a61fa6fa 100644 --- a/test/org/traccar/protocol/T55ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/T55ProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class T55ProtocolDecoderTest { +public class T55ProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - T55ProtocolDecoder decoder = new T55ProtocolDecoder(new TestDataManager(), null, null); + T55ProtocolDecoder decoder = new T55ProtocolDecoder(null); assertNull(decoder.decode(null, null, "$GPFID,ID123456ABC")); diff --git a/test/org/traccar/protocol/TelikProtocolDecoderTest.java b/test/org/traccar/protocol/TelikProtocolDecoderTest.java index 55e00a472..dff2f9489 100644 --- a/test/org/traccar/protocol/TelikProtocolDecoderTest.java +++ b/test/org/traccar/protocol/TelikProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class TelikProtocolDecoderTest { +public class TelikProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - TelikProtocolDecoder decoder = new TelikProtocolDecoder(new TestDataManager(), null, null); + TelikProtocolDecoder decoder = new TelikProtocolDecoder(null); assertNull(decoder.decode(null, null, "0026436729|232|01|003002030")); diff --git a/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java b/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java index 32fa7df87..db151e65c 100644 --- a/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java +++ b/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java @@ -7,12 +7,12 @@ import static org.junit.Assert.assertNull; import org.junit.Test; import org.traccar.helper.ChannelBufferTools; -public class TeltonikaProtocolDecoderTest { +public class TeltonikaProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - TeltonikaProtocolDecoder decoder = new TeltonikaProtocolDecoder(new TestDataManager(), null, null); + TeltonikaProtocolDecoder decoder = new TeltonikaProtocolDecoder(null); assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( "000F313233343536373839303132333435")))); diff --git a/test/org/traccar/protocol/Tk102ProtocolDecoderTest.java b/test/org/traccar/protocol/Tk102ProtocolDecoderTest.java index 998365648..21a6e3010 100644 --- a/test/org/traccar/protocol/Tk102ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Tk102ProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class Tk102ProtocolDecoderTest { +public class Tk102ProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Tk102ProtocolDecoder decoder = new Tk102ProtocolDecoder(new TestDataManager(), null, null); + Tk102ProtocolDecoder decoder = new Tk102ProtocolDecoder(null); assertNull(decoder.decode(null, null, "")); diff --git a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java index be1c8929b..f8df401fe 100644 --- a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class Tk103ProtocolDecoderTest { +public class Tk103ProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Tk103ProtocolDecoder decoder = new Tk103ProtocolDecoder(new TestDataManager(), null, null); + Tk103ProtocolDecoder decoder = new Tk103ProtocolDecoder(null); assertNull(decoder.decode(null, null, "(090411121854BP0000001234567890HSO")); diff --git a/test/org/traccar/protocol/Tlt2hProtocolDecoderTest.java b/test/org/traccar/protocol/Tlt2hProtocolDecoderTest.java index de1ce2aa3..5473f6774 100644 --- a/test/org/traccar/protocol/Tlt2hProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Tlt2hProtocolDecoderTest.java @@ -4,12 +4,12 @@ import org.traccar.helper.TestDataManager; import static org.traccar.helper.DecoderVerifier.verify; import org.junit.Test; -public class Tlt2hProtocolDecoderTest { +public class Tlt2hProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Tlt2hProtocolDecoder decoder = new Tlt2hProtocolDecoder(new TestDataManager(), null, null); + Tlt2hProtocolDecoder decoder = new Tlt2hProtocolDecoder(null); verify(decoder.decode(null, null, "#357671030946351#V500#0000#AUTO#1\r\n" + diff --git a/test/org/traccar/protocol/TopflytechProtocolDecoderTest.java b/test/org/traccar/protocol/TopflytechProtocolDecoderTest.java index 2e5d1b0af..1804b335c 100644 --- a/test/org/traccar/protocol/TopflytechProtocolDecoderTest.java +++ b/test/org/traccar/protocol/TopflytechProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class TopflytechProtocolDecoderTest { +public class TopflytechProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - TopflytechProtocolDecoder decoder = new TopflytechProtocolDecoder(new TestDataManager(), null, null); + TopflytechProtocolDecoder decoder = new TopflytechProtocolDecoder(null); verify(decoder.decode(null, null, "(880316890094910BP00XG00b600000000L00074b54S00000000R0C0F0014000100f0130531152205A0706.1395S11024.0965E000.0251.25")); diff --git a/test/org/traccar/protocol/TotemProtocolDecoderTest.java b/test/org/traccar/protocol/TotemProtocolDecoderTest.java index 35d30d9ae..bd66c7677 100644 --- a/test/org/traccar/protocol/TotemProtocolDecoderTest.java +++ b/test/org/traccar/protocol/TotemProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class TotemProtocolDecoderTest { +public class TotemProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - TotemProtocolDecoder decoder = new TotemProtocolDecoder(new TestDataManager(), null, null); + TotemProtocolDecoder decoder = new TotemProtocolDecoder(null); verify(decoder.decode(null, null, "$$AE860990002922822|AA$GPRMC,051002.00,A,0439.26245,N,10108.94448,E,0.023,,140315,,,A*71|02.98|01.95|02.26|000000000000|20150314051003|13841157|105A3B1C|0000|0.0000|0005|5324")); diff --git a/test/org/traccar/protocol/Tr20ProtocolDecoderTest.java b/test/org/traccar/protocol/Tr20ProtocolDecoderTest.java index b2d2d9a7d..669e84f53 100644 --- a/test/org/traccar/protocol/Tr20ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Tr20ProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class Tr20ProtocolDecoderTest { +public class Tr20ProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Tr20ProtocolDecoder decoder = new Tr20ProtocolDecoder(new TestDataManager(), null, null); + Tr20ProtocolDecoder decoder = new Tr20ProtocolDecoder(null); assertNull(decoder.decode(null, null, "%%TRACKPRO01,1")); diff --git a/test/org/traccar/protocol/Tr900ProtocolDecoderTest.java b/test/org/traccar/protocol/Tr900ProtocolDecoderTest.java index 0549478d9..a5ce90b15 100644 --- a/test/org/traccar/protocol/Tr900ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Tr900ProtocolDecoderTest.java @@ -6,12 +6,12 @@ import org.traccar.helper.TestDataManager; import static org.junit.Assert.assertNull; import static org.traccar.helper.DecoderVerifier.verify; -public class Tr900ProtocolDecoderTest { +public class Tr900ProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Tr900ProtocolDecoder decoder = new Tr900ProtocolDecoder(new TestDataManager(), null, null); + Tr900ProtocolDecoder decoder = new Tr900ProtocolDecoder(null); verify(decoder.decode(null, null, ">12345678,1,1,070201,144111,W05829.2613,S3435.2313,,00,034,25,00,126-000,0,3,11111111*2d!")); diff --git a/test/org/traccar/protocol/TrackboxProtocolDecoderTest.java b/test/org/traccar/protocol/TrackboxProtocolDecoderTest.java index eb26532b0..4319a1eed 100644 --- a/test/org/traccar/protocol/TrackboxProtocolDecoderTest.java +++ b/test/org/traccar/protocol/TrackboxProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class TrackboxProtocolDecoderTest { +public class TrackboxProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - TrackboxProtocolDecoder decoder = new TrackboxProtocolDecoder(new TestDataManager(), null, null); + TrackboxProtocolDecoder decoder = new TrackboxProtocolDecoder(null); assertNull(decoder.decode(null, null, "a=connect&v=11&i=111111111111111")); diff --git a/test/org/traccar/protocol/TramigoProtocolDecoderTest.java b/test/org/traccar/protocol/TramigoProtocolDecoderTest.java index 2009c8072..f2cdf3332 100644 --- a/test/org/traccar/protocol/TramigoProtocolDecoderTest.java +++ b/test/org/traccar/protocol/TramigoProtocolDecoderTest.java @@ -10,12 +10,12 @@ import java.nio.ByteOrder; import static org.junit.Assert.assertNull; import static org.traccar.helper.DecoderVerifier.verify; -public class TramigoProtocolDecoderTest { +public class TramigoProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - TramigoProtocolDecoder decoder = new TramigoProtocolDecoder(new TestDataManager(), null, null); + TramigoProtocolDecoder decoder = new TramigoProtocolDecoder(null); verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertHexString( "8000011bb0009e0001015b93032ef6f35994a9545472616d69676f3a204d6f76696e672c20302e3930206b6d205345206f66204372616e6562726f6f6b20466972652053746174696f6e2c2050656e726974682c205379646e65792c2041552c202d33332e37303732322c203135302e37313735392c2053452077697468207370656564203337206b6d2f682c2031393a3438204a616e20342020454f46")))); diff --git a/test/org/traccar/protocol/TytanProtocolDecoderTest.java b/test/org/traccar/protocol/TytanProtocolDecoderTest.java index 2139cbcb5..5fdb847b1 100644 --- a/test/org/traccar/protocol/TytanProtocolDecoderTest.java +++ b/test/org/traccar/protocol/TytanProtocolDecoderTest.java @@ -7,12 +7,12 @@ import org.traccar.helper.ChannelBufferTools; import static org.traccar.helper.DecoderVerifier.verify; import org.traccar.helper.TestDataManager; -public class TytanProtocolDecoderTest { +public class TytanProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - TytanProtocolDecoder decoder = new TytanProtocolDecoder(new TestDataManager(), null, null); + TytanProtocolDecoder decoder = new TytanProtocolDecoder(null); verify(decoder.decode(null, null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( "D56000000AF20E4FA7C77AFF3282C68D2F890800")))); diff --git a/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java b/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java index f71b746f3..e680ec6af 100644 --- a/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java +++ b/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java @@ -8,12 +8,12 @@ import org.traccar.helper.TestDataManager; import static org.junit.Assert.assertNull; import static org.traccar.helper.DecoderVerifier.verify; -public class UlbotechProtocolDecoderTest { +public class UlbotechProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - UlbotechProtocolDecoder decoder = new UlbotechProtocolDecoder(new TestDataManager(), null, null); + UlbotechProtocolDecoder decoder = new UlbotechProtocolDecoder(null); verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( "F80101035785203457289495D60235010E016175A506C2C838000000000064")))); diff --git a/test/org/traccar/protocol/V680ProtocolDecoderTest.java b/test/org/traccar/protocol/V680ProtocolDecoderTest.java index f481bfda4..07359f890 100644 --- a/test/org/traccar/protocol/V680ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/V680ProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class V680ProtocolDecoderTest { +public class V680ProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - V680ProtocolDecoder decoder = new V680ProtocolDecoder(new TestDataManager(), null, null); + V680ProtocolDecoder decoder = new V680ProtocolDecoder(null); assertNull(decoder.decode(null, null, "#353588102019155")); diff --git a/test/org/traccar/protocol/VisiontekProtocolDecoderTest.java b/test/org/traccar/protocol/VisiontekProtocolDecoderTest.java index 45f8d892a..3eb1045a7 100644 --- a/test/org/traccar/protocol/VisiontekProtocolDecoderTest.java +++ b/test/org/traccar/protocol/VisiontekProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class VisiontekProtocolDecoderTest { +public class VisiontekProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - VisiontekProtocolDecoder decoder = new VisiontekProtocolDecoder(new TestDataManager(), null, null); + VisiontekProtocolDecoder decoder = new VisiontekProtocolDecoder(null); verify(decoder.decode(null, null, "$1,AP09BU9397,861785006462448,20,06,14,15,03,28,17267339N,078279407E,060.0,073,0550,11,0,1,0,0,1,1,26,A,0000000000")); diff --git a/test/org/traccar/protocol/WialonProtocolDecoderTest.java b/test/org/traccar/protocol/WialonProtocolDecoderTest.java index 0f5035650..25d61b363 100644 --- a/test/org/traccar/protocol/WialonProtocolDecoderTest.java +++ b/test/org/traccar/protocol/WialonProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class WialonProtocolDecoderTest { +public class WialonProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - WialonProtocolDecoder decoder = new WialonProtocolDecoder(new TestDataManager(), null, null); + WialonProtocolDecoder decoder = new WialonProtocolDecoder(null); assertNull(decoder.decode(null, null, "#L#123456789012345;test")); diff --git a/test/org/traccar/protocol/WondexProtocolDecoderTest.java b/test/org/traccar/protocol/WondexProtocolDecoderTest.java index 096273a66..45f72dd8a 100644 --- a/test/org/traccar/protocol/WondexProtocolDecoderTest.java +++ b/test/org/traccar/protocol/WondexProtocolDecoderTest.java @@ -4,12 +4,12 @@ import org.traccar.helper.TestDataManager; import static org.traccar.helper.DecoderVerifier.verify; import org.junit.Test; -public class WondexProtocolDecoderTest { +public class WondexProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - WondexProtocolDecoder decoder = new WondexProtocolDecoder(new TestDataManager(), null, null); + WondexProtocolDecoder decoder = new WondexProtocolDecoder(null); verify(decoder.decode(null, null, "1044989601,20130323074605,0.000000,90.000000,0,000,0,0,2")); diff --git a/test/org/traccar/protocol/Xexun2ProtocolDecoderTest.java b/test/org/traccar/protocol/Xexun2ProtocolDecoderTest.java index 9703d3ca3..a4dcdc9f4 100644 --- a/test/org/traccar/protocol/Xexun2ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Xexun2ProtocolDecoderTest.java @@ -5,12 +5,12 @@ import org.traccar.helper.TestDataManager; import static org.traccar.helper.DecoderVerifier.verify; import org.junit.Test; -public class Xexun2ProtocolDecoderTest { +public class Xexun2ProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Xexun2ProtocolDecoder decoder = new Xexun2ProtocolDecoder(new TestDataManager(), null, null); + Xexun2ProtocolDecoder decoder = new Xexun2ProtocolDecoder(null); assertNull(decoder.decode(null, null, ",+48606717068,,L,, imei:012207005047292,,,F:4.28V,1,52,11565,247,01,000E,1FC5")); diff --git a/test/org/traccar/protocol/XexunProtocolDecoderTest.java b/test/org/traccar/protocol/XexunProtocolDecoderTest.java index 9b19d3822..cf134d1a5 100644 --- a/test/org/traccar/protocol/XexunProtocolDecoderTest.java +++ b/test/org/traccar/protocol/XexunProtocolDecoderTest.java @@ -4,12 +4,12 @@ import org.traccar.helper.TestDataManager; import static org.traccar.helper.DecoderVerifier.verify; import org.junit.Test; -public class XexunProtocolDecoderTest { +public class XexunProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - XexunProtocolDecoder decoder = new XexunProtocolDecoder(new TestDataManager(), null, null); + XexunProtocolDecoder decoder = new XexunProtocolDecoder(null); verify(decoder.decode(null, null, "GPRMC,043435.000,A,811.299200,S,11339.9500,E,0.93,29.52,160313,00,0000.0,A*65,F,,imei:359585014597923,")); diff --git a/test/org/traccar/protocol/XirgoProtocolDecoderTest.java b/test/org/traccar/protocol/XirgoProtocolDecoderTest.java index 81133104c..99e5f95ec 100644 --- a/test/org/traccar/protocol/XirgoProtocolDecoderTest.java +++ b/test/org/traccar/protocol/XirgoProtocolDecoderTest.java @@ -4,12 +4,12 @@ import org.traccar.helper.TestDataManager; import static org.traccar.helper.DecoderVerifier.verify; import org.junit.Test; -public class XirgoProtocolDecoderTest { +public class XirgoProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - XirgoProtocolDecoder decoder = new XirgoProtocolDecoder(new TestDataManager(), null, null); + XirgoProtocolDecoder decoder = new XirgoProtocolDecoder(null); verify(decoder.decode(null, null, null, "$$354898045650537,6031,2015/02/26,15:47:26,33.42552,-112.30308,287.8,0,0,0,0,0.0,7,1.2,2,0.0,12.2,22,1,0,82.3")); diff --git a/test/org/traccar/protocol/Xt013ProtocolDecoderTest.java b/test/org/traccar/protocol/Xt013ProtocolDecoderTest.java index 45d86b902..c7ef44607 100644 --- a/test/org/traccar/protocol/Xt013ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Xt013ProtocolDecoderTest.java @@ -5,12 +5,12 @@ import org.traccar.helper.TestDataManager; import static org.traccar.helper.DecoderVerifier.verify; -public class Xt013ProtocolDecoderTest { +public class Xt013ProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Xt013ProtocolDecoder decoder = new Xt013ProtocolDecoder(new TestDataManager(), null, null); + Xt013ProtocolDecoder decoder = new Xt013ProtocolDecoder(null); verify(decoder.decode(null, null, "TK,862950021650364,150131090859,+53.267863,+5.767363,0,38,12,0,F,204,08,C94,336C,24,,4.09,1,,,,,,,,")); diff --git a/test/org/traccar/protocol/Xt7ProtocolDecoderTest.java b/test/org/traccar/protocol/Xt7ProtocolDecoderTest.java index e786cd4da..b2be6fa48 100644 --- a/test/org/traccar/protocol/Xt7ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Xt7ProtocolDecoderTest.java @@ -8,12 +8,12 @@ import org.jboss.netty.buffer.HeapChannelBufferFactory; import static org.traccar.helper.DecoderVerifier.verify; import org.junit.Test; -public class Xt7ProtocolDecoderTest { +public class Xt7ProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - Xt7ProtocolDecoder decoder = new Xt7ProtocolDecoder(new TestDataManager(), null, null); + Xt7ProtocolDecoder decoder = new Xt7ProtocolDecoder(null); verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( "53545832303130313031383031202020202020026A244750524D432C3130313035332E3030302C412C323233322E373630372C4E2C31313430342E373636392C452C302E30302C2C3233313131302C2C2C412A37462C3436302C30302C323739352C304536412C31342C39342C313030302C303030302C39312C54696D65723B31440D0A")))); diff --git a/test/org/traccar/protocol/YwtProtocolDecoderTest.java b/test/org/traccar/protocol/YwtProtocolDecoderTest.java index 5d98530e3..30d8091a8 100644 --- a/test/org/traccar/protocol/YwtProtocolDecoderTest.java +++ b/test/org/traccar/protocol/YwtProtocolDecoderTest.java @@ -5,12 +5,12 @@ import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; -public class YwtProtocolDecoderTest { +public class YwtProtocolDecoderTest extends ProtocolDecoderTest { @Test public void testDecode() throws Exception { - YwtProtocolDecoder decoder = new YwtProtocolDecoder(new TestDataManager(), null, null); + YwtProtocolDecoder decoder = new YwtProtocolDecoder(null); assertNull(decoder.decode(null, null, "%SN,0417061042:0,0,140117041203,404")); |