Changeset 7079 in josm
- Timestamp:
- 2014-05-08T15:15:11+02:00 (11 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/build.xml
r7068 r7079 270 270 <attrib file="${test.dir}/config/@{testfamily}-josm.home/preferences.xml" readonly="true"/> 271 271 <!-- Works only on Unix, does nothing on Windows --> 272 <chmod file="${test.dir}/config/@{testfamily}-josm.home/preferences.xml" perm=" a-w"/>272 <chmod file="${test.dir}/config/@{testfamily}-josm.home/preferences.xml" perm="ugo-w" verbose="true"/> 273 273 </sequential> 274 274 </macrodef> -
trunk/src/org/openstreetmap/josm/data/osm/ChangesetCache.java
r7005 r7079 46 46 47 47 /** the cached changesets */ 48 private final Map<Integer, Changeset> cache 48 private final Map<Integer, Changeset> cache = new HashMap<>(); 49 49 50 50 private final CopyOnWriteArrayList<ChangesetCacheListener> listeners = … … 56 56 57 57 public void addChangesetCacheListener(ChangesetCacheListener listener) { 58 listeners.addIfAbsent(listener); 58 if (listener != null) { 59 listeners.addIfAbsent(listener); 60 } 59 61 } 60 62 61 63 public void removeChangesetCacheListener(ChangesetCacheListener listener) { 62 listeners.remove(listener); 64 if (listener != null) { 65 listeners.remove(listener); 66 } 63 67 } 64 68 -
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.