Changeset 32984 in osm for applications/editors/josm/plugins
- Timestamp:
- 2016-09-11T14:14:51+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/mapillary
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/build.gradle
r32693 r32984 45 45 * If not, choose the next higher number that is available, or the gradle build will break. 46 46 */ 47 compile(':josm:10 583')47 compile(':josm:10966') 48 48 // For plugins it's irrelevant, which version is specified, always the latest version is used. 49 49 requiredPlugin (name: 'apache-commons'){changing=true} -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCache.java
r32979 r32984 6 6 import java.util.HashMap; 7 7 8 import org.apache.commons.jcs.access.CacheAccess; 8 9 import org.openstreetmap.josm.Main; 9 10 import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry; … … 44 45 */ 45 46 public MapillaryCache(String key, Type type) { 46 super(MapillaryPlugin.getCache(), 50000, 50000, new HashMap<>()); 47 this(MapillaryPlugin.getCache(), key, type); 48 } 49 50 protected MapillaryCache(CacheAccess<String, BufferedImageCacheEntry> cache, String key, Type type) { 51 super(cache, 50000, 50000, new HashMap<>()); 47 52 String k = null; 48 53 URL u = null; -
applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCacheTest.java
r32923 r32984 9 9 import java.io.IOException; 10 10 11 import org.apache.commons.jcs.access.CacheAccess; 11 12 import org.junit.Before; 12 13 import org.junit.Test; 13 14 import org.openstreetmap.josm.Main; 15 import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry; 14 16 import org.openstreetmap.josm.data.cache.JCSCacheManager; 15 17 import org.openstreetmap.josm.plugins.mapillary.AbstractTest; … … 18 20 19 21 public class MapillaryCacheTest extends AbstractTest { 20 21 @Before22 public void setUp() throws IOException {23 MapillaryPlugin.cache = JCSCacheManager.getCache("mapillary", 10, 10000,24 new File(Main.pref.getPluginsDirectory(), "mapillary").getPath() + "/cache/");25 }26 22 27 23 @Test 28 public void test() { 29 MapillaryCache cache = new MapillaryCache("00000", Type.FULL_IMAGE); 24 public void test() throws IOException { 25 CacheAccess<String, BufferedImageCacheEntry> cacheAccess = JCSCacheManager.getCache("mapillary", 10, 10000, 26 new File(Main.pref.getPluginsDirectory(), "mapillary").getPath() + "/cache/"); 27 28 MapillaryCache cache = new MapillaryCache(cacheAccess, "00000", Type.FULL_IMAGE); 30 29 assertNotEquals(null, cache.getUrl()); 31 30 assertNotEquals(null, cache.getCacheKey()); … … 33 32 assertFalse(cache.isObjectLoadable()); 34 33 35 cache = new MapillaryCache( "00000", Type.THUMBNAIL);34 cache = new MapillaryCache(cacheAccess, "00000", Type.THUMBNAIL); 36 35 assertNotEquals(null, cache.getCacheKey()); 37 36 assertNotEquals(null, cache.getUrl()); 38 37 39 cache = new MapillaryCache( null, null);38 cache = new MapillaryCache(cacheAccess, null, null); 40 39 assertEquals(null, cache.getCacheKey()); 41 40 assertEquals(null, cache.getUrl());
Note:
See TracChangeset
for help on using the changeset viewer.