Ignore:
Timestamp:
2023-11-02T13:14:51+01:00 (2 years ago)
Author:
taylor.smock
Message:

Fix #16567: Upgrade to JUnit 5

JOSMTestRules and JOSMTestFixture can reset the default JOSM profile, which can
be unexpected for new contributors. This updates all tests to use JUnit 5 and
the new JUnit 5 annotations.

This also renames MapCSSStyleSourceFilterTest to MapCSSStyleSourceFilterPerformanceTest
to match the naming convention for performance tests and fixes some lint issues.

This was tested by running all tests individually and together.

Location:
trunk/test/unit/org/openstreetmap/josm/gui
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java

    r18690 r18893  
    3535import javax.swing.plaf.metal.MetalLookAndFeel;
    3636
    37 import mockit.Mock;
    38 import mockit.MockUp;
    3937import org.awaitility.Awaitility;
    4038import org.awaitility.Durations;
    4139import org.junit.jupiter.api.Test;
    42 import org.junit.jupiter.api.extension.RegisterExtension;
     40import org.junit.jupiter.api.Timeout;
    4341import org.openstreetmap.josm.TestUtils;
    4442import org.openstreetmap.josm.actions.JosmAction;
     
    5755import org.openstreetmap.josm.plugins.PluginListParser;
    5856import org.openstreetmap.josm.spi.preferences.Config;
    59 import org.openstreetmap.josm.testutils.JOSMTestRules;
     57import org.openstreetmap.josm.testutils.annotations.HTTPS;
     58import org.openstreetmap.josm.testutils.annotations.Main;
     59import org.openstreetmap.josm.testutils.annotations.OsmApi;
     60import org.openstreetmap.josm.testutils.annotations.Projection;
    6061import org.openstreetmap.josm.tools.Logging;
    6162import org.openstreetmap.josm.tools.PlatformManager;
    6263import org.openstreetmap.josm.tools.Shortcut;
     64import org.openstreetmap.josm.tools.bugreport.BugReportQueue;
    6365
    6466import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    65 import org.openstreetmap.josm.tools.bugreport.BugReportQueue;
     67import mockit.Mock;
     68import mockit.MockUp;
    6669
    6770/**
    6871 * Unit tests of {@link MainApplication} class.
    6972 */
     73@HTTPS
     74@Main
     75@OsmApi(OsmApi.APIType.DEV)
     76@Projection
     77@Timeout(20)
    7078public class MainApplicationTest {
    71 
    72     /**
    73      * Setup test.
    74      */
    75     @RegisterExtension
    76     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    77     public JOSMTestRules test = new JOSMTestRules().main().projection().https().devAPI().timeout(20000);
    78 
    7979    /**
    8080     * Make sure {@link MainApplication#contentPanePrivate} is initialized.
     
    249249    void testPostConstructorProcessCmdLineEmpty() {
    250250        // Check the method accepts no arguments
    251         MainApplication.postConstructorProcessCmdLine(new ProgramArguments());
     251        assertDoesNotThrow(() -> MainApplication.postConstructorProcessCmdLine(new ProgramArguments()));
    252252    }
    253253
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MinimapDialogTest.java

    r18694 r18893  
    2828import javax.swing.JPopupMenu;
    2929
    30 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    3130import org.awaitility.Awaitility;
    32 import org.junit.Before;
    33 import org.junit.Rule;
    34 import org.junit.Test;
     31import org.junit.jupiter.api.Test;
    3532import org.openstreetmap.josm.TestUtils;
    3633import org.openstreetmap.josm.data.Bounds;
    3734import org.openstreetmap.josm.data.DataSource;
    38 import org.openstreetmap.josm.data.SystemOfMeasurement;
    3935import org.openstreetmap.josm.data.imagery.ImageryInfo;
    4036import org.openstreetmap.josm.data.imagery.ImageryLayerInfo;
     
    5248import org.openstreetmap.josm.spi.preferences.Config;
    5349import org.openstreetmap.josm.testutils.ImagePatternMatching;
    54 import org.openstreetmap.josm.testutils.JOSMTestRules;
     50import org.openstreetmap.josm.testutils.annotations.FakeImagery;
     51import org.openstreetmap.josm.testutils.annotations.Main;
     52import org.openstreetmap.josm.testutils.annotations.MeasurementSystem;
     53import org.openstreetmap.josm.testutils.annotations.Projection;
    5554
    5655/**
    5756 * Unit tests of {@link MinimapDialog} class.
    5857 */
    59 public class MinimapDialogTest {
    60 
    61     /**
    62      * Setup tests
    63      */
    64     @Rule
    65     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    66     public JOSMTestRules josmTestRules = new JOSMTestRules().main().projection().fakeImagery();
    67 
    68     @Before
    69     public void beforeAll() {
    70         // Needed since testShowDownloadedAreaLayerSwitching expects the measurement to be imperial
    71         SystemOfMeasurement.setSystemOfMeasurement(SystemOfMeasurement.IMPERIAL);
    72     }
    73 
     58@FakeImagery
     59@Main
     60@Projection
     61// Needed since testShowDownloadedAreaLayerSwitching expects the measurement to be imperial
     62@MeasurementSystem("Imperial")
     63class MinimapDialogTest {
    7464    /**
    7565     * Unit test of {@link MinimapDialog} class.
    7666     */
    7767    @Test
    78     public void testMinimapDialog() {
     68    void testMinimapDialog() {
    7969        MinimapDialog dlg = new MinimapDialog();
    8070        dlg.showDialog();
     
    206196     */
    207197    @Test
    208     public void testSourceSwitching() {
     198    void testSourceSwitching() {
    209199        // relevant prefs starting out empty, should choose the first source and have shown download area enabled
    210200        // (not that there's a data layer for it to use)
     
    252242     */
    253243    @Test
    254     public void testRefreshSourcesRetainsSelection() {
     244    void testRefreshSourcesRetainsSelection() {
    255245        // relevant prefs starting out empty, should choose the first source and have shown download area enabled
    256246        // (not that there's a data layer for it to use)
     
    289279     */
    290280    @Test
    291     public void testRemovedSourceStillSelected() {
     281    void testRemovedSourceStillSelected() {
    292282        // relevant prefs starting out empty, should choose the first source and have shown download area enabled
    293283        // (not that there's a data layer for it to use)
     
    321311     */
    322312    @Test
    323     public void testTileSourcesFromCurrentLayers() {
     313    void testTileSourcesFromCurrentLayers() {
    324314        // relevant prefs starting out empty, should choose the first (ImageryLayerInfo) source and have shown download area enabled
    325315        // (not that there's a data layer for it to use)
     
    454444     */
    455445    @Test
    456     public void testSourcePrefObeyed() {
     446    void testSourcePrefObeyed() {
    457447        Config.getPref().put("slippy_map_chooser.mapstyle", "Green Tiles");
    458448
     
    480470     */
    481471    @Test
    482     public void testSourcePrefInvalid() {
     472    void testSourcePrefInvalid() {
    483473        Config.getPref().put("slippy_map_chooser.mapstyle", "Hooloovoo Tiles");
    484474
     
    501491     */
    502492    @Test
    503     public void testViewportAspectRatio() {
     493    void testViewportAspectRatio() {
    504494        // Add a test layer to the layer manager to get the MapFrame & MapView
    505495        MainApplication.getLayerManager().addLayer(new TestLayer());
     
    640630     */
    641631    @Test
    642     public void testShowDownloadedArea() {
     632    void testShowDownloadedArea() {
    643633        Config.getPref().put("slippy_map_chooser.mapstyle", "Green Tiles");
    644634        Config.getPref().putBoolean("slippy_map_chooser.show_downloaded_area", false);
     
    798788     */
    799789    @Test
    800     public void testShowDownloadedAreaLayerSwitching() {
     790    void testShowDownloadedAreaLayerSwitching() {
    801791        Config.getPref().put("slippy_map_chooser.mapstyle", "Green Tiles");
    802792        Config.getPref().putBoolean("slippy_map_chooser.show_downloaded_area", true);
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/layer/CycleLayerActionTest.java

    r18690 r18893  
    55import static org.openstreetmap.josm.tools.I18n.tr;
    66
    7 import org.junit.Before;
    8 import org.junit.Rule;
    9 import org.junit.Test;
     7import org.junit.jupiter.api.BeforeEach;
     8import org.junit.jupiter.api.Test;
    109import org.openstreetmap.josm.data.imagery.ImageryInfo;
    1110import org.openstreetmap.josm.data.imagery.ImageryLayerInfo;
     
    1514import org.openstreetmap.josm.gui.layer.MainLayerManager;
    1615import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    17 import org.openstreetmap.josm.testutils.JOSMTestRules;
    18 
    19 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     16import org.openstreetmap.josm.testutils.annotations.FakeImagery;
     17import org.openstreetmap.josm.testutils.annotations.Main;
     18import org.openstreetmap.josm.testutils.annotations.Projection;
    2019
    2120/**
     
    2423 * @author Taylor Smock
    2524 */
    26 public class CycleLayerActionTest {
    27     /** Layers need a projection */
    28     @Rule
    29     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    30     public JOSMTestRules test = new JOSMTestRules().main().preferences().projection().fakeImagery();
    31 
     25@FakeImagery
     26@Main
     27@Projection
     28class CycleLayerActionTest {
    3229    private CycleLayerDownAction cycleDown;
    3330    private CycleLayerUpAction cycleUp;
     
    3734     * Set up common items (make layers, etc.)
    3835     */
    39     @Before
    40     public void setUp() {
     36    @BeforeEach
     37    void setUp() {
    4138        cycleDown = new CycleLayerDownAction();
    4239        cycleUp = new CycleLayerUpAction();
     
    5148     */
    5249    @Test
    53     public void testDownBottom() {
     50    void testDownBottom() {
    5451        manager.setActiveLayer(manager.getLayers().get(0));
    5552        cycleDown.actionPerformed(null);
     
    6158     */
    6259    @Test
    63     public void testUpTop() {
     60    void testUpTop() {
    6461        manager.setActiveLayer(manager.getLayers().get(manager.getLayers().size() - 1));
    6562        cycleUp.actionPerformed(null);
     
    7168     */
    7269    @Test
    73     public void testDown() {
     70    void testDown() {
    7471        manager.setActiveLayer(manager.getLayers().get(3));
    7572        cycleDown.actionPerformed(null);
     
    8178     */
    8279    @Test
    83     public void testUp() {
     80    void testUp() {
    8481        manager.setActiveLayer(manager.getLayers().get(3));
    8582        cycleUp.actionPerformed(null);
     
    9188     */
    9289    @Test
    93     public void testNoLayers() {
     90    void testNoLayers() {
    9491        manager.getLayers().forEach(manager::removeLayer);
    9592        cycleUp.actionPerformed(null);
     
    10299     */
    103100    @Test
    104     public void testWithAerialImagery() {
     101    void testWithAerialImagery() {
    105102        final ImageryInfo magentaTilesInfo = ImageryLayerInfo.instance.getLayers().stream()
    106103                .filter(i -> i.getName().equals("Magenta Tiles")).findAny().get();
  • trunk/test/unit/org/openstreetmap/josm/gui/help/HelpBrowserTest.java

    r17121 r18893  
    1010
    1111import org.junit.jupiter.api.Test;
    12 import org.junit.jupiter.api.extension.RegisterExtension;
    1312import org.openstreetmap.josm.TestUtils;
    14 import org.openstreetmap.josm.testutils.JOSMTestRules;
     13import org.openstreetmap.josm.testutils.annotations.FullPreferences;
     14import org.openstreetmap.josm.testutils.annotations.HTTPS;
    1515import org.openstreetmap.josm.testutils.mockers.JOptionPaneSimpleMocker;
    1616import org.openstreetmap.josm.tools.LanguageInfo.LocaleType;
     
    1818import org.openstreetmap.josm.tools.PlatformManager;
    1919
    20 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    2120import mockit.Expectations;
    2221import mockit.Injectable;
     
    2625 * Unit tests of {@link HelpBrowser} class.
    2726 */
     27@FullPreferences
     28@HTTPS
    2829class HelpBrowserTest {
    2930
     
    3132    static final String URL_2 = "https://josm.openstreetmap.de/wiki/Introduction";
    3233    static final String URL_3 = "https://josm.openstreetmap.de/javadoc";
    33 
    34     /**
    35      * Setup tests
    36      */
    37     @RegisterExtension
    38     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    39     static JOSMTestRules test = new JOSMTestRules().preferences().https();
    4034
    4135    static IHelpBrowser newHelpBrowser() {
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/GpxLayerTest.java

    r18690 r18893  
    2323import org.junit.jupiter.api.BeforeEach;
    2424import org.junit.jupiter.api.Test;
    25 import org.junit.jupiter.api.extension.RegisterExtension;
    2625import org.openstreetmap.josm.TestUtils;
    2726import org.openstreetmap.josm.data.gpx.GpxData;
     
    3635import org.openstreetmap.josm.gui.widgets.HtmlPanel;
    3736import org.openstreetmap.josm.io.GpxReaderTest;
    38 import org.openstreetmap.josm.testutils.JOSMTestRules;
     37import org.openstreetmap.josm.testutils.annotations.I18n;
     38import org.openstreetmap.josm.testutils.annotations.Main;
     39import org.openstreetmap.josm.testutils.annotations.MeasurementSystem;
     40import org.openstreetmap.josm.testutils.annotations.Projection;
    3941import org.openstreetmap.josm.tools.date.DateUtils;
    4042import org.xml.sax.SAXException;
    41 
    42 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    4343
    4444/**
    4545 * Unit tests of {@link GpxLayer} class.
    4646 */
     47@I18n
     48@Main
     49@MeasurementSystem
     50@Projection
    4751public class GpxLayerTest {
    48 
    49     /**
    50      * Setup tests
    51      */
    52     @RegisterExtension
    53     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    54     public JOSMTestRules test = new JOSMTestRules().main().projection().i18n().metricSystem();
    55 
    5652    /**
    5753     * Setup test.
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/MainLayerManagerTest.java

    r18394 r18893  
    1313import java.util.logging.LogRecord;
    1414
    15 import org.junit.jupiter.api.BeforeAll;
    1615import org.junit.jupiter.api.BeforeEach;
    1716import org.junit.jupiter.api.Test;
    18 import org.openstreetmap.josm.JOSMFixture;
    1917import org.openstreetmap.josm.data.osm.DataSet;
    2018import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent;
     
    6260    protected static class LoggingHandler extends Handler {
    6361
    64         private List<LogRecord> records = new ArrayList<>();
     62        private final List<LogRecord> records = new ArrayList<>();
    6563
    6664        @Override
     
    7977        }
    8078
    81     }
    82 
    83     @BeforeAll
    84     public static void setUpClass() {
    85         JOSMFixture.createUnitTestFixture().init();
    8679    }
    8780
     
    153146        CapturingActiveLayerChangeListener listener2 = new CapturingActiveLayerChangeListener();
    154147        layerManagerWithActive.addAndFireActiveLayerChangeListener(listener2);
    155         assertSame(listener2.lastEvent.getPreviousActiveLayer(), null);
    156         assertSame(listener2.lastEvent.getPreviousDataLayer(), null);
     148        assertNull(listener2.lastEvent.getPreviousActiveLayer());
     149        assertNull(listener2.lastEvent.getPreviousDataLayer());
    157150
    158151        layerManagerWithActive.setActiveLayer(layer1);
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackActionTest.java

    r18690 r18893  
    1111
    1212import org.awaitility.Awaitility;
    13 import org.junit.Rule;
    14 import org.junit.Test;
     13import org.junit.jupiter.api.Test;
     14import org.junit.jupiter.api.Timeout;
     15import org.openstreetmap.josm.TestUtils;
    1516import org.openstreetmap.josm.actions.MergeLayerActionTest.MergeLayerExtendedDialogMocker;
    1617import org.openstreetmap.josm.data.gpx.GpxData;
     
    1920import org.openstreetmap.josm.gui.layer.TMSLayer;
    2021import org.openstreetmap.josm.gui.layer.gpx.DownloadWmsAlongTrackAction.PrecacheWmsTask;
    21 import org.openstreetmap.josm.TestUtils;
    22 import org.openstreetmap.josm.testutils.JOSMTestRules;
    23 import org.openstreetmap.josm.testutils.TileSourceRule;
     22import org.openstreetmap.josm.testutils.annotations.FakeImagery;
     23import org.openstreetmap.josm.testutils.annotations.Main;
     24import org.openstreetmap.josm.testutils.annotations.Projection;
    2425import org.openstreetmap.josm.testutils.mockers.JOptionPaneSimpleMocker;
    25 
    26 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    2726
    2827/**
    2928 * Unit tests of {@link DownloadWmsAlongTrackAction} class.
    3029 */
    31 public class DownloadWmsAlongTrackActionTest {
    32 
    33     /**
    34      * Setup test.
    35      */
    36     @Rule
    37     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    38     public JOSMTestRules test = new JOSMTestRules().main().projection().fakeImagery().timeout(20000);
     30@FakeImagery
     31@Main
     32@Projection
     33@Timeout(20)
     34class DownloadWmsAlongTrackActionTest {
    3935
    4036    /**
     
    4238     */
    4339    @Test
    44     public void testNoLayer() {
     40    void testNoLayer() {
    4541        TestUtils.assumeWorkingJMockit();
    4642        final JOptionPaneSimpleMocker jopsMocker = new JOptionPaneSimpleMocker(
     
    6157     */
    6258    @Test
    63     public void testTMSLayer() throws Exception {
     59    void testTMSLayer(FakeImagery.FakeImageryWireMockExtension fakeImageryWireMockExtension) throws Exception {
    6460        TestUtils.assumeWorkingJMockit();
    6561        final MergeLayerExtendedDialogMocker edMocker = new MergeLayerExtendedDialogMocker();
    6662        edMocker.getMockResultMap().put("Please select the imagery layer.", "Download");
    6763
    68         final TileSourceRule tileSourceRule = this.test.getTileSourceRule();
    69 
    7064        final TMSLayer layer = new TMSLayer(
    71             tileSourceRule.getSourcesList().get(0).getImageryInfo(tileSourceRule.port())
     65                fakeImageryWireMockExtension.getSourcesList().get(0).getImageryInfo(fakeImageryWireMockExtension.getRuntimeInfo().getHttpPort())
    7266        );
    7367        try {
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/WebMarkerTest.java

    r17275 r18893  
    77
    88import org.junit.jupiter.api.Test;
    9 import org.junit.jupiter.api.extension.RegisterExtension;
    109import org.openstreetmap.josm.TestUtils;
    1110import org.openstreetmap.josm.data.coor.LatLon;
    1211import org.openstreetmap.josm.data.gpx.GpxData;
    1312import org.openstreetmap.josm.data.gpx.WayPoint;
    14 import org.openstreetmap.josm.testutils.JOSMTestRules;
     13import org.openstreetmap.josm.testutils.annotations.FullPreferences;
     14import org.openstreetmap.josm.testutils.annotations.HTTPS;
     15import org.openstreetmap.josm.tools.PlatformHook;
    1516import org.openstreetmap.josm.tools.PlatformManager;
    16 import org.openstreetmap.josm.tools.PlatformHook;
    17 
    18 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1917
    2018import mockit.Expectations;
     
    2523 * Unit tests of {@link WebMarker} class.
    2624 */
     25@FullPreferences
     26@HTTPS
    2727class WebMarkerTest {
    28 
    29     /**
    30      * Setup tests
    31      */
    32     @RegisterExtension
    33     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    34     public JOSMTestRules test = new JOSMTestRules().preferences().https();
    35 
    3628    /**
    3729     * Unit test of {@link WebMarker#WebMarker}.
  • trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTestIT.java

    r17275 r18893  
    44import org.junit.jupiter.api.Disabled;
    55import org.junit.jupiter.api.Test;
    6 import org.junit.jupiter.api.extension.RegisterExtension;
    76import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser;
    8 import org.openstreetmap.josm.testutils.JOSMTestRules;
    9 
    10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     7import org.openstreetmap.josm.testutils.annotations.HTTPS;
     8import org.openstreetmap.josm.testutils.annotations.Projection;
    119
    1210/**
    1311 * Integration tests of {@link MapCSSParser}.
    1412 */
     13@HTTPS
     14@Projection
    1515class MapCSSParserTestIT {
    16 
    17     /**
    18      * Setup rule
    19      */
    20     @RegisterExtension
    21     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    22     public JOSMTestRules test = new JOSMTestRules().https().projection();
    23 
    2416    /**
    2517     * Checks Kothic stylesheets
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java

    r18870 r18893  
    3030import org.junit.jupiter.api.BeforeAll;
    3131import org.junit.jupiter.api.Disabled;
    32 import org.junit.jupiter.api.extension.RegisterExtension;
     32import org.junit.jupiter.api.Timeout;
    3333import org.junit.jupiter.api.parallel.Execution;
    3434import org.junit.jupiter.api.parallel.ExecutionMode;
     
    6666import org.openstreetmap.josm.io.imagery.ApiKeyProvider;
    6767import org.openstreetmap.josm.io.imagery.WMSImagery.WMSGetCapabilitiesException;
    68 import org.openstreetmap.josm.testutils.JOSMTestRules;
     68import org.openstreetmap.josm.testutils.annotations.HTTPS;
     69import org.openstreetmap.josm.testutils.annotations.I18n;
     70import org.openstreetmap.josm.testutils.annotations.ProjectionNadGrids;
    6971import org.openstreetmap.josm.tools.HttpClient;
    7072import org.openstreetmap.josm.tools.HttpClient.Response;
     
    7274import org.openstreetmap.josm.tools.Utils;
    7375
    74 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    75 
    7676/**
    7777 * Integration tests of {@link ImageryPreference} class.
    7878 */
     79@HTTPS
     80@I18n
     81@org.openstreetmap.josm.testutils.annotations.Projection
     82@ProjectionNadGrids
     83@Timeout(value = 40, unit = TimeUnit.MINUTES)
    7984public class ImageryPreferenceTestIT {
    8085
     
    8287    private static final LatLon GREENWICH = new LatLon(51.47810, -0.00170);
    8388    private static final int DEFAULT_ZOOM = 12;
    84 
    85     /**
    86      * Setup rule
    87      */
    88     @RegisterExtension
    89     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    90     static JOSMTestRules test = new JOSMTestRules().https().i18n().preferences().projection().projectionNadGrids()
    91                                                    .timeout((int) TimeUnit.MINUTES.toMillis(40));
    9289
    9390    /** Entry to test */
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTestIT.java

    r17677 r18893  
    99import java.util.ArrayList;
    1010import java.util.List;
     11import java.util.concurrent.TimeUnit;
    1112
    1213import org.junit.jupiter.api.BeforeAll;
    13 import org.junit.jupiter.api.extension.RegisterExtension;
     14import org.junit.jupiter.api.Timeout;
    1415import org.junit.jupiter.params.ParameterizedTest;
    1516import org.junit.jupiter.params.provider.MethodSource;
     
    2223import org.openstreetmap.josm.gui.mappaint.mapcss.Instruction;
    2324import org.openstreetmap.josm.gui.mappaint.mapcss.Instruction.AssignmentInstruction;
    24 import org.openstreetmap.josm.gui.preferences.AbstractExtendedSourceEntryTestCase;
    2525import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSRule;
    2626import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource;
    27 import org.openstreetmap.josm.testutils.JOSMTestRules;
     27import org.openstreetmap.josm.gui.preferences.AbstractExtendedSourceEntryTestCase;
     28import org.openstreetmap.josm.testutils.annotations.HTTPS;
    2829import org.openstreetmap.josm.tools.ImageProvider;
    29 
    30 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    3130
    3231/**
    3332 * Integration tests of {@link MapPaintPreference} class.
    3433 */
     34@HTTPS
     35@Timeout(value = 15, unit = TimeUnit.MINUTES)
    3536class MapPaintPreferenceTestIT extends AbstractExtendedSourceEntryTestCase {
    36 
    37     /**
    38      * Setup rule
    39      */
    40     @RegisterExtension
    41     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    42     public static JOSMTestRules test = new JOSMTestRules().https().timeout(15000*60).parameters();
    43 
    4437    /**
    4538     * Setup test
     
    6659     * @param url URL
    6760     * @param source source entry to test
    68      * @throws Exception in case of error
    6961     */
    7062    @ParameterizedTest(name = "{0} - {1}")
    7163    @MethodSource("data")
    72     void testStyleValidity(String displayName, String url, ExtendedSourceEntry source) throws Exception {
     64    void testStyleValidity(String displayName, String url, ExtendedSourceEntry source) {
    7365        assumeFalse(isIgnoredSubstring(source, source.url));
    7466        StyleSource style = MapPaintStyles.addStyle(source);
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTestIT.java

    r17695 r18893  
    1515import java.util.Locale;
    1616import java.util.Set;
     17import java.util.concurrent.TimeUnit;
    1718
    1819import org.junit.jupiter.api.BeforeAll;
    19 import org.junit.jupiter.api.extension.RegisterExtension;
     20import org.junit.jupiter.api.Timeout;
    2021import org.junit.jupiter.params.ParameterizedTest;
    2122import org.junit.jupiter.params.provider.MethodSource;
     
    2829import org.openstreetmap.josm.gui.tagging.presets.items.Link;
    2930import org.openstreetmap.josm.spi.preferences.Config;
    30 import org.openstreetmap.josm.testutils.JOSMTestRules;
     31import org.openstreetmap.josm.testutils.annotations.HTTPS;
    3132import org.openstreetmap.josm.tools.HttpClient;
    3233import org.openstreetmap.josm.tools.HttpClient.Response;
     
    3536import org.xml.sax.SAXException;
    3637
    37 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    38 
    3938/**
    4039 * Integration tests of {@link TaggingPresetPreference} class.
    4140 */
     41@HTTPS
     42@Timeout(value = 20, unit = TimeUnit.MINUTES)
    4243class TaggingPresetPreferenceTestIT extends AbstractExtendedSourceEntryTestCase {
    43 
    44     /**
    45      * Setup rule
    46      */
    47     @RegisterExtension
    48     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    49     public static JOSMTestRules test = new JOSMTestRules().https().timeout(10000*120).parameters();
    50 
    5144    /**
    5245     * Setup test
     
    7871     * @param url URL
    7972     * @param source source entry to test
    80      * @throws Exception in case of error
    8173     */
    8274    @ParameterizedTest(name = "{0} - {1}")
    8375    @MethodSource("data")
    84     void testPresetsValidity(String displayName, String url, ExtendedSourceEntry source) throws Exception {
     76    void testPresetsValidity(String displayName, String url, ExtendedSourceEntry source) {
    8577        assumeFalse(isIgnoredSubstring(source, source.url));
    8678        List<String> ignoredErrors = new ArrayList<>();
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorTagCheckerRulesPreferenceTestIT.java

    r17677 r18893  
    1414
    1515import org.junit.jupiter.api.BeforeAll;
    16 import org.junit.jupiter.api.extension.RegisterExtension;
     16import org.junit.jupiter.api.Timeout;
    1717import org.junit.jupiter.api.parallel.Execution;
    1818import org.junit.jupiter.api.parallel.ExecutionMode;
     
    2424import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.ParseResult;
    2525import org.openstreetmap.josm.gui.preferences.AbstractExtendedSourceEntryTestCase;
    26 import org.openstreetmap.josm.testutils.JOSMTestRules;
    27 
    28 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     26import org.openstreetmap.josm.testutils.annotations.HTTPS;
    2927
    3028/**
    3129 * Integration tests of {@link ValidatorTagCheckerRulesPreference} class.
    3230 */
     31@HTTPS
     32@Timeout(20)
    3333class ValidatorTagCheckerRulesPreferenceTestIT extends AbstractExtendedSourceEntryTestCase {
    34 
    35     /**
    36      * Setup rule
    37      */
    38     @RegisterExtension
    39     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    40     static JOSMTestRules test = new JOSMTestRules().https().timeout(20_000);
    41 
    4234    /**
    4335     * Setup test
Note: See TracChangeset for help on using the changeset viewer.