diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-09-22 14:22:01 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-22 14:22:01 +1200 |
commit | a6fa965fd1d7fc55c891f9bba4913fcfe68b086c (patch) | |
tree | f840a542096c653d7dafc6df37645893d423d9d1 /test/org/traccar | |
parent | 76639c6b2284a5dfc4b45c17e533788dd739bcf1 (diff) | |
parent | 36ad4ac525b8eb25ac1c2eed8c05d690754399c5 (diff) | |
download | traccar-server-a6fa965fd1d7fc55c891f9bba4913fcfe68b086c.tar.gz traccar-server-a6fa965fd1d7fc55c891f9bba4913fcfe68b086c.tar.bz2 traccar-server-a6fa965fd1d7fc55c891f9bba4913fcfe68b086c.zip |
Merge pull request #3540 from Abyss777/check_valid_optional
Make check for valid in MotionEventHandler optional
Diffstat (limited to 'test/org/traccar')
-rw-r--r-- | test/org/traccar/events/MotionEventHandlerTest.java | 6 | ||||
-rw-r--r-- | test/org/traccar/reports/ReportUtilsTest.java | 42 |
2 files changed, 24 insertions, 24 deletions
diff --git a/test/org/traccar/events/MotionEventHandlerTest.java b/test/org/traccar/events/MotionEventHandlerTest.java index b88328e58..3fc63adf0 100644 --- a/test/org/traccar/events/MotionEventHandlerTest.java +++ b/test/org/traccar/events/MotionEventHandlerTest.java @@ -31,7 +31,7 @@ public class MotionEventHandlerTest extends BaseTest { @Test public void testMotionWithPosition() throws Exception { MotionEventHandler motionEventHandler = new MotionEventHandler( - new TripsConfig(500, 300 * 1000, 300 * 1000, 0, false)); + new TripsConfig(500, 300 * 1000, 300 * 1000, 0, false, false, 0.01)); Position position = new Position(); position.setTime(date("2017-01-01 00:00:00")); @@ -72,7 +72,7 @@ public class MotionEventHandlerTest extends BaseTest { @Test public void testMotionWithStatus() throws Exception { MotionEventHandler motionEventHandler = new MotionEventHandler( - new TripsConfig(500, 300 * 1000, 300 * 1000, 0, false)); + new TripsConfig(500, 300 * 1000, 300 * 1000, 0, false, false, 0.01)); Position position = new Position(); position.setTime(new Date(System.currentTimeMillis() - 360000)); @@ -93,7 +93,7 @@ public class MotionEventHandlerTest extends BaseTest { @Test public void testStopWithPositionIgnition() throws Exception { MotionEventHandler motionEventHandler = new MotionEventHandler( - new TripsConfig(500, 300 * 1000, 300 * 1000, 0, true)); + new TripsConfig(500, 300 * 1000, 300 * 1000, 0, true, false, 0.01)); Position position = new Position(); position.setTime(date("2017-01-01 00:00:00")); diff --git a/test/org/traccar/reports/ReportUtilsTest.java b/test/org/traccar/reports/ReportUtilsTest.java index 261291255..4f7a4eb68 100644 --- a/test/org/traccar/reports/ReportUtilsTest.java +++ b/test/org/traccar/reports/ReportUtilsTest.java @@ -80,9 +80,9 @@ public class ReportUtilsTest extends BaseTest { position("2016-01-01 00:06:00.000", 0, 3000), position("2016-01-01 00:07:00.000", 0, 3000)); - TripsConfig tripsConfig = new TripsConfig(500, 300000, 180000, 900000, false); + TripsConfig tripsConfig = new TripsConfig(500, 300000, 180000, 900000, false, false, 0.01); - Collection<TripReport> trips = ReportUtils.detectTripsAndStops(data, tripsConfig, false, 0.01, TripReport.class); + Collection<TripReport> trips = ReportUtils.detectTripsAndStops(data, tripsConfig, false, TripReport.class); assertNotNull(trips); assertFalse(trips.isEmpty()); @@ -96,7 +96,7 @@ public class ReportUtilsTest extends BaseTest { assertEquals(10, itemTrip.getMaxSpeed(), 0.01); assertEquals(3000, itemTrip.getDistance(), 0.01); - Collection<StopReport> stops = ReportUtils.detectTripsAndStops(data, tripsConfig, false, 0.01, StopReport.class); + Collection<StopReport> stops = ReportUtils.detectTripsAndStops(data, tripsConfig, false, StopReport.class); assertNotNull(stops); assertFalse(stops.isEmpty()); @@ -132,9 +132,9 @@ public class ReportUtilsTest extends BaseTest { data.get(5).set(Position.KEY_IGNITION, false); - TripsConfig tripsConfig = new TripsConfig(500, 300000, 180000, 900000, true); + TripsConfig tripsConfig = new TripsConfig(500, 300000, 180000, 900000, true, false, 0.01); - Collection<TripReport> trips = ReportUtils.detectTripsAndStops(data, tripsConfig, false, 0.01, TripReport.class); + Collection<TripReport> trips = ReportUtils.detectTripsAndStops(data, tripsConfig, false, TripReport.class); assertNotNull(trips); assertFalse(trips.isEmpty()); @@ -148,7 +148,7 @@ public class ReportUtilsTest extends BaseTest { assertEquals(10, itemTrip.getMaxSpeed(), 0.01); assertEquals(3000, itemTrip.getDistance(), 0.01); - trips = ReportUtils.detectTripsAndStops(data, tripsConfig, false, 0.01, TripReport.class); + trips = ReportUtils.detectTripsAndStops(data, tripsConfig, false, TripReport.class); assertNotNull(trips); assertFalse(trips.isEmpty()); @@ -162,7 +162,7 @@ public class ReportUtilsTest extends BaseTest { assertEquals(10, itemTrip.getMaxSpeed(), 0.01); assertEquals(3000, itemTrip.getDistance(), 0.01); - Collection<StopReport> stops = ReportUtils.detectTripsAndStops(data, tripsConfig, false, 0.01, StopReport.class); + Collection<StopReport> stops = ReportUtils.detectTripsAndStops(data, tripsConfig, false, StopReport.class); assertNotNull(stops); assertFalse(stops.isEmpty()); @@ -200,9 +200,9 @@ public class ReportUtilsTest extends BaseTest { position("2016-01-01 00:10:00.000", 0, 7000), position("2016-01-01 00:11:00.000", 0, 7000)); - TripsConfig tripsConfig = new TripsConfig(500, 300000, 180000, 900000, false); + TripsConfig tripsConfig = new TripsConfig(500, 300000, 180000, 900000, false, false, 0.01); - Collection<TripReport> trips = ReportUtils.detectTripsAndStops(data, tripsConfig, false, 0.01, TripReport.class); + Collection<TripReport> trips = ReportUtils.detectTripsAndStops(data, tripsConfig, false, TripReport.class); assertNotNull(trips); assertFalse(trips.isEmpty()); @@ -216,7 +216,7 @@ public class ReportUtilsTest extends BaseTest { assertEquals(10, itemTrip.getMaxSpeed(), 0.01); assertEquals(7000, itemTrip.getDistance(), 0.01); - Collection<StopReport> stops = ReportUtils.detectTripsAndStops(data, tripsConfig, false, 0.01, StopReport.class); + Collection<StopReport> stops = ReportUtils.detectTripsAndStops(data, tripsConfig, false, StopReport.class); assertNotNull(stops); assertFalse(stops.isEmpty()); @@ -248,9 +248,9 @@ public class ReportUtilsTest extends BaseTest { position("2016-01-01 00:04:00.000", 1, 0), position("2016-01-01 00:05:00.000", 0, 0)); - TripsConfig tripsConfig = new TripsConfig(500, 300000, 200000, 900000, false); + TripsConfig tripsConfig = new TripsConfig(500, 300000, 200000, 900000, false, false, 0.01); - Collection<StopReport> result = ReportUtils.detectTripsAndStops(data, tripsConfig, false, 0.01, StopReport.class); + Collection<StopReport> result = ReportUtils.detectTripsAndStops(data, tripsConfig, false, StopReport.class); assertNotNull(result); assertFalse(result.isEmpty()); @@ -274,9 +274,9 @@ public class ReportUtilsTest extends BaseTest { position("2016-01-01 00:04:00.000", 1, 0), position("2016-01-01 00:05:00.000", 2, 0)); - TripsConfig tripsConfig = new TripsConfig(500, 300000, 200000, 900000, false); + TripsConfig tripsConfig = new TripsConfig(500, 300000, 200000, 900000, false, false, 0.01); - Collection<StopReport> result = ReportUtils.detectTripsAndStops(data, tripsConfig, false, 0.01, StopReport.class); + Collection<StopReport> result = ReportUtils.detectTripsAndStops(data, tripsConfig, false, StopReport.class); assertNotNull(result); assertFalse(result.isEmpty()); @@ -300,9 +300,9 @@ public class ReportUtilsTest extends BaseTest { position("2016-01-01 00:04:00.000", 0, 0), position("2016-01-01 00:05:00.000", 0, 0)); - TripsConfig tripsConfig = new TripsConfig(500, 300000, 200000, 900000, false); + TripsConfig tripsConfig = new TripsConfig(500, 300000, 200000, 900000, false, false, 0.01); - Collection<StopReport> result = ReportUtils.detectTripsAndStops(data, tripsConfig, false, 0.01, StopReport.class); + Collection<StopReport> result = ReportUtils.detectTripsAndStops(data, tripsConfig, false, StopReport.class); assertNotNull(result); assertFalse(result.isEmpty()); @@ -326,9 +326,9 @@ public class ReportUtilsTest extends BaseTest { position("2016-01-01 00:04:00.000", 5, 0), position("2016-01-01 00:05:00.000", 5, 0)); - TripsConfig tripsConfig = new TripsConfig(500, 300000, 200000, 900000, false); + TripsConfig tripsConfig = new TripsConfig(500, 300000, 200000, 900000, false, false, 0.01); - Collection<StopReport> result = ReportUtils.detectTripsAndStops(data, tripsConfig, false, 0.01, StopReport.class); + Collection<StopReport> result = ReportUtils.detectTripsAndStops(data, tripsConfig, false, StopReport.class); assertNotNull(result); assertTrue(result.isEmpty()); @@ -348,9 +348,9 @@ public class ReportUtilsTest extends BaseTest { position("2016-01-01 00:24:00.000", 5, 800), position("2016-01-01 00:25:00.000", 5, 900)); - TripsConfig tripsConfig = new TripsConfig(500, 200000, 200000, 900000, false); + TripsConfig tripsConfig = new TripsConfig(500, 200000, 200000, 900000, false, false, 0.01); - Collection<TripReport> trips = ReportUtils.detectTripsAndStops(data, tripsConfig, false, 0.01, TripReport.class); + Collection<TripReport> trips = ReportUtils.detectTripsAndStops(data, tripsConfig, false, TripReport.class); assertNotNull(trips); assertFalse(trips.isEmpty()); @@ -364,7 +364,7 @@ public class ReportUtilsTest extends BaseTest { assertEquals(7, itemTrip.getMaxSpeed(), 0.01); assertEquals(600, itemTrip.getDistance(), 0.01); - Collection<StopReport> stops = ReportUtils.detectTripsAndStops(data, tripsConfig, false, 0.01, StopReport.class); + Collection<StopReport> stops = ReportUtils.detectTripsAndStops(data, tripsConfig, false, StopReport.class); assertNotNull(stops); assertFalse(stops.isEmpty()); |