Changeset 17838 in josm
- Timestamp:
- 2021-05-01T11:39:00+02:00 (4 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmChangeTask.java
r17749 r17838 6 6 import java.time.Instant; 7 7 import java.util.Arrays; 8 import java.util.Date;9 8 import java.util.HashMap; 10 9 import java.util.Iterator; … … 160 159 if (history != null && date != null) { 161 160 // Lookup for the primitive version at the specified timestamp 162 HistoryOsmPrimitive hp = history.getByDate( Date.from(date));161 HistoryOsmPrimitive hp = history.getByDate(date); 163 162 if (hp != null) { 164 163 PrimitiveData data; -
trunk/src/org/openstreetmap/josm/data/osm/history/History.java
r17333 r17838 3 3 4 4 import java.text.MessageFormat; 5 import java.time.Instant; 5 6 import java.util.ArrayList; 6 7 import java.util.Comparator; 7 import java.util.Date;8 8 import java.util.List; 9 9 import java.util.stream.Collectors; … … 86 86 * @return a new partial copy of this history, from the given date 87 87 */ 88 public History from(final DatefromDate) {89 return filter(this, primitive -> primitive.get Timestamp().compareTo(fromDate) >= 0);88 public History from(final Instant fromDate) { 89 return filter(this, primitive -> primitive.getInstant().compareTo(fromDate) >= 0); 90 90 } 91 91 … … 95 95 * @return a new partial copy of this history, until the given date 96 96 */ 97 public History until(final DateuntilDate) {98 return filter(this, primitive -> primitive.get Timestamp().compareTo(untilDate) <= 0);97 public History until(final Instant untilDate) { 98 return filter(this, primitive -> primitive.getInstant().compareTo(untilDate) <= 0); 99 99 } 100 100 … … 105 105 * @return a new partial copy of this history, between the given dates 106 106 */ 107 public History between( DatefromDate,DateuntilDate) {107 public History between(Instant fromDate, Instant untilDate) { 108 108 return this.from(fromDate).until(untilDate); 109 109 } … … 196 196 * @return the history primitive at given <code>date</code> 197 197 */ 198 public HistoryOsmPrimitive getByDate( Datedate) {198 public HistoryOsmPrimitive getByDate(Instant date) { 199 199 History h = sortAscending(); 200 200 201 201 if (h.versions.isEmpty()) 202 202 return null; 203 if (h.get(0).get Timestamp().compareTo(date) > 0)203 if (h.get(0).getInstant().compareTo(date) > 0) 204 204 return null; 205 205 for (int i = 1; i < h.versions.size(); i++) { 206 if (h.get(i-1).get Timestamp().compareTo(date) <= 0207 && h.get(i).get Timestamp().compareTo(date) >= 0)206 if (h.get(i-1).getInstant().compareTo(date) <= 0 207 && h.get(i).getInstant().compareTo(date) >= 0) 208 208 return h.get(i); 209 209 } -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryNode.java
r11878 r17838 2 2 package org.openstreetmap.josm.data.osm.history; 3 3 4 import java. util.Date;4 import java.time.Instant; 5 5 6 6 import org.openstreetmap.josm.data.coor.LatLon; … … 31 31 * @throws IllegalArgumentException if preconditions are violated 32 32 */ 33 public HistoryNode(long id, long version, boolean visible, User user, long changesetId, Datetimestamp, LatLon coords) {33 public HistoryNode(long id, long version, boolean visible, User user, long changesetId, Instant timestamp, LatLon coords) { 34 34 this(id, version, visible, user, changesetId, timestamp, coords, true); 35 35 } … … 50 50 * @since 5440 51 51 */ 52 public HistoryNode(long id, long version, boolean visible, User user, long changesetId, Datetimestamp, LatLon coords,52 public HistoryNode(long id, long version, boolean visible, User user, long changesetId, Instant timestamp, LatLon coords, 53 53 boolean checkHistoricParams) { 54 54 super(id, version, visible, user, changesetId, timestamp, checkHistoricParams); -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryOsmPrimitive.java
r17749 r17838 5 5 6 6 import java.text.MessageFormat; 7 import java.time.Instant; 7 8 import java.util.Collection; 8 9 import java.util.Collections; … … 25 26 import org.openstreetmap.josm.tools.CheckParameterUtil; 26 27 import org.openstreetmap.josm.tools.Logging; 27 import org.openstreetmap.josm.tools.date.DateUtils;28 28 29 29 /** … … 38 38 private final long changesetId; 39 39 private Changeset changeset; 40 private final Datetimestamp;40 private final Instant timestamp; 41 41 private final long version; 42 42 private Map<String, String> tags; … … 54 54 * @throws IllegalArgumentException if preconditions are violated 55 55 */ 56 protected HistoryOsmPrimitive(long id, long version, boolean visible, User user, long changesetId, Datetimestamp) {56 protected HistoryOsmPrimitive(long id, long version, boolean visible, User user, long changesetId, Instant timestamp) { 57 57 this(id, version, visible, user, changesetId, timestamp, true); 58 58 } … … 73 73 * @since 5440 74 74 */ 75 protected HistoryOsmPrimitive(long id, long version, boolean visible, User user, long changesetId, Datetimestamp,75 protected HistoryOsmPrimitive(long id, long version, boolean visible, User user, long changesetId, Instant timestamp, 76 76 boolean checkHistoricParams) { 77 77 ensurePositiveLong(id, "id"); … … 87 87 this.user = user; 88 88 this.changesetId = changesetId; 89 this.timestamp = DateUtils.cloneDate(timestamp);89 this.timestamp = timestamp; 90 90 this.tags = new HashMap<>(); 91 91 } … … 96 96 */ 97 97 protected HistoryOsmPrimitive(OsmPrimitive p) { 98 this(p.getId(), p.getVersion(), p.isVisible(), p.getUser(), p.getChangesetId(), Date.from(p.getInstant()));98 this(p.getId(), p.getVersion(), p.isVisible(), p.getUser(), p.getChangesetId(), p.getInstant()); 99 99 } 100 100 … … 159 159 * Returns the timestamp. 160 160 * @return the timestamp 161 */ 161 * @deprecated Use {@link #getInstant()} 162 */ 163 @Deprecated 162 164 public Date getTimestamp() { 163 return DateUtils.cloneDate(timestamp); 165 return Date.from(timestamp); 166 } 167 168 /** 169 * Returns the timestamp. 170 * @return the timestamp 171 */ 172 public Instant getInstant() { 173 return timestamp; 164 174 } 165 175 … … 364 374 Logging.log(Logging.LEVEL_ERROR, "Cannot change visibility for "+data+':', e); 365 375 } 366 data.setInstant(timestamp .toInstant());376 data.setInstant(timestamp); 367 377 data.setKeys(tags); 368 378 data.setOsmId(id, (int) version); -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryRelation.java
r11878 r17838 3 3 4 4 import java.text.MessageFormat; 5 import java.time.Instant; 5 6 import java.util.ArrayList; 6 7 import java.util.Collections; 7 import java.util.Date;8 8 import java.util.List; 9 9 … … 35 35 * @throws IllegalArgumentException if preconditions are violated 36 36 */ 37 public HistoryRelation(long id, long version, boolean visible, User user, long changesetId, Datetimestamp) {37 public HistoryRelation(long id, long version, boolean visible, User user, long changesetId, Instant timestamp) { 38 38 super(id, version, visible, user, changesetId, timestamp); 39 39 } … … 53 53 * @since 5440 54 54 */ 55 public HistoryRelation(long id, long version, boolean visible, User user, long changesetId, Datetimestamp, boolean checkHistoricParams) {55 public HistoryRelation(long id, long version, boolean visible, User user, long changesetId, Instant timestamp, boolean checkHistoricParams) { 56 56 super(id, version, visible, user, changesetId, timestamp, checkHistoricParams); 57 57 } … … 70 70 * @throws IllegalArgumentException if preconditions are violated 71 71 */ 72 public HistoryRelation(long id, long version, boolean visible, User user, long changesetId, Datetimestamp,72 public HistoryRelation(long id, long version, boolean visible, User user, long changesetId, Instant timestamp, 73 73 List<RelationMemberData> members) { 74 74 this(id, version, visible, user, changesetId, timestamp); -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryWay.java
r15121 r17838 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.time.Instant; 6 7 import java.util.ArrayList; 7 8 import java.util.Collections; 8 import java.util.Date;9 9 import java.util.List; 10 10 import java.util.Objects; … … 35 35 * @throws IllegalArgumentException if preconditions are violated 36 36 */ 37 public HistoryWay(long id, long version, boolean visible, User user, long changesetId, Datetimestamp) {37 public HistoryWay(long id, long version, boolean visible, User user, long changesetId, Instant timestamp) { 38 38 super(id, version, visible, user, changesetId, timestamp); 39 39 } … … 53 53 * @since 5440 54 54 */ 55 public HistoryWay(long id, long version, boolean visible, User user, long changesetId, Datetimestamp, boolean checkHistoricParams) {55 public HistoryWay(long id, long version, boolean visible, User user, long changesetId, Instant timestamp, boolean checkHistoricParams) { 56 56 super(id, version, visible, user, changesetId, timestamp, checkHistoricParams); 57 57 } … … 69 69 * @throws IllegalArgumentException if preconditions are violated 70 70 */ 71 public HistoryWay(long id, long version, boolean visible, User user, long changesetId, Datetimestamp, List<Long> nodeIdList) {71 public HistoryWay(long id, long version, boolean visible, User user, long changesetId, Instant timestamp, List<Long> nodeIdList) { 72 72 this(id, version, visible, user, changesetId, timestamp); 73 73 CheckParameterUtil.ensureParameterNotNull(nodeIdList, "nodeIdList"); -
trunk/src/org/openstreetmap/josm/gui/history/VersionInfoPanel.java
r17749 r17838 11 11 import java.awt.Insets; 12 12 import java.awt.event.ActionEvent; 13 import java.text.DateFormat; 13 import java.time.Instant; 14 import java.time.format.FormatStyle; 14 15 import java.util.Collections; 15 import java.util.Date;16 16 17 17 import javax.swing.AbstractAction; … … 170 170 } 171 171 172 protected String getInfoText(final Datetimestamp, final long version, final boolean isLatest) {172 protected String getInfoText(final Instant timestamp, final long version, final boolean isLatest) { 173 173 String text; 174 174 if (isLatest) { … … 181 181 String date = "?"; 182 182 if (timestamp != null) { 183 date = DateUtils. formatDateTime(timestamp, DateFormat.SHORT, DateFormat.SHORT);183 date = DateUtils.getDateTimeFormatter(FormatStyle.SHORT, FormatStyle.SHORT).format(timestamp); 184 184 } 185 185 text = tr( … … 226 226 if (primitive != null) { 227 227 Changeset cs = primitive.getChangeset(); 228 update(cs, model.isLatest(primitive), primitive.get Timestamp(), primitive.getVersion(), primitive.getPrimitiveId());228 update(cs, model.isLatest(primitive), primitive.getInstant(), primitive.getVersion(), primitive.getPrimitiveId()); 229 229 } 230 230 } … … 236 236 */ 237 237 public void update(final OsmPrimitive primitive, final boolean isLatest) { 238 Date timestamp = Date.from(primitive.getInstant()); 239 update(Changeset.fromPrimitive(primitive), isLatest, timestamp, primitive.getVersion(), primitive.getPrimitiveId()); 238 update(Changeset.fromPrimitive(primitive), isLatest, primitive.getInstant(), primitive.getVersion(), primitive.getPrimitiveId()); 240 239 } 241 240 … … 249 248 * @since 14432 250 249 */ 251 public void update(final Changeset cs, final boolean isLatest, final Datetimestamp, final long version, final PrimitiveId id) {250 public void update(final Changeset cs, final boolean isLatest, final Instant timestamp, final long version, final PrimitiveId id) { 252 251 lblInfo.setText(getInfoText(timestamp, version, isLatest)); 253 252 primitiveId = id; -
trunk/src/org/openstreetmap/josm/gui/history/VersionTableModel.java
r12620 r17838 2 2 package org.openstreetmap.josm.gui.history; 3 3 4 import java.t ext.DateFormat;4 import java.time.format.FormatStyle; 5 5 6 6 import javax.swing.table.AbstractTableModel; … … 53 53 case VersionTableColumnModel.COL_DATE: 54 54 HistoryOsmPrimitive p3 = model.getPrimitive(row); 55 if (p3 != null && p3.get Timestamp() != null)56 return DateUtils. formatDateTime(p3.getTimestamp(), DateFormat.SHORT,DateFormat.SHORT);55 if (p3 != null && p3.getInstant() != null) 56 return DateUtils.getDateTimeFormatter(FormatStyle.SHORT, FormatStyle.SHORT).format(p3.getInstant()); 57 57 return null; 58 58 case VersionTableColumnModel.COL_USER: -
trunk/src/org/openstreetmap/josm/io/AbstractParser.java
r14946 r17838 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java. util.Date;6 import java.time.Instant; 7 7 8 8 import org.openstreetmap.josm.data.coor.LatLon; … … 132 132 133 133 String v = getMandatoryAttributeString(atts, "timestamp"); 134 Datetimestamp = DateUtils.fromString(v);134 Instant timestamp = DateUtils.parseInstant(v); 135 135 HistoryOsmPrimitive primitive = null; 136 136 if (type == OsmPrimitiveType.NODE) { -
trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetDataSetTest.java
r17275 r17838 7 7 import static org.junit.jupiter.api.Assertions.fail; 8 8 9 import java. util.Date;9 import java.time.Instant; 10 10 import java.util.Iterator; 11 11 … … 40 40 void testIterator() { 41 41 final ChangesetDataSet cds = new ChangesetDataSet(); 42 HistoryNode prim1 = new HistoryNode(1, 1, true, User.getAnonymous(), 1, new Date(), LatLon.ZERO);42 HistoryNode prim1 = new HistoryNode(1, 1, true, User.getAnonymous(), 1, Instant.now(), LatLon.ZERO); 43 43 cds.put(prim1, ChangesetModificationType.CREATED); 44 44 Iterator<ChangesetDataSetEntry> it = cds.iterator(); … … 62 62 void testGetEntry() { 63 63 final ChangesetDataSet cds = new ChangesetDataSet(); 64 HistoryNode prim1 = new HistoryNode(1, 1, true, User.getAnonymous(), 1, new Date(), LatLon.ZERO);64 HistoryNode prim1 = new HistoryNode(1, 1, true, User.getAnonymous(), 1, Instant.now(), LatLon.ZERO); 65 65 cds.put(prim1, ChangesetModificationType.CREATED); 66 HistoryNode prim2 = new HistoryNode(1, 2, true, User.getAnonymous(), 1, new Date(), LatLon.ZERO);66 HistoryNode prim2 = new HistoryNode(1, 2, true, User.getAnonymous(), 1, Instant.now(), LatLon.ZERO); 67 67 prim2.put("highway", "stop"); 68 68 cds.put(prim2, ChangesetModificationType.UPDATED); 69 69 assertEquals(prim1, cds.getFirstEntry(prim1.getPrimitiveId()).getPrimitive()); 70 70 assertEquals(prim2, cds.getLastEntry(prim1.getPrimitiveId()).getPrimitive()); 71 HistoryNode prim3 = new HistoryNode(1, 3, false, User.getAnonymous(), 1, new Date(), null);71 HistoryNode prim3 = new HistoryNode(1, 3, false, User.getAnonymous(), 1, Instant.now(), null); 72 72 73 73 cds.put(prim3, ChangesetModificationType.DELETED); -
trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryNodeTest.java
r17275 r17838 5 5 import static org.junit.jupiter.api.Assertions.assertTrue; 6 6 7 import java. util.Date;7 import java.time.Instant; 8 8 import java.util.HashMap; 9 9 import java.util.Map; … … 32 32 public JOSMTestRules test = new JOSMTestRules(); 33 33 34 private static HistoryNode create( Dated) {34 private static HistoryNode create(Instant d) { 35 35 return new HistoryNode( 36 36 1L, // id … … 49 49 @Test 50 50 void testHistoryNode() { 51 Date d = new Date();51 Instant d = Instant.now(); 52 52 HistoryNode node = create(d); 53 53 … … 58 58 assertEquals(3, node.getUser().getId()); 59 59 assertEquals(4, node.getChangesetId()); 60 assertEquals(d, node.get Timestamp());60 assertEquals(d, node.getInstant()); 61 61 } 62 62 … … 66 66 @Test 67 67 void testGetType() { 68 assertEquals(OsmPrimitiveType.NODE, create( new Date()).getType());68 assertEquals(OsmPrimitiveType.NODE, create(Instant.now()).getType()); 69 69 } 70 70 … … 86 86 @Test 87 87 void testGetDisplayName() { 88 HistoryNode node = create( new Date());88 HistoryNode node = create(Instant.now()); 89 89 HistoryNameFormatter hnf = DefaultNameFormatter.getInstance(); 90 90 assertEquals("1 (0.0, 0.0)", node.getDisplayName(hnf)); -
trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryRelationTest.java
r17275 r17838 5 5 import static org.junit.jupiter.api.Assertions.assertTrue; 6 6 7 import java. util.Date;7 import java.time.Instant; 8 8 import java.util.HashMap; 9 9 import java.util.Map; … … 31 31 public JOSMTestRules test = new JOSMTestRules(); 32 32 33 private static HistoryRelation create( Dated) {33 private static HistoryRelation create(Instant d) { 34 34 return new HistoryRelation( 35 35 1, // id … … 47 47 @Test 48 48 void testHistoryRelation() { 49 Date d = new Date();49 Instant d = Instant.now(); 50 50 HistoryRelation rel = create(d); 51 51 … … 56 56 assertEquals(3, rel.getUser().getId()); 57 57 assertEquals(4, rel.getChangesetId()); 58 assertEquals(d, rel.get Timestamp());58 assertEquals(d, rel.getInstant()); 59 59 } 60 60 … … 64 64 @Test 65 65 void testGetType() { 66 assertEquals(OsmPrimitiveType.RELATION, create( new Date()).getType());66 assertEquals(OsmPrimitiveType.RELATION, create(Instant.now()).getType()); 67 67 } 68 68 … … 73 73 void testGetDisplayName() { 74 74 HistoryNameFormatter hnf = DefaultNameFormatter.getInstance(); 75 HistoryRelation rel0 = create( new Date()); // 0 member76 HistoryRelation rel1 = create( new Date()); // 1 member77 HistoryRelation rel2 = create( new Date()); // 2 members75 HistoryRelation rel0 = create(Instant.now()); // 0 member 76 HistoryRelation rel1 = create(Instant.now()); // 1 member 77 HistoryRelation rel2 = create(Instant.now()); // 2 members 78 78 79 79 rel1.addMember(new RelationMemberData(null, OsmPrimitiveType.NODE, 1)); -
trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryWayTest.java
r17275 r17838 6 6 import static org.junit.jupiter.api.Assertions.fail; 7 7 8 import java. util.Date;8 import java.time.Instant; 9 9 import java.util.HashMap; 10 10 import java.util.List; … … 33 33 public JOSMTestRules test = new JOSMTestRules(); 34 34 35 private static HistoryWay create( Dated) {35 private static HistoryWay create(Instant d) { 36 36 return new HistoryWay( 37 37 1, // id … … 49 49 @Test 50 50 void testHistoryWay() { 51 Date d = new Date();51 Instant d = Instant.now(); 52 52 HistoryWay way = create(d); 53 53 … … 58 58 assertEquals(3, way.getUser().getId()); 59 59 assertEquals(4, way.getChangesetId()); 60 assertEquals(d, way.get Timestamp());60 assertEquals(d, way.getInstant()); 61 61 62 62 assertEquals(0, way.getNumNodes()); … … 68 68 @Test 69 69 void testGetType() { 70 assertEquals(OsmPrimitiveType.WAY, create( new Date()).getType());70 assertEquals(OsmPrimitiveType.WAY, create(Instant.now()).getType()); 71 71 } 72 72 73 73 @Test 74 74 void testNodeManipulation() { 75 HistoryWay way = create( new Date());75 HistoryWay way = create(Instant.now()); 76 76 77 77 way.addNode(1); … … 93 93 @Test 94 94 void testIterating() { 95 HistoryWay way = create( new Date());95 HistoryWay way = create(Instant.now()); 96 96 97 97 way.addNode(1); … … 110 110 void testGetDisplayName() { 111 111 HistoryNameFormatter hnf = DefaultNameFormatter.getInstance(); 112 HistoryWay way0 = create( new Date()); // no node113 HistoryWay way1 = create( new Date()); // 1 node114 HistoryWay way2 = create( new Date()); // 2 nodes112 HistoryWay way0 = create(Instant.now()); // no node 113 HistoryWay way1 = create(Instant.now()); // 1 node 114 HistoryWay way2 = create(Instant.now()); // 2 nodes 115 115 116 116 way1.addNode(1); -
trunk/test/unit/org/openstreetmap/josm/gui/history/HistoryBrowserDialogTest.java
r17275 r17838 4 4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 5 6 import java. util.Date;6 import java.time.Instant; 7 7 8 8 import org.junit.jupiter.api.extension.RegisterExtension; … … 15 15 import org.openstreetmap.josm.data.osm.history.HistoryWay; 16 16 import org.openstreetmap.josm.testutils.JOSMTestRules; 17 import org.openstreetmap.josm.tools.date.DateUtils;18 17 19 18 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; … … 38 37 HistoryDataSet hds = new HistoryDataSet(); 39 38 User user = User.createOsmUser(1, ""); 40 Datedate =DateUtils.fromString("2016-01-01");39 Instant date = Instant.parse("2016-01-01T00:00:00Z"); 41 40 hds.put(new HistoryNode(1, 1, true, user, 1, date, null)); 42 41 assertEquals("History for node 1", HistoryBrowserDialog.buildTitle(hds.getHistory(1, OsmPrimitiveType.NODE))); -
trunk/test/unit/org/openstreetmap/josm/io/OsmChangesetContentParserTest.java
r17275 r17838 116 116 assertEquals(1, p.getVersion()); 117 117 assertEquals(1, p.getChangesetId()); 118 assertNotNull(p.get Timestamp());118 assertNotNull(p.getInstant()); 119 119 assertEquals(ChangesetModificationType.CREATED, ds.getModificationType(p.getPrimitiveId())); 120 120 assertTrue(ds.isCreated(p.getPrimitiveId())); … … 146 146 assertEquals(1, p.getVersion()); 147 147 assertEquals(1, p.getChangesetId()); 148 assertNotNull(p.get Timestamp());148 assertNotNull(p.getInstant()); 149 149 assertEquals(ChangesetModificationType.UPDATED, ds.getModificationType(p.getPrimitiveId())); 150 150 assertTrue(ds.isUpdated(p.getPrimitiveId())); … … 176 176 assertEquals(1, p.getVersion()); 177 177 assertEquals(1, p.getChangesetId()); 178 assertNotNull(p.get Timestamp());178 assertNotNull(p.getInstant()); 179 179 assertEquals(ChangesetModificationType.DELETED, ds.getModificationType(p.getPrimitiveId())); 180 180 assertTrue(ds.isDeleted(p.getPrimitiveId())); … … 218 218 assertEquals(1, p.getVersion()); 219 219 assertEquals(1, p.getChangesetId()); 220 assertNotNull(p.get Timestamp());220 assertNotNull(p.getInstant()); 221 221 assertEquals(ChangesetModificationType.CREATED, ds.getModificationType(p.getPrimitiveId())); 222 222 assertTrue(ds.isCreated(p.getPrimitiveId())); … … 228 228 assertEquals(2, w.getVersion()); 229 229 assertEquals(1, w.getChangesetId()); 230 assertNotNull(w.get Timestamp());230 assertNotNull(w.getInstant()); 231 231 assertEquals(ChangesetModificationType.UPDATED, ds.getModificationType(w.getPrimitiveId())); 232 232 assertTrue(ds.isUpdated(w.getPrimitiveId())); … … 239 239 assertEquals(3, r.getVersion()); 240 240 assertEquals(1, r.getChangesetId()); 241 assertNotNull(r.get Timestamp());241 assertNotNull(r.getInstant()); 242 242 assertEquals(ChangesetModificationType.DELETED, ds.getModificationType(r.getPrimitiveId())); 243 243 assertTrue(ds.isDeleted(r.getPrimitiveId())); -
trunk/test/unit/org/openstreetmap/josm/io/OsmServerHistoryReaderTest.java
r17194 r17838 17 17 18 18 import com.github.tomakehurst.wiremock.junit.WireMockRule; 19 20 import java.time.Instant; 19 21 20 22 /** … … 50 52 assertEquals(1, h.getLatest().getNumKeys()); 51 53 assertEquals(65565982, h.getLatest().getChangesetId()); 52 assertEquals(1545089885000L, h.getLatest().get Timestamp().getTime());54 assertEquals(Instant.ofEpochMilli(1545089885000L), h.getLatest().getInstant()); 53 55 } 54 56 … … 65 67 assertEquals(10, h.getLatest().getNumKeys()); 66 68 assertEquals(26368284, h.getLatest().getChangesetId()); 67 assertEquals(1414429134000L, h.getLatest().get Timestamp().getTime());69 assertEquals(Instant.ofEpochMilli(1414429134000L), h.getLatest().getInstant()); 68 70 } 69 71 … … 80 82 assertEquals(0, h.getLatest().getNumKeys()); 81 83 assertEquals(486501, h.getLatest().getChangesetId()); 82 assertEquals(1194886166000L, h.getLatest().get Timestamp().getTime());84 assertEquals(Instant.ofEpochMilli(1194886166000L), h.getLatest().getInstant()); 83 85 } 84 86 }
Note:
See TracChangeset
for help on using the changeset viewer.