Ignore:
Timestamp:
2016-02-08T20:24:03+01:00 (9 years ago)
Author:
floscher
Message:

[mapillary] Revert r32045

Because the directory test/data/ is now in the classpath for the ant build, that change is no longer needed.
That commit broke the gradle build, because it relies on the code of the unit tests of JOSM, which is currently not used by gradle.

This reverts commit 2937ff4ff22485662d7ed75622d88f8e376d26dc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/utils/ImageUtilsTest.java

    r32045 r32053  
    66import java.io.File;
    77import java.io.IOException;
     8import java.net.URISyntaxException;
    89import java.util.List;
    910import java.util.TimeZone;
    1011
    1112import org.junit.Test;
    12 import org.openstreetmap.josm.TestUtils;
    1313import org.openstreetmap.josm.data.coor.LatLon;
    1414import org.openstreetmap.josm.plugins.mapillary.MapillaryImportedImage;
     
    1717
    1818  @Test
    19   public void testUntaggedImage() throws IOException {
     19  public void testUntaggedImage() throws URISyntaxException, IOException {
    2020    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());
    2222    LatLon defaultLL = new LatLon(42, -73);
    2323    List<MapillaryImportedImage> images = ImageUtil.readImagesFrom(untaggedFile, defaultLL);
     
    3131
    3232  @Test
    33   public void testLatLonOnlyImage() throws IOException {
     33  public void testLatLonOnlyImage() throws URISyntaxException, IOException {
    3434    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());
    3636    LatLon defaultLL = new LatLon(42, -73);
    3737    List<MapillaryImportedImage> images = ImageUtil.readImagesFrom(untaggedFile, defaultLL);
     
    4646
    4747  @Test
    48   public void testGpsDirectionOnlyImage() throws IOException {
     48  public void testGpsDirectionOnlyImage() throws URISyntaxException, IOException {
    4949    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());
    5151    LatLon defaultLL = new LatLon(42, -73);
    5252    List<MapillaryImportedImage> images = ImageUtil.readImagesFrom(untaggedFile, defaultLL);
     
    6060
    6161  @Test
    62   public void testDateTimeOnlyImage() throws IOException {
     62  public void testDateTimeOnlyImage() throws URISyntaxException, IOException {
    6363    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());
    6565    LatLon defaultLL = new LatLon(42, -73);
    6666    List<MapillaryImportedImage> images = ImageUtil.readImagesFrom(untaggedFile, defaultLL);
     
    7979
    8080  @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());
    8383    List<MapillaryImportedImage> images = ImageUtil.readImagesFrom(imageDirectory, new LatLon(42,-73));
    8484    assertEquals(5, images.size());
     
    8989    TestUtil.testUtilityClass(ImageUtil.class);
    9090  }
     91
    9192}
Note: See TracChangeset for help on using the changeset viewer.