Ignore:
Timestamp:
2022-08-04T15:43:42+02:00 (2 years ago)
Author:
taylor.smock
Message:

Fix #22263: Could not load plug-in 'ImportImagePlugin' due to log4j errors

This moves the plugin logging from log4j to the JOSM Logging class.

It also cleans up various lint issues and moves the unit tests from JUnit 4 to JUnit 5.

Location:
applications/editors/josm/plugins/ImportImagePlugin/test/unit/org/openstreetmap/josm/plugins/ImportImagePlugin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/ImportImagePlugin/test/unit/org/openstreetmap/josm/plugins/ImportImagePlugin/GeoTiffReaderTest.java

    r33864 r36013  
    22package org.openstreetmap.josm.plugins.ImportImagePlugin;
    33
    4 import static org.junit.Assert.assertNotNull;
     4import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    66import java.io.File;
     
    1515
    1616import org.geotools.coverage.grid.GridCoverage2D;
    17 import org.junit.Rule;
    18 import org.junit.Test;
     17import org.junit.jupiter.api.Test;
     18import org.junit.jupiter.api.Timeout;
    1919import org.openstreetmap.josm.TestUtils;
    20 import org.openstreetmap.josm.testutils.JOSMTestRules;
     20import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2121import org.openstreetmap.josm.tools.Logging;
    2222
     
    2525 * Data downloaded from <a href="ftp://ftp.remotesensing.org/pub/geotiff/samples">remotesensing.org</a>.
    2626 */
    27 public class GeoTiffReaderTest {
    28 
    29     /**
    30      * Setup test.
    31      */
    32     @Rule
    33     public JOSMTestRules rules = new JOSMTestRules().preferences().timeout(20000);
    34 
     27@BasicPreferences
     28@Timeout(20)
     29class GeoTiffReaderTest {
    3530    @Test
    36     public void testReadGeoTiffFiles() throws IOException {
     31    void testReadGeoTiffFiles() throws IOException {
    3732        for (Path p : listDataFiles("tif")) {
    3833            File file = p.toFile();
     
    4641     * Lists all datasets files matching given extension.
    4742     * @param ext file extension to search for
    48      * @returns List of all datasets files matching given extension
     43     * @return List of all datasets files matching given extension
    4944     * @throws IOException in case of I/O error
    5045     */
  • applications/editors/josm/plugins/ImportImagePlugin/test/unit/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayerTest.java

    r33864 r36013  
    22package org.openstreetmap.josm.plugins.ImportImagePlugin;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertTrue;
    66
    77import java.io.File;
    88import java.io.InputStream;
    99
    10 import org.junit.Rule;
    11 import org.junit.Test;
     10import org.junit.jupiter.api.Test;
     11import org.junit.jupiter.api.extension.RegisterExtension;
    1212import org.openstreetmap.josm.TestUtils;
    1313import org.openstreetmap.josm.gui.MainApplication;
     
    1515import org.openstreetmap.josm.io.OsmReader;
    1616import org.openstreetmap.josm.testutils.JOSMTestRules;
     17import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1718
    1819/**
     
    2021 * Data downloaded from <a href="ftp://ftp.remotesensing.org/pub/geotiff/samples">remotesensing.org</a>.
    2122 */
    22 public class ImageLayerTest {
     23@BasicPreferences
     24class ImageLayerTest {
    2325
    2426    /**
    2527     * Setup test.
    2628     */
    27     @Rule
    28     public JOSMTestRules rules = new JOSMTestRules().preferences().projection();
     29    @RegisterExtension
     30    static JOSMTestRules rules = new JOSMTestRules().projection();
    2931
    3032    /**
     
    3335     */
    3436    @Test
    35     public void testTicket14894() throws Exception {
     37    void testTicket14894() throws Exception {
    3638        assertTrue(MainApplication.getLayerManager().getLayers().isEmpty());
    3739        // Step 1: add .osm layer
Note: See TracChangeset for help on using the changeset viewer.