Changeset 32045 in osm for applications/editors/josm/plugins/mapillary
- Timestamp:
- 2016-02-03T00:37:16+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
r32035 r32045 6 6 import java.io.File; 7 7 import java.io.IOException; 8 import java.net.URISyntaxException;9 8 import java.util.List; 10 9 import java.util.TimeZone; 11 10 12 11 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 URISyntaxException,IOException {19 public void testUntaggedImage() throws IOException { 20 20 long startTime = System.currentTimeMillis() / 1000 * 1000; // Rounding to last full second 21 final File untaggedFile = new File( ImageUtil.class.getResource("/exifTestImages/untagged.jpg").toURI());21 final File untaggedFile = new File(TestUtils.getTestDataRoot() + "exifTestImages/untagged.jpg"); 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 URISyntaxException,IOException {33 public void testLatLonOnlyImage() throws IOException { 34 34 long startTime = System.currentTimeMillis() / 1000 * 1000; // Rounding to last full second 35 final File untaggedFile = new File( ImageUtil.class.getResource("/exifTestImages/latLonOnly.jpg").toURI());35 final File untaggedFile = new File(TestUtils.getTestDataRoot() + "exifTestImages/latLonOnly.jpg"); 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 URISyntaxException,IOException {48 public void testGpsDirectionOnlyImage() throws IOException { 49 49 long startTime = System.currentTimeMillis() / 1000 * 1000; // Rounding to last full second 50 final File untaggedFile = new File( ImageUtil.class.getResource("/exifTestImages/gpsDirectionOnly.jpg").toURI());50 final File untaggedFile = new File(TestUtils.getTestDataRoot() + "exifTestImages/gpsDirectionOnly.jpg"); 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 URISyntaxException,IOException {62 public void testDateTimeOnlyImage() throws IOException { 63 63 TimeZone.setDefault(TimeZone.getTimeZone("UTC")); 64 final File untaggedFile = new File( ImageUtil.class.getResource("/exifTestImages/dateTimeOnly.jpg").toURI());64 final File untaggedFile = new File(TestUtils.getTestDataRoot() + "exifTestImages/dateTimeOnly.jpg"); 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 URISyntaxException,IOException {82 final File imageDirectory = new File( ImageUtil.class.getResource("/exifTestImages/").toURI());81 public void testImageDirectory() throws IOException { 82 final File imageDirectory = new File(TestUtils.getTestDataRoot() + "exifTestImages"); 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 92 91 }
Note:
See TracChangeset
for help on using the changeset viewer.