diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-05-22 14:12:43 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-05-22 14:12:43 +1200 |
commit | 62ce76e8287a3211734234d8b6c5de2ae035ff79 (patch) | |
tree | dedaed96aa83ec358df03f405d57c2fb02737796 /src/org | |
parent | c6ce35720e315b0c28a52ef11ada67bf00642270 (diff) | |
download | trackermap-server-62ce76e8287a3211734234d8b6c5de2ae035ff79.tar.gz trackermap-server-62ce76e8287a3211734234d8b6c5de2ae035ff79.tar.bz2 trackermap-server-62ce76e8287a3211734234d8b6c5de2ae035ff79.zip |
Add more mock positions
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/database/DataManager.java | 19 |
1 files changed, 18 insertions, 1 deletions
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); } } } |