Changeset 18893 in josm for trunk/test/unit/org/openstreetmap/josm/gui
- Timestamp:
- 2023-11-02T13:14:51+01:00 (2 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/gui
- Files:
-
- 13 edited
-
MainApplicationTest.java (modified) (3 diffs)
-
dialogs/MinimapDialogTest.java (modified) (11 diffs)
-
dialogs/layer/CycleLayerActionTest.java (modified) (10 diffs)
-
help/HelpBrowserTest.java (modified) (4 diffs)
-
layer/GpxLayerTest.java (modified) (2 diffs)
-
layer/MainLayerManagerTest.java (modified) (4 diffs)
-
layer/gpx/DownloadWmsAlongTrackActionTest.java (modified) (4 diffs)
-
layer/markerlayer/WebMarkerTest.java (modified) (2 diffs)
-
mappaint/mapcss/MapCSSParserTestIT.java (modified) (1 diff)
-
preferences/imagery/ImageryPreferenceTestIT.java (modified) (4 diffs)
-
preferences/map/MapPaintPreferenceTestIT.java (modified) (3 diffs)
-
preferences/map/TaggingPresetPreferenceTestIT.java (modified) (4 diffs)
-
preferences/validator/ValidatorTagCheckerRulesPreferenceTestIT.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java
r18690 r18893 35 35 import javax.swing.plaf.metal.MetalLookAndFeel; 36 36 37 import mockit.Mock;38 import mockit.MockUp;39 37 import org.awaitility.Awaitility; 40 38 import org.awaitility.Durations; 41 39 import org.junit.jupiter.api.Test; 42 import org.junit.jupiter.api. extension.RegisterExtension;40 import org.junit.jupiter.api.Timeout; 43 41 import org.openstreetmap.josm.TestUtils; 44 42 import org.openstreetmap.josm.actions.JosmAction; … … 57 55 import org.openstreetmap.josm.plugins.PluginListParser; 58 56 import org.openstreetmap.josm.spi.preferences.Config; 59 import org.openstreetmap.josm.testutils.JOSMTestRules; 57 import org.openstreetmap.josm.testutils.annotations.HTTPS; 58 import org.openstreetmap.josm.testutils.annotations.Main; 59 import org.openstreetmap.josm.testutils.annotations.OsmApi; 60 import org.openstreetmap.josm.testutils.annotations.Projection; 60 61 import org.openstreetmap.josm.tools.Logging; 61 62 import org.openstreetmap.josm.tools.PlatformManager; 62 63 import org.openstreetmap.josm.tools.Shortcut; 64 import org.openstreetmap.josm.tools.bugreport.BugReportQueue; 63 65 64 66 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 65 import org.openstreetmap.josm.tools.bugreport.BugReportQueue; 67 import mockit.Mock; 68 import mockit.MockUp; 66 69 67 70 /** 68 71 * Unit tests of {@link MainApplication} class. 69 72 */ 73 @HTTPS 74 @Main 75 @OsmApi(OsmApi.APIType.DEV) 76 @Projection 77 @Timeout(20) 70 78 public class MainApplicationTest { 71 72 /**73 * Setup test.74 */75 @RegisterExtension76 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")77 public JOSMTestRules test = new JOSMTestRules().main().projection().https().devAPI().timeout(20000);78 79 79 /** 80 80 * Make sure {@link MainApplication#contentPanePrivate} is initialized. … … 249 249 void testPostConstructorProcessCmdLineEmpty() { 250 250 // Check the method accepts no arguments 251 MainApplication.postConstructorProcessCmdLine(new ProgramArguments()); 251 assertDoesNotThrow(() -> MainApplication.postConstructorProcessCmdLine(new ProgramArguments())); 252 252 } 253 253 -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MinimapDialogTest.java
r18694 r18893 28 28 import javax.swing.JPopupMenu; 29 29 30 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;31 30 import org.awaitility.Awaitility; 32 import org.junit.Before; 33 import org.junit.Rule; 34 import org.junit.Test; 31 import org.junit.jupiter.api.Test; 35 32 import org.openstreetmap.josm.TestUtils; 36 33 import org.openstreetmap.josm.data.Bounds; 37 34 import org.openstreetmap.josm.data.DataSource; 38 import org.openstreetmap.josm.data.SystemOfMeasurement;39 35 import org.openstreetmap.josm.data.imagery.ImageryInfo; 40 36 import org.openstreetmap.josm.data.imagery.ImageryLayerInfo; … … 52 48 import org.openstreetmap.josm.spi.preferences.Config; 53 49 import org.openstreetmap.josm.testutils.ImagePatternMatching; 54 import org.openstreetmap.josm.testutils.JOSMTestRules; 50 import org.openstreetmap.josm.testutils.annotations.FakeImagery; 51 import org.openstreetmap.josm.testutils.annotations.Main; 52 import org.openstreetmap.josm.testutils.annotations.MeasurementSystem; 53 import org.openstreetmap.josm.testutils.annotations.Projection; 55 54 56 55 /** 57 56 * Unit tests of {@link MinimapDialog} class. 58 57 */ 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") 63 class MinimapDialogTest { 74 64 /** 75 65 * Unit test of {@link MinimapDialog} class. 76 66 */ 77 67 @Test 78 publicvoid testMinimapDialog() {68 void testMinimapDialog() { 79 69 MinimapDialog dlg = new MinimapDialog(); 80 70 dlg.showDialog(); … … 206 196 */ 207 197 @Test 208 publicvoid testSourceSwitching() {198 void testSourceSwitching() { 209 199 // relevant prefs starting out empty, should choose the first source and have shown download area enabled 210 200 // (not that there's a data layer for it to use) … … 252 242 */ 253 243 @Test 254 publicvoid testRefreshSourcesRetainsSelection() {244 void testRefreshSourcesRetainsSelection() { 255 245 // relevant prefs starting out empty, should choose the first source and have shown download area enabled 256 246 // (not that there's a data layer for it to use) … … 289 279 */ 290 280 @Test 291 publicvoid testRemovedSourceStillSelected() {281 void testRemovedSourceStillSelected() { 292 282 // relevant prefs starting out empty, should choose the first source and have shown download area enabled 293 283 // (not that there's a data layer for it to use) … … 321 311 */ 322 312 @Test 323 publicvoid testTileSourcesFromCurrentLayers() {313 void testTileSourcesFromCurrentLayers() { 324 314 // relevant prefs starting out empty, should choose the first (ImageryLayerInfo) source and have shown download area enabled 325 315 // (not that there's a data layer for it to use) … … 454 444 */ 455 445 @Test 456 publicvoid testSourcePrefObeyed() {446 void testSourcePrefObeyed() { 457 447 Config.getPref().put("slippy_map_chooser.mapstyle", "Green Tiles"); 458 448 … … 480 470 */ 481 471 @Test 482 publicvoid testSourcePrefInvalid() {472 void testSourcePrefInvalid() { 483 473 Config.getPref().put("slippy_map_chooser.mapstyle", "Hooloovoo Tiles"); 484 474 … … 501 491 */ 502 492 @Test 503 publicvoid testViewportAspectRatio() {493 void testViewportAspectRatio() { 504 494 // Add a test layer to the layer manager to get the MapFrame & MapView 505 495 MainApplication.getLayerManager().addLayer(new TestLayer()); … … 640 630 */ 641 631 @Test 642 publicvoid testShowDownloadedArea() {632 void testShowDownloadedArea() { 643 633 Config.getPref().put("slippy_map_chooser.mapstyle", "Green Tiles"); 644 634 Config.getPref().putBoolean("slippy_map_chooser.show_downloaded_area", false); … … 798 788 */ 799 789 @Test 800 publicvoid testShowDownloadedAreaLayerSwitching() {790 void testShowDownloadedAreaLayerSwitching() { 801 791 Config.getPref().put("slippy_map_chooser.mapstyle", "Green Tiles"); 802 792 Config.getPref().putBoolean("slippy_map_chooser.show_downloaded_area", true); -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/layer/CycleLayerActionTest.java
r18690 r18893 5 5 import static org.openstreetmap.josm.tools.I18n.tr; 6 6 7 import org.junit.Before; 8 import org.junit.Rule; 9 import org.junit.Test; 7 import org.junit.jupiter.api.BeforeEach; 8 import org.junit.jupiter.api.Test; 10 9 import org.openstreetmap.josm.data.imagery.ImageryInfo; 11 10 import org.openstreetmap.josm.data.imagery.ImageryLayerInfo; … … 15 14 import org.openstreetmap.josm.gui.layer.MainLayerManager; 16 15 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 17 import org.openstreetmap.josm.testutils. JOSMTestRules;18 19 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;16 import org.openstreetmap.josm.testutils.annotations.FakeImagery; 17 import org.openstreetmap.josm.testutils.annotations.Main; 18 import org.openstreetmap.josm.testutils.annotations.Projection; 20 19 21 20 /** … … 24 23 * @author Taylor Smock 25 24 */ 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 28 class CycleLayerActionTest { 32 29 private CycleLayerDownAction cycleDown; 33 30 private CycleLayerUpAction cycleUp; … … 37 34 * Set up common items (make layers, etc.) 38 35 */ 39 @Before 40 publicvoid setUp() {36 @BeforeEach 37 void setUp() { 41 38 cycleDown = new CycleLayerDownAction(); 42 39 cycleUp = new CycleLayerUpAction(); … … 51 48 */ 52 49 @Test 53 publicvoid testDownBottom() {50 void testDownBottom() { 54 51 manager.setActiveLayer(manager.getLayers().get(0)); 55 52 cycleDown.actionPerformed(null); … … 61 58 */ 62 59 @Test 63 publicvoid testUpTop() {60 void testUpTop() { 64 61 manager.setActiveLayer(manager.getLayers().get(manager.getLayers().size() - 1)); 65 62 cycleUp.actionPerformed(null); … … 71 68 */ 72 69 @Test 73 publicvoid testDown() {70 void testDown() { 74 71 manager.setActiveLayer(manager.getLayers().get(3)); 75 72 cycleDown.actionPerformed(null); … … 81 78 */ 82 79 @Test 83 publicvoid testUp() {80 void testUp() { 84 81 manager.setActiveLayer(manager.getLayers().get(3)); 85 82 cycleUp.actionPerformed(null); … … 91 88 */ 92 89 @Test 93 publicvoid testNoLayers() {90 void testNoLayers() { 94 91 manager.getLayers().forEach(manager::removeLayer); 95 92 cycleUp.actionPerformed(null); … … 102 99 */ 103 100 @Test 104 publicvoid testWithAerialImagery() {101 void testWithAerialImagery() { 105 102 final ImageryInfo magentaTilesInfo = ImageryLayerInfo.instance.getLayers().stream() 106 103 .filter(i -> i.getName().equals("Magenta Tiles")).findAny().get(); -
trunk/test/unit/org/openstreetmap/josm/gui/help/HelpBrowserTest.java
r17121 r18893 10 10 11 11 import org.junit.jupiter.api.Test; 12 import org.junit.jupiter.api.extension.RegisterExtension;13 12 import org.openstreetmap.josm.TestUtils; 14 import org.openstreetmap.josm.testutils.JOSMTestRules; 13 import org.openstreetmap.josm.testutils.annotations.FullPreferences; 14 import org.openstreetmap.josm.testutils.annotations.HTTPS; 15 15 import org.openstreetmap.josm.testutils.mockers.JOptionPaneSimpleMocker; 16 16 import org.openstreetmap.josm.tools.LanguageInfo.LocaleType; … … 18 18 import org.openstreetmap.josm.tools.PlatformManager; 19 19 20 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;21 20 import mockit.Expectations; 22 21 import mockit.Injectable; … … 26 25 * Unit tests of {@link HelpBrowser} class. 27 26 */ 27 @FullPreferences 28 @HTTPS 28 29 class HelpBrowserTest { 29 30 … … 31 32 static final String URL_2 = "https://josm.openstreetmap.de/wiki/Introduction"; 32 33 static final String URL_3 = "https://josm.openstreetmap.de/javadoc"; 33 34 /**35 * Setup tests36 */37 @RegisterExtension38 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")39 static JOSMTestRules test = new JOSMTestRules().preferences().https();40 34 41 35 static IHelpBrowser newHelpBrowser() { -
trunk/test/unit/org/openstreetmap/josm/gui/layer/GpxLayerTest.java
r18690 r18893 23 23 import org.junit.jupiter.api.BeforeEach; 24 24 import org.junit.jupiter.api.Test; 25 import org.junit.jupiter.api.extension.RegisterExtension;26 25 import org.openstreetmap.josm.TestUtils; 27 26 import org.openstreetmap.josm.data.gpx.GpxData; … … 36 35 import org.openstreetmap.josm.gui.widgets.HtmlPanel; 37 36 import org.openstreetmap.josm.io.GpxReaderTest; 38 import org.openstreetmap.josm.testutils.JOSMTestRules; 37 import org.openstreetmap.josm.testutils.annotations.I18n; 38 import org.openstreetmap.josm.testutils.annotations.Main; 39 import org.openstreetmap.josm.testutils.annotations.MeasurementSystem; 40 import org.openstreetmap.josm.testutils.annotations.Projection; 39 41 import org.openstreetmap.josm.tools.date.DateUtils; 40 42 import org.xml.sax.SAXException; 41 42 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;43 43 44 44 /** 45 45 * Unit tests of {@link GpxLayer} class. 46 46 */ 47 @I18n 48 @Main 49 @MeasurementSystem 50 @Projection 47 51 public class GpxLayerTest { 48 49 /**50 * Setup tests51 */52 @RegisterExtension53 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")54 public JOSMTestRules test = new JOSMTestRules().main().projection().i18n().metricSystem();55 56 52 /** 57 53 * Setup test. -
trunk/test/unit/org/openstreetmap/josm/gui/layer/MainLayerManagerTest.java
r18394 r18893 13 13 import java.util.logging.LogRecord; 14 14 15 import org.junit.jupiter.api.BeforeAll;16 15 import org.junit.jupiter.api.BeforeEach; 17 16 import org.junit.jupiter.api.Test; 18 import org.openstreetmap.josm.JOSMFixture;19 17 import org.openstreetmap.josm.data.osm.DataSet; 20 18 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent; … … 62 60 protected static class LoggingHandler extends Handler { 63 61 64 private List<LogRecord> records = new ArrayList<>(); 62 private final List<LogRecord> records = new ArrayList<>(); 65 63 66 64 @Override … … 79 77 } 80 78 81 }82 83 @BeforeAll84 public static void setUpClass() {85 JOSMFixture.createUnitTestFixture().init();86 79 } 87 80 … … 153 146 CapturingActiveLayerChangeListener listener2 = new CapturingActiveLayerChangeListener(); 154 147 layerManagerWithActive.addAndFireActiveLayerChangeListener(listener2); 155 assert Same(listener2.lastEvent.getPreviousActiveLayer(), null);156 assert Same(listener2.lastEvent.getPreviousDataLayer(), null);148 assertNull(listener2.lastEvent.getPreviousActiveLayer()); 149 assertNull(listener2.lastEvent.getPreviousDataLayer()); 157 150 158 151 layerManagerWithActive.setActiveLayer(layer1); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackActionTest.java
r18690 r18893 11 11 12 12 import org.awaitility.Awaitility; 13 import org.junit.Rule; 14 import org.junit.Test; 13 import org.junit.jupiter.api.Test; 14 import org.junit.jupiter.api.Timeout; 15 import org.openstreetmap.josm.TestUtils; 15 16 import org.openstreetmap.josm.actions.MergeLayerActionTest.MergeLayerExtendedDialogMocker; 16 17 import org.openstreetmap.josm.data.gpx.GpxData; … … 19 20 import org.openstreetmap.josm.gui.layer.TMSLayer; 20 21 import 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;22 import org.openstreetmap.josm.testutils.annotations.FakeImagery; 23 import org.openstreetmap.josm.testutils.annotations.Main; 24 import org.openstreetmap.josm.testutils.annotations.Projection; 24 25 import org.openstreetmap.josm.testutils.mockers.JOptionPaneSimpleMocker; 25 26 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;27 26 28 27 /** 29 28 * Unit tests of {@link DownloadWmsAlongTrackAction} class. 30 29 */ 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) 34 class DownloadWmsAlongTrackActionTest { 39 35 40 36 /** … … 42 38 */ 43 39 @Test 44 publicvoid testNoLayer() {40 void testNoLayer() { 45 41 TestUtils.assumeWorkingJMockit(); 46 42 final JOptionPaneSimpleMocker jopsMocker = new JOptionPaneSimpleMocker( … … 61 57 */ 62 58 @Test 63 publicvoid testTMSLayer() throws Exception {59 void testTMSLayer(FakeImagery.FakeImageryWireMockExtension fakeImageryWireMockExtension) throws Exception { 64 60 TestUtils.assumeWorkingJMockit(); 65 61 final MergeLayerExtendedDialogMocker edMocker = new MergeLayerExtendedDialogMocker(); 66 62 edMocker.getMockResultMap().put("Please select the imagery layer.", "Download"); 67 63 68 final TileSourceRule tileSourceRule = this.test.getTileSourceRule();69 70 64 final TMSLayer layer = new TMSLayer( 71 tileSourceRule.getSourcesList().get(0).getImageryInfo(tileSourceRule.port())65 fakeImageryWireMockExtension.getSourcesList().get(0).getImageryInfo(fakeImageryWireMockExtension.getRuntimeInfo().getHttpPort()) 72 66 ); 73 67 try { -
trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/WebMarkerTest.java
r17275 r18893 7 7 8 8 import org.junit.jupiter.api.Test; 9 import org.junit.jupiter.api.extension.RegisterExtension;10 9 import org.openstreetmap.josm.TestUtils; 11 10 import org.openstreetmap.josm.data.coor.LatLon; 12 11 import org.openstreetmap.josm.data.gpx.GpxData; 13 12 import org.openstreetmap.josm.data.gpx.WayPoint; 14 import org.openstreetmap.josm.testutils.JOSMTestRules; 13 import org.openstreetmap.josm.testutils.annotations.FullPreferences; 14 import org.openstreetmap.josm.testutils.annotations.HTTPS; 15 import org.openstreetmap.josm.tools.PlatformHook; 15 16 import org.openstreetmap.josm.tools.PlatformManager; 16 import org.openstreetmap.josm.tools.PlatformHook;17 18 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;19 17 20 18 import mockit.Expectations; … … 25 23 * Unit tests of {@link WebMarker} class. 26 24 */ 25 @FullPreferences 26 @HTTPS 27 27 class WebMarkerTest { 28 29 /**30 * Setup tests31 */32 @RegisterExtension33 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")34 public JOSMTestRules test = new JOSMTestRules().preferences().https();35 36 28 /** 37 29 * Unit test of {@link WebMarker#WebMarker}. -
trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTestIT.java
r17275 r18893 4 4 import org.junit.jupiter.api.Disabled; 5 5 import org.junit.jupiter.api.Test; 6 import org.junit.jupiter.api.extension.RegisterExtension;7 6 import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser; 8 import org.openstreetmap.josm.testutils.JOSMTestRules; 9 10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 7 import org.openstreetmap.josm.testutils.annotations.HTTPS; 8 import org.openstreetmap.josm.testutils.annotations.Projection; 11 9 12 10 /** 13 11 * Integration tests of {@link MapCSSParser}. 14 12 */ 13 @HTTPS 14 @Projection 15 15 class MapCSSParserTestIT { 16 17 /**18 * Setup rule19 */20 @RegisterExtension21 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")22 public JOSMTestRules test = new JOSMTestRules().https().projection();23 24 16 /** 25 17 * Checks Kothic stylesheets -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java
r18870 r18893 30 30 import org.junit.jupiter.api.BeforeAll; 31 31 import org.junit.jupiter.api.Disabled; 32 import org.junit.jupiter.api. extension.RegisterExtension;32 import org.junit.jupiter.api.Timeout; 33 33 import org.junit.jupiter.api.parallel.Execution; 34 34 import org.junit.jupiter.api.parallel.ExecutionMode; … … 66 66 import org.openstreetmap.josm.io.imagery.ApiKeyProvider; 67 67 import org.openstreetmap.josm.io.imagery.WMSImagery.WMSGetCapabilitiesException; 68 import org.openstreetmap.josm.testutils.JOSMTestRules; 68 import org.openstreetmap.josm.testutils.annotations.HTTPS; 69 import org.openstreetmap.josm.testutils.annotations.I18n; 70 import org.openstreetmap.josm.testutils.annotations.ProjectionNadGrids; 69 71 import org.openstreetmap.josm.tools.HttpClient; 70 72 import org.openstreetmap.josm.tools.HttpClient.Response; … … 72 74 import org.openstreetmap.josm.tools.Utils; 73 75 74 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;75 76 76 /** 77 77 * Integration tests of {@link ImageryPreference} class. 78 78 */ 79 @HTTPS 80 @I18n 81 @org.openstreetmap.josm.testutils.annotations.Projection 82 @ProjectionNadGrids 83 @Timeout(value = 40, unit = TimeUnit.MINUTES) 79 84 public class ImageryPreferenceTestIT { 80 85 … … 82 87 private static final LatLon GREENWICH = new LatLon(51.47810, -0.00170); 83 88 private static final int DEFAULT_ZOOM = 12; 84 85 /**86 * Setup rule87 */88 @RegisterExtension89 @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));92 89 93 90 /** Entry to test */ -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTestIT.java
r17677 r18893 9 9 import java.util.ArrayList; 10 10 import java.util.List; 11 import java.util.concurrent.TimeUnit; 11 12 12 13 import org.junit.jupiter.api.BeforeAll; 13 import org.junit.jupiter.api. extension.RegisterExtension;14 import org.junit.jupiter.api.Timeout; 14 15 import org.junit.jupiter.params.ParameterizedTest; 15 16 import org.junit.jupiter.params.provider.MethodSource; … … 22 23 import org.openstreetmap.josm.gui.mappaint.mapcss.Instruction; 23 24 import org.openstreetmap.josm.gui.mappaint.mapcss.Instruction.AssignmentInstruction; 24 import org.openstreetmap.josm.gui.preferences.AbstractExtendedSourceEntryTestCase;25 25 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSRule; 26 26 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource; 27 import org.openstreetmap.josm.testutils.JOSMTestRules; 27 import org.openstreetmap.josm.gui.preferences.AbstractExtendedSourceEntryTestCase; 28 import org.openstreetmap.josm.testutils.annotations.HTTPS; 28 29 import org.openstreetmap.josm.tools.ImageProvider; 29 30 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;31 30 32 31 /** 33 32 * Integration tests of {@link MapPaintPreference} class. 34 33 */ 34 @HTTPS 35 @Timeout(value = 15, unit = TimeUnit.MINUTES) 35 36 class MapPaintPreferenceTestIT extends AbstractExtendedSourceEntryTestCase { 36 37 /**38 * Setup rule39 */40 @RegisterExtension41 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")42 public static JOSMTestRules test = new JOSMTestRules().https().timeout(15000*60).parameters();43 44 37 /** 45 38 * Setup test … … 66 59 * @param url URL 67 60 * @param source source entry to test 68 * @throws Exception in case of error69 61 */ 70 62 @ParameterizedTest(name = "{0} - {1}") 71 63 @MethodSource("data") 72 void testStyleValidity(String displayName, String url, ExtendedSourceEntry source) throws Exception{64 void testStyleValidity(String displayName, String url, ExtendedSourceEntry source) { 73 65 assumeFalse(isIgnoredSubstring(source, source.url)); 74 66 StyleSource style = MapPaintStyles.addStyle(source); -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTestIT.java
r17695 r18893 15 15 import java.util.Locale; 16 16 import java.util.Set; 17 import java.util.concurrent.TimeUnit; 17 18 18 19 import org.junit.jupiter.api.BeforeAll; 19 import org.junit.jupiter.api. extension.RegisterExtension;20 import org.junit.jupiter.api.Timeout; 20 21 import org.junit.jupiter.params.ParameterizedTest; 21 22 import org.junit.jupiter.params.provider.MethodSource; … … 28 29 import org.openstreetmap.josm.gui.tagging.presets.items.Link; 29 30 import org.openstreetmap.josm.spi.preferences.Config; 30 import org.openstreetmap.josm.testutils. JOSMTestRules;31 import org.openstreetmap.josm.testutils.annotations.HTTPS; 31 32 import org.openstreetmap.josm.tools.HttpClient; 32 33 import org.openstreetmap.josm.tools.HttpClient.Response; … … 35 36 import org.xml.sax.SAXException; 36 37 37 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;38 39 38 /** 40 39 * Integration tests of {@link TaggingPresetPreference} class. 41 40 */ 41 @HTTPS 42 @Timeout(value = 20, unit = TimeUnit.MINUTES) 42 43 class TaggingPresetPreferenceTestIT extends AbstractExtendedSourceEntryTestCase { 43 44 /**45 * Setup rule46 */47 @RegisterExtension48 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")49 public static JOSMTestRules test = new JOSMTestRules().https().timeout(10000*120).parameters();50 51 44 /** 52 45 * Setup test … … 78 71 * @param url URL 79 72 * @param source source entry to test 80 * @throws Exception in case of error81 73 */ 82 74 @ParameterizedTest(name = "{0} - {1}") 83 75 @MethodSource("data") 84 void testPresetsValidity(String displayName, String url, ExtendedSourceEntry source) throws Exception{76 void testPresetsValidity(String displayName, String url, ExtendedSourceEntry source) { 85 77 assumeFalse(isIgnoredSubstring(source, source.url)); 86 78 List<String> ignoredErrors = new ArrayList<>(); -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorTagCheckerRulesPreferenceTestIT.java
r17677 r18893 14 14 15 15 import org.junit.jupiter.api.BeforeAll; 16 import org.junit.jupiter.api. extension.RegisterExtension;16 import org.junit.jupiter.api.Timeout; 17 17 import org.junit.jupiter.api.parallel.Execution; 18 18 import org.junit.jupiter.api.parallel.ExecutionMode; … … 24 24 import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.ParseResult; 25 25 import org.openstreetmap.josm.gui.preferences.AbstractExtendedSourceEntryTestCase; 26 import org.openstreetmap.josm.testutils.JOSMTestRules; 27 28 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 26 import org.openstreetmap.josm.testutils.annotations.HTTPS; 29 27 30 28 /** 31 29 * Integration tests of {@link ValidatorTagCheckerRulesPreference} class. 32 30 */ 31 @HTTPS 32 @Timeout(20) 33 33 class ValidatorTagCheckerRulesPreferenceTestIT extends AbstractExtendedSourceEntryTestCase { 34 35 /**36 * Setup rule37 */38 @RegisterExtension39 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")40 static JOSMTestRules test = new JOSMTestRules().https().timeout(20_000);41 42 34 /** 43 35 * Setup test
Note:
See TracChangeset
for help on using the changeset viewer.
