Ignore:
Timestamp:
2016-02-03T00:37:16+01:00 (9 years ago)
Author:
donvip
Message:

[josm_mapillary] fix unit tests

File:
1 edited

Legend:

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

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