Changeset 36437 in osm


Ignore:
Timestamp:
2025-05-01T00:53:15+02:00 (6 days ago)
Author:
stoecker
Message:

see #11902, #24278 - fix skipped unit test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/photo_geotagging/test/unit/org/openstreetmap/josm/plugins/photo_geotagging/ExifGPSTaggerTest.java

    r36436 r36437  
    55import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
    66import static org.junit.jupiter.api.Assertions.assertEquals;
    7 import static org.junit.jupiter.api.Assertions.assertFalse;
    87
    98import java.io.ByteArrayOutputStream;
    109import java.io.File;
     10import java.io.IOException;
    1111import java.time.Instant;
    12 import java.util.Scanner;
    1312
    1413import org.apache.commons.imaging.Imaging;
     
    1716import org.apache.commons.imaging.formats.tiff.TiffImageMetadata;
    1817import org.apache.commons.imaging.formats.tiff.write.TiffOutputSet;
    19 import org.junit.jupiter.api.Disabled;
     18import org.junit.jupiter.api.Assumptions;
    2019import org.junit.jupiter.api.Test;
    2120import org.junit.jupiter.api.io.TempDir;
     
    5958
    6059    @Test
    61     @Disabled("To enable after https://josm.openstreetmap.de/ticket/11902 is fixed")
    6260    void testTicket11902() throws Exception {
    6361        final File in = new File(TestUtils.getTestDataRoot(), "IMG_7250_small.JPG");
     
    6563        final ImageEntry image = newImageEntry("test", 12d, 34d, Instant.now(), 12.34d, Math.E, Math.PI);
    6664        ExifGPSTagger.setExifGPSTag(in, out, image, true);
    67         final Process jhead = Runtime.getRuntime().exec(new String[]{"jhead", out.getAbsolutePath()});
    68         final String stdout = new Scanner(jhead.getErrorStream()).useDelimiter("\\A").next();
    69         System.out.println(stdout);
    70         assertFalse(stdout.contains("Suspicious offset of first Exif IFD value"));
     65        try {
     66            final Process jhead = Runtime.getRuntime().exec(new String[]{"jhead", out.getAbsolutePath()});
     67            assertEquals(jhead.getErrorStream().available(), 0);
     68        } catch (IOException e) { /* jhead not installed */
     69            System.out.println(e);
     70            Assumptions.assumeTrue(false);
     71        }
    7172    }
    7273
Note: See TracChangeset for help on using the changeset viewer.