From 62ce76e8287a3211734234d8b6c5de2ae035ff79 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 22 May 2015 14:12:43 +1200 Subject: Add more mock positions --- src/org/traccar/database/DataManager.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/org/traccar/database') diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java index 4c65a3995..c32f0b017 100644 --- a/src/org/traccar/database/DataManager.java +++ b/src/org/traccar/database/DataManager.java @@ -25,12 +25,14 @@ import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; +import java.text.ParseException; import java.util.*; import javax.sql.DataSource; import org.traccar.Context; import org.traccar.helper.DriverDelegate; import org.traccar.helper.Log; +import org.traccar.http.JsonConverter; import org.traccar.model.Device; import org.traccar.model.Permission; import org.traccar.model.Position; @@ -321,11 +323,26 @@ public class DataManager { Position position = new Position(); position.setDeviceId(device.getId()); - position.setTime(new Date()); + + position.setTime(JsonConverter.parseDate("2015-05-22T12:00:01")); + position.setLatitude(-36.8785803); + position.setLongitude(174.7281713); + addPosition(position); + + position.setTime(JsonConverter.parseDate("2015-05-22T12:00:02")); + position.setLatitude(-36.8870932); + position.setLongitude(174.7473116); + addPosition(position); + + position.setTime(JsonConverter.parseDate("2015-05-22T12:00:03")); + position.setLatitude(-36.8932371); + position.setLongitude(174.7743053); addPosition(position); } catch (SQLException error) { Log.warning(error); + } catch (ParseException error) { + Log.warning(error); } } } -- cgit v1.2.3