Changeset 30558 in osm for applications/editors/josm
- Timestamp:
- 2014-08-04T21:31:18+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/ElevationProfile
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/ElevationProfile/.classpath
r30550 r30558 3 3 <classpathentry kind="src" path="src"/> 4 4 <classpathentry kind="src" path="test/unit"/> 5 <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/ 3"/>5 <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/> 6 6 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> 7 7 <classpathentry combineaccessrules="false" kind="src" path="/JOSM"/> -
applications/editors/josm/plugins/ElevationProfile/README
r23784 r30558 6 6 For detailed instructions please refer to http://wiki.openstreetmap.org/wiki/JOSM/Plugins/ElevationProfile. 7 7 8 SRTM data in test/data is downloaded from http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/Eurasia/ 9 8 10 Please report bugs to oliver.wieland@online.de. -
applications/editors/josm/plugins/ElevationProfile/test/unit/org/openstreetmap/josm/plugins/elevation/tests/HgtReaderTest.java
r30344 r30558 2 2 package org.openstreetmap.josm.plugins.elevation.tests; 3 3 4 import java.io.IOException; 5 import java.nio.file.DirectoryIteratorException; 6 import java.nio.file.DirectoryStream; 7 import java.nio.file.Files; 8 import java.nio.file.Path; 9 import java.nio.file.Paths; 10 4 11 import junit.framework.TestCase; 5 12 6 import org.openstreetmap.josm. Main;7 import org.openstreetmap.josm. data.Preferences;13 import org.openstreetmap.josm.JOSMFixture; 14 import org.openstreetmap.josm.TestUtils; 8 15 import org.openstreetmap.josm.data.coor.LatLon; 9 16 import org.openstreetmap.josm.plugins.elevation.HgtReader; … … 13 20 /** 14 21 * Setup test. 22 * @throws IOException if SRTM files cannot be installed 15 23 */ 16 24 @Override 17 public void setUp() { 18 Main.pref = new Preferences(); 25 public void setUp() throws IOException { 26 JOSMFixture.createUnitTestFixture().init(); 27 // Install SRTM files to plugin directory 28 try (DirectoryStream<Path> stream = Files.newDirectoryStream(Paths.get(TestUtils.getTestDataRoot()), "*.hgt")) { 29 Path dir = Paths.get(System.getProperty("josm.home")).resolve("elevation"); 30 if (!Files.exists(dir)) { 31 Files.createDirectory(dir); 32 } 33 for (Path src: stream) { 34 Path dst = dir.resolve(src.getFileName()); 35 if (!Files.exists(dst)) { 36 Files.copy(src, dst); 37 } 38 } 39 } catch (DirectoryIteratorException ex) { 40 // I/O error encounted during the iteration, the cause is an IOException 41 throw ex.getCause(); 42 } 19 43 } 20 44
Note:
See TracChangeset
for help on using the changeset viewer.