Changeset 32053 in osm for applications/editors/josm
- Timestamp:
- 2016-02-08T20:24:03+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/utils/ImageUtilsTest.java
r32045 r32053 6 6 import java.io.File; 7 7 import java.io.IOException; 8 import java.net.URISyntaxException; 8 9 import java.util.List; 9 10 import java.util.TimeZone; 10 11 11 12 import org.junit.Test; 12 import org.openstreetmap.josm.TestUtils;13 13 import org.openstreetmap.josm.data.coor.LatLon; 14 14 import org.openstreetmap.josm.plugins.mapillary.MapillaryImportedImage; … … 17 17 18 18 @Test 19 public void testUntaggedImage() throws IOException {19 public void testUntaggedImage() throws URISyntaxException, IOException { 20 20 long startTime = System.currentTimeMillis() / 1000 * 1000; // Rounding to last full second 21 final File untaggedFile = new File( TestUtils.getTestDataRoot() + "exifTestImages/untagged.jpg");21 final File untaggedFile = new File(ImageUtil.class.getResource("/exifTestImages/untagged.jpg").toURI()); 22 22 LatLon defaultLL = new LatLon(42, -73); 23 23 List<MapillaryImportedImage> images = ImageUtil.readImagesFrom(untaggedFile, defaultLL); … … 31 31 32 32 @Test 33 public void testLatLonOnlyImage() throws IOException {33 public void testLatLonOnlyImage() throws URISyntaxException, IOException { 34 34 long startTime = System.currentTimeMillis() / 1000 * 1000; // Rounding to last full second 35 final File untaggedFile = new File( TestUtils.getTestDataRoot() + "exifTestImages/latLonOnly.jpg");35 final File untaggedFile = new File(ImageUtil.class.getResource("/exifTestImages/latLonOnly.jpg").toURI()); 36 36 LatLon defaultLL = new LatLon(42, -73); 37 37 List<MapillaryImportedImage> images = ImageUtil.readImagesFrom(untaggedFile, defaultLL); … … 46 46 47 47 @Test 48 public void testGpsDirectionOnlyImage() throws IOException {48 public void testGpsDirectionOnlyImage() throws URISyntaxException, IOException { 49 49 long startTime = System.currentTimeMillis() / 1000 * 1000; // Rounding to last full second 50 final File untaggedFile = new File( TestUtils.getTestDataRoot() + "exifTestImages/gpsDirectionOnly.jpg");50 final File untaggedFile = new File(ImageUtil.class.getResource("/exifTestImages/gpsDirectionOnly.jpg").toURI()); 51 51 LatLon defaultLL = new LatLon(42, -73); 52 52 List<MapillaryImportedImage> images = ImageUtil.readImagesFrom(untaggedFile, defaultLL); … … 60 60 61 61 @Test 62 public void testDateTimeOnlyImage() throws IOException {62 public void testDateTimeOnlyImage() throws URISyntaxException, IOException { 63 63 TimeZone.setDefault(TimeZone.getTimeZone("UTC")); 64 final File untaggedFile = new File( TestUtils.getTestDataRoot() + "exifTestImages/dateTimeOnly.jpg");64 final File untaggedFile = new File(ImageUtil.class.getResource("/exifTestImages/dateTimeOnly.jpg").toURI()); 65 65 LatLon defaultLL = new LatLon(42, -73); 66 66 List<MapillaryImportedImage> images = ImageUtil.readImagesFrom(untaggedFile, defaultLL); … … 79 79 80 80 @Test 81 public void testImageDirectory() throws IOException {82 final File imageDirectory = new File( TestUtils.getTestDataRoot() + "exifTestImages");81 public void testImageDirectory() throws URISyntaxException, IOException { 82 final File imageDirectory = new File(ImageUtil.class.getResource("/exifTestImages/").toURI()); 83 83 List<MapillaryImportedImage> images = ImageUtil.readImagesFrom(imageDirectory, new LatLon(42,-73)); 84 84 assertEquals(5, images.size()); … … 89 89 TestUtil.testUtilityClass(ImageUtil.class); 90 90 } 91 91 92 }
Note:
See TracChangeset
for help on using the changeset viewer.