Changeset 19077 in josm for trunk/test/unit


Ignore:
Timestamp:
2024-05-13T19:23:43+02:00 (7 months ago)
Author:
taylor.smock
Message:

Fix #23666: commons-io dependency not included in ivy.xml

This removes all imports of org.apache.commons.io classes and replaces them with
similar functionality.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java

    r19052 r19077  
    1616import java.nio.charset.StandardCharsets;
    1717import java.nio.file.Files;
     18import java.nio.file.Path;
    1819import java.nio.file.Paths;
    1920import java.util.ArrayList;
     
    2223import java.util.concurrent.TimeUnit;
    2324
    24 import org.apache.commons.io.FileUtils;
    2525import org.junit.jupiter.api.Disabled;
    2626import org.junit.jupiter.api.Test;
     
    488488    void testSupportedMimeTypesUrlEncode(String mimeType, @TempDir File temporaryDirectory)
    489489            throws IOException, WMTSGetCapabilitiesException, ReflectiveOperationException {
    490         final String data = FileUtils.readFileToString(new File(TestUtils.getTestDataRoot() +
    491                 "wmts/bug13975-multiple-tile-matrices-for-one-layer-projection.xml"), StandardCharsets.UTF_8)
     490        final String data = Files.readString(Paths.get(TestUtils.getTestDataRoot() +
     491                        "wmts", "bug13975-multiple-tile-matrices-for-one-layer-projection.xml"), StandardCharsets.UTF_8)
    492492                .replace("image/jpgpng", mimeType);
    493         File file = new File(temporaryDirectory, "testSupportedMimeTypes.xml");
    494         FileUtils.writeStringToFile(file, data, StandardCharsets.UTF_8);
    495         WMTSCapabilities capabilities = WMTSTileSource.getCapabilities(file.toURI().toURL().toExternalForm(), Collections.emptyMap());
     493        Path file = temporaryDirectory.toPath().resolve("testSupportedMimeTypes.xml");
     494        Files.writeString(file, data, StandardCharsets.UTF_8);
     495        WMTSCapabilities capabilities = WMTSTileSource.getCapabilities(file.toUri().toURL().toExternalForm(), Collections.emptyMap());
    496496        assertEquals(2, capabilities.getLayers().size());
    497497        Field format = WMTSTileSource.Layer.class.getDeclaredField("format");
Note: See TracChangeset for help on using the changeset viewer.