Changeset 7079 in josm for trunk/test
- Timestamp:
- 2014-05-08T15:15:11+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/functional/org/openstreetmap/josm/io/OsmServerHistoryReaderTest.java
r7040 r7079 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.io; 3 4 import static org.junit.Assert.assertTrue; 3 5 4 6 import org.junit.BeforeClass; … … 10 12 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 11 13 14 /** 15 * History fetching tests. This test operates with production API. 16 */ 12 17 public class OsmServerHistoryReaderTest { 13 18 19 /** 20 * Setup tests. 21 */ 14 22 @BeforeClass 15 23 public static void init() { 16 System.setProperty("josm.home", "C:\\data\\projekte\\osm\\tag-editor-plugin");17 Main.pref. init(false);24 Main.initApplicationPreferences(); 25 Main.pref.put("osm-server.url", OsmApi.DEFAULT_API_URL); 18 26 } 19 27 28 /** 29 * Tests node history fetching. 30 * @throws OsmTransferException if any error occurs 31 */ 20 32 @Test 21 public void testNode() 22 OsmServerHistoryReader reader = new OsmServerHistoryReader(OsmPrimitiveType.NODE, 266187);33 public void testNode() throws OsmTransferException { 34 OsmServerHistoryReader reader = new OsmServerHistoryReader(OsmPrimitiveType.NODE, 266187); 23 35 HistoryDataSet ds = reader.parseHistory(NullProgressMonitor.INSTANCE); 24 36 History h = ds.getHistory(266187, OsmPrimitiveType.NODE); 25 System.out.println("num versions: " + h.getNumVersions());37 assertTrue("NumVersions", h.getNumVersions() >= 4); 26 38 } 27 39 40 /** 41 * Tests way history fetching. 42 * @throws OsmTransferException if any error occurs 43 */ 28 44 @Test 29 public void testWay() 30 OsmServerHistoryReader reader = new OsmServerHistoryReader(OsmPrimitiveType.WAY, 3058844);45 public void testWay() throws OsmTransferException { 46 OsmServerHistoryReader reader = new OsmServerHistoryReader(OsmPrimitiveType.WAY, 3058844); 31 47 HistoryDataSet ds = reader.parseHistory(NullProgressMonitor.INSTANCE); 32 48 History h = ds.getHistory(3058844, OsmPrimitiveType.WAY); 33 System.out.println("num versions: " + h.getNumVersions());49 assertTrue("NumVersions", h.getNumVersions() >= 13); 34 50 } 35 51 52 /** 53 * Tests relation history fetching. 54 * @throws OsmTransferException if any error occurs 55 */ 36 56 @Test 37 public void testRelation() 38 OsmServerHistoryReader reader = new OsmServerHistoryReader(OsmPrimitiveType.RELATION, 49);57 public void testRelation() throws OsmTransferException { 58 OsmServerHistoryReader reader = new OsmServerHistoryReader(OsmPrimitiveType.RELATION, 49); 39 59 HistoryDataSet ds = reader.parseHistory(NullProgressMonitor.INSTANCE); 40 60 History h = ds.getHistory(49, OsmPrimitiveType.RELATION); 41 System.out.println("num versions: " + h.getNumVersions());61 assertTrue("NumVersions", h.getNumVersions() >= 3); 42 62 } 43 63 }
Note:
See TracChangeset
for help on using the changeset viewer.