source: josm/trunk/test/functional/org/openstreetmap/josm/io/OsmServerHistoryReaderTest.java@ 2578

Last change on this file since 2578 was 2448, checked in by Gubaer, 14 years ago

fixed #3352: History doesn't get invalidated on upload?
fixed #3912: Extend history dialog to contain the currently modified version
new: zoom to node in list of nodes in history dialog (popup menu)
new: load history of node from node list in history dialog (popup menu or double click)
fixed: close all history dialogs when the number of layers drop to 0
fixed: implemented equals() and hashCode() on SimplePrimitiveId
fixed: history features now usePrimitiveId instead of long.

File size: 1.8 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.io;
3
4import org.junit.BeforeClass;
5import org.junit.Test;
6import org.openstreetmap.josm.Main;
7import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
8import org.openstreetmap.josm.data.osm.history.History;
9import org.openstreetmap.josm.data.osm.history.HistoryDataSet;
10import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
11
12public class OsmServerHistoryReaderTest {
13
14 @BeforeClass
15 public static void init() {
16 System.setProperty("josm.home", "C:\\data\\projekte\\osm\\tag-editor-plugin");
17 Main.pref.init(false);
18 }
19
20 @Test
21 public void test1() throws OsmTransferException {
22 OsmServerHistoryReader reader = new OsmServerHistoryReader(OsmPrimitiveType.NODE,266187);
23 HistoryDataSet ds = reader.parseHistory(NullProgressMonitor.INSTANCE);
24 History h = ds.getHistory(266187, OsmPrimitiveType.NODE);
25 System.out.println("num versions: " + h.getNumVersions());
26 }
27
28 @Test
29 public void test2() throws OsmTransferException {
30 OsmServerHistoryReader reader = new OsmServerHistoryReader(OsmPrimitiveType.WAY,32916);
31 HistoryDataSet ds = reader.parseHistory(NullProgressMonitor.INSTANCE);
32 History h = ds.getHistory(32916, OsmPrimitiveType.WAY);
33 System.out.println("num versions: " + h.getNumVersions());
34 }
35
36 @Test
37 public void test3() throws OsmTransferException {
38 OsmServerHistoryReader reader = new OsmServerHistoryReader(OsmPrimitiveType.RELATION,49);
39 HistoryDataSet ds = reader.parseHistory(NullProgressMonitor.INSTANCE);
40 History h = ds.getHistory(49, OsmPrimitiveType.RELATION);
41 System.out.println("num versions: " + h.getNumVersions());
42 }
43}
Note: See TracBrowser for help on using the repository browser.