From 8cd4bbc676f0ca9c396e187e41d328fe649ec64b Mon Sep 17 00:00:00 2001 From: "taylor.smock" Date: Tue, 17 Sep 2024 15:42:35 +0000 Subject: [PATCH] Add JUnit5 tags to integration tests, functional tests, and performance tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This should allow contributors to filter out integration tests inside the standard test directory. Of specific note, this should reduce test runtime for contributors by a non-trivial amount if contributors filter out the tagged tests. For consistencies’ sake, tests in `functional` and `performance` were also annotated. As such, if we ever merge the test directories, this will let us filter which tests are run in CI. Note that many functional tests don't have the annotation. This is because they are ''manual'' tests. git-svn-id: https://josm.openstreetmap.de/svn/trunk@19223 0c6e7542-c601-0410-84e7-c038aed88b3b --- .../josm/data/BoundariesTestIT.java | 4 +++ .../data/imagery/ImageryCompareTestIT.java | 4 +++ .../josm/data/osm/TaginfoTestIT.java | 2 ++ .../josm/gui/GettingStartedTest.java | 2 ++ .../josm/gui/mappaint/MapCSSRendererTest.java | 2 ++ .../josm/gui/mappaint/StyleCacheTest.java | 2 ++ .../io/MultiFetchServerObjectReaderTest.java | 2 ++ .../io/OsmServerBackreferenceReaderTest.java | 2 ++ .../io/UploadStrategySelectionPanelTest.java | 2 ++ .../josm/tools/HttpClientTest.java | 2 ++ .../josm/tools/ImageProviderTest.java | 2 ++ .../josm/tools/ImageProviderTestIT.java | 4 +++ .../josm/tools/ImageProviderTestManual.java | 2 ++ .../data/osm/KeyValuePerformanceTest.java | 2 ++ .../data/osm/RoundingPerformanceTest.java | 2 ++ ...tractMapRendererPerformanceTestParent.java | 2 ++ .../StyledMapRendererPerformanceTest.java | 2 ++ .../WireframeMapRendererPerformanceTest.java | 2 ++ .../ValidationTaskPerformanceTest.java | 2 ++ .../MapCSSTagCheckerPerformanceTest.java | 2 ++ .../mappaint/MapRendererPerformanceTest.java | 2 ++ .../MapCSSConditionPerformanceTest.java | 2 ++ .../mapcss/MapCSSPerformanceTest.java | 2 ++ ...apCSSStyleSourceFilterPerformanceTest.java | 2 ++ .../josm/io/OsmReaderPerformanceTest.java | 2 ++ .../josm/io/OsmWriterPerformanceTest.java | 2 ++ .../routines/DomainValidatorTestIT.java | 2 ++ .../mappaint/mapcss/MapCSSParserTestIT.java | 2 ++ .../imagery/ImageryPreferenceTestIT.java | 2 ++ .../map/MapPaintPreferenceTestIT.java | 2 ++ .../map/TaggingPresetPreferenceTestIT.java | 2 ++ ...idatorTagCheckerRulesPreferenceTestIT.java | 2 ++ .../josm/io/CertificateAmendmentTestIT.java | 2 ++ .../josm/plugins/PluginHandlerTestIT.java | 2 ++ .../josm/testutils/ImageTestUtils.java | 2 +- .../testutils/annotations/FunctionalTest.java | 25 +++++++++++++++++++ .../annotations/IntegrationTest.java | 25 +++++++++++++++++++ .../annotations/PerformanceTest.java | 25 +++++++++++++++++++ .../josm/tools/PlatformHookTestIT.java | 2 ++ .../josm/tools/TerritoriesTestIT.java | 1 + 40 files changed, 153 insertions(+), 1 deletion(-) create mode 100644 test/unit/org/openstreetmap/josm/testutils/annotations/FunctionalTest.java create mode 100644 test/unit/org/openstreetmap/josm/testutils/annotations/IntegrationTest.java create mode 100644 test/unit/org/openstreetmap/josm/testutils/annotations/PerformanceTest.java diff --git a/test/functional/org/openstreetmap/josm/data/BoundariesTestIT.java b/test/functional/org/openstreetmap/josm/data/BoundariesTestIT.java index f6fabfee3d4..62ff8d26330 100644 --- a/test/functional/org/openstreetmap/josm/data/BoundariesTestIT.java +++ b/test/functional/org/openstreetmap/josm/data/BoundariesTestIT.java @@ -16,11 +16,15 @@ import org.openstreetmap.josm.data.osm.search.SearchCompiler; import org.openstreetmap.josm.io.OsmReader; import org.openstreetmap.josm.testutils.annotations.BasicPreferences; +import org.openstreetmap.josm.testutils.annotations.FunctionalTest; +import org.openstreetmap.josm.testutils.annotations.IntegrationTest; /** * Test of boundaries OSM file. */ @BasicPreferences +@FunctionalTest +@IntegrationTest class BoundariesTestIT { private static final List RETIRED_ISO3166_1_CODES = Arrays.asList( diff --git a/test/functional/org/openstreetmap/josm/data/imagery/ImageryCompareTestIT.java b/test/functional/org/openstreetmap/josm/data/imagery/ImageryCompareTestIT.java index eab2cf9df73..b4e18e60595 100644 --- a/test/functional/org/openstreetmap/josm/data/imagery/ImageryCompareTestIT.java +++ b/test/functional/org/openstreetmap/josm/data/imagery/ImageryCompareTestIT.java @@ -9,6 +9,8 @@ import org.junit.jupiter.api.Timeout; import org.openstreetmap.josm.spi.preferences.Config; import org.openstreetmap.josm.testutils.annotations.BasicPreferences; +import org.openstreetmap.josm.testutils.annotations.FunctionalTest; +import org.openstreetmap.josm.testutils.annotations.IntegrationTest; import org.openstreetmap.josm.tools.HttpClient; /** @@ -16,6 +18,8 @@ * See JOSM wiki */ @BasicPreferences +@FunctionalTest +@IntegrationTest @Timeout(60) class ImageryCompareTestIT { diff --git a/test/functional/org/openstreetmap/josm/data/osm/TaginfoTestIT.java b/test/functional/org/openstreetmap/josm/data/osm/TaginfoTestIT.java index 8774881cf8e..416379388f2 100644 --- a/test/functional/org/openstreetmap/josm/data/osm/TaginfoTestIT.java +++ b/test/functional/org/openstreetmap/josm/data/osm/TaginfoTestIT.java @@ -17,6 +17,7 @@ import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException; import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets; import org.openstreetmap.josm.testutils.annotations.BasicPreferences; +import org.openstreetmap.josm.testutils.annotations.FunctionalTest; import org.openstreetmap.josm.testutils.annotations.Territories; import org.openstreetmap.josm.tools.HttpClient; @@ -29,6 +30,7 @@ * Various integration tests with Taginfo. */ @BasicPreferences +@FunctionalTest @Timeout(20) @Territories class TaginfoTestIT { diff --git a/test/functional/org/openstreetmap/josm/gui/GettingStartedTest.java b/test/functional/org/openstreetmap/josm/gui/GettingStartedTest.java index 489bc714304..cea8b631406 100644 --- a/test/functional/org/openstreetmap/josm/gui/GettingStartedTest.java +++ b/test/functional/org/openstreetmap/josm/gui/GettingStartedTest.java @@ -7,10 +7,12 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.openstreetmap.josm.testutils.annotations.FunctionalTest; /** * Tests the {@link GettingStarted} class. */ +@FunctionalTest class GettingStartedTest { /** * Tests that image links are replaced. diff --git a/test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java b/test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java index 8e4dca66792..8de8c631abd 100644 --- a/test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java +++ b/test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java @@ -33,6 +33,7 @@ import org.openstreetmap.josm.io.IllegalDataException; import org.openstreetmap.josm.io.OsmReader; import org.openstreetmap.josm.testutils.annotations.BasicPreferences; +import org.openstreetmap.josm.testutils.annotations.FunctionalTest; import org.openstreetmap.josm.testutils.annotations.Projection; import org.openstreetmap.josm.tools.Utils; @@ -43,6 +44,7 @@ * @author Michael Zangl */ @BasicPreferences +@FunctionalTest @Projection public class MapCSSRendererTest { private static final String TEST_DATA_BASE = "/renderer/"; diff --git a/test/functional/org/openstreetmap/josm/gui/mappaint/StyleCacheTest.java b/test/functional/org/openstreetmap/josm/gui/mappaint/StyleCacheTest.java index 1a2270a2589..745bac76f45 100644 --- a/test/functional/org/openstreetmap/josm/gui/mappaint/StyleCacheTest.java +++ b/test/functional/org/openstreetmap/josm/gui/mappaint/StyleCacheTest.java @@ -31,6 +31,7 @@ import org.openstreetmap.josm.io.IllegalDataException; import org.openstreetmap.josm.io.OsmReader; import org.openstreetmap.josm.testutils.annotations.BasicPreferences; +import org.openstreetmap.josm.testutils.annotations.FunctionalTest; import org.openstreetmap.josm.testutils.annotations.Main; import org.openstreetmap.josm.testutils.annotations.Projection; import org.openstreetmap.josm.tools.Pair; @@ -39,6 +40,7 @@ * Test {@link StyleCache}. */ @BasicPreferences +@FunctionalTest @Main @org.openstreetmap.josm.testutils.annotations.MapPaintStyles @Projection diff --git a/test/functional/org/openstreetmap/josm/io/MultiFetchServerObjectReaderTest.java b/test/functional/org/openstreetmap/josm/io/MultiFetchServerObjectReaderTest.java index 7a7e3b0d89f..0e2b0fc1b8a 100644 --- a/test/functional/org/openstreetmap/josm/io/MultiFetchServerObjectReaderTest.java +++ b/test/functional/org/openstreetmap/josm/io/MultiFetchServerObjectReaderTest.java @@ -48,6 +48,7 @@ import org.openstreetmap.josm.data.osm.Way; import org.openstreetmap.josm.gui.progress.NullProgressMonitor; import org.openstreetmap.josm.gui.util.GuiHelper; +import org.openstreetmap.josm.testutils.annotations.FunctionalTest; import org.openstreetmap.josm.testutils.annotations.TestUser; import org.openstreetmap.josm.tools.Logging; @@ -56,6 +57,7 @@ /** * Unit tests of {@link MultiFetchServerObjectReader}. */ +@FunctionalTest @SuppressFBWarnings(value = "CRLF_INJECTION_LOGS") @Timeout(value = 1, unit = TimeUnit.MINUTES) @org.openstreetmap.josm.testutils.annotations.OsmApi(org.openstreetmap.josm.testutils.annotations.OsmApi.APIType.DEV) diff --git a/test/functional/org/openstreetmap/josm/io/OsmServerBackreferenceReaderTest.java b/test/functional/org/openstreetmap/josm/io/OsmServerBackreferenceReaderTest.java index c78c814185f..7a93babf4e3 100644 --- a/test/functional/org/openstreetmap/josm/io/OsmServerBackreferenceReaderTest.java +++ b/test/functional/org/openstreetmap/josm/io/OsmServerBackreferenceReaderTest.java @@ -41,6 +41,7 @@ import org.openstreetmap.josm.data.projection.Projections; import org.openstreetmap.josm.gui.progress.NullProgressMonitor; import org.openstreetmap.josm.spi.preferences.Config; +import org.openstreetmap.josm.testutils.annotations.FunctionalTest; import org.openstreetmap.josm.testutils.annotations.TestUser; import org.openstreetmap.josm.tools.JosmRuntimeException; import org.openstreetmap.josm.tools.Logging; @@ -51,6 +52,7 @@ * Reads primitives referring to a particular primitive (ways including a node, relations referring to a relation) * @since 1806 */ +@FunctionalTest @SuppressFBWarnings(value = "CRLF_INJECTION_LOGS") @org.openstreetmap.josm.testutils.annotations.OsmApi(org.openstreetmap.josm.testutils.annotations.OsmApi.APIType.DEV) @TestUser diff --git a/test/functional/org/openstreetmap/josm/io/UploadStrategySelectionPanelTest.java b/test/functional/org/openstreetmap/josm/io/UploadStrategySelectionPanelTest.java index fea65b52beb..5319867bbbc 100644 --- a/test/functional/org/openstreetmap/josm/io/UploadStrategySelectionPanelTest.java +++ b/test/functional/org/openstreetmap/josm/io/UploadStrategySelectionPanelTest.java @@ -14,8 +14,10 @@ import org.junit.jupiter.api.Disabled; import org.openstreetmap.josm.gui.io.UploadStrategySelectionPanel; import org.openstreetmap.josm.gui.progress.NullProgressMonitor; +import org.openstreetmap.josm.testutils.annotations.FunctionalTest; import org.openstreetmap.josm.tools.Logging; +@FunctionalTest @Disabled class UploadStrategySelectionPanelTest extends JFrame { diff --git a/test/functional/org/openstreetmap/josm/tools/HttpClientTest.java b/test/functional/org/openstreetmap/josm/tools/HttpClientTest.java index 9c7eeb306ca..b5eebd16063 100644 --- a/test/functional/org/openstreetmap/josm/tools/HttpClientTest.java +++ b/test/functional/org/openstreetmap/josm/tools/HttpClientTest.java @@ -49,6 +49,7 @@ import org.openstreetmap.josm.gui.progress.ProgressMonitor; import org.openstreetmap.josm.testutils.annotations.BasicPreferences; import org.openstreetmap.josm.testutils.annotations.BasicWiremock; +import org.openstreetmap.josm.testutils.annotations.FunctionalTest; import org.openstreetmap.josm.testutils.annotations.HTTP; import org.openstreetmap.josm.tools.HttpClient.Response; @@ -64,6 +65,7 @@ @HTTP @BasicWiremock @BasicPreferences +@FunctionalTest @Timeout(15) class HttpClientTest { /** diff --git a/test/functional/org/openstreetmap/josm/tools/ImageProviderTest.java b/test/functional/org/openstreetmap/josm/tools/ImageProviderTest.java index 4ad941f8860..9e9165affa9 100644 --- a/test/functional/org/openstreetmap/josm/tools/ImageProviderTest.java +++ b/test/functional/org/openstreetmap/josm/tools/ImageProviderTest.java @@ -34,6 +34,7 @@ import org.openstreetmap.josm.gui.tagging.presets.TaggingPreset; import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets; import org.openstreetmap.josm.gui.tagging.presets.items.Key; +import org.openstreetmap.josm.testutils.annotations.FunctionalTest; import org.xml.sax.SAXException; import com.kitfox.svg.SVGConst; @@ -42,6 +43,7 @@ /** * Unit tests of {@link ImageProvider} class. */ +@FunctionalTest class ImageProviderTest { private static final class LogHandler14319 extends Handler { boolean failed; diff --git a/test/functional/org/openstreetmap/josm/tools/ImageProviderTestIT.java b/test/functional/org/openstreetmap/josm/tools/ImageProviderTestIT.java index d7c9c9698e4..11320e2ec04 100644 --- a/test/functional/org/openstreetmap/josm/tools/ImageProviderTestIT.java +++ b/test/functional/org/openstreetmap/josm/tools/ImageProviderTestIT.java @@ -4,10 +4,14 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import org.junit.jupiter.api.Test; +import org.openstreetmap.josm.testutils.annotations.FunctionalTest; +import org.openstreetmap.josm.testutils.annotations.IntegrationTest; /** * Integration tests of {@link ImageProvider} class. */ +@FunctionalTest +@IntegrationTest class ImageProviderTestIT { /** * Test fetching an image using {@code wiki://} protocol. diff --git a/test/functional/org/openstreetmap/josm/tools/ImageProviderTestManual.java b/test/functional/org/openstreetmap/josm/tools/ImageProviderTestManual.java index f4d278dbba9..7d45b23f040 100644 --- a/test/functional/org/openstreetmap/josm/tools/ImageProviderTestManual.java +++ b/test/functional/org/openstreetmap/josm/tools/ImageProviderTestManual.java @@ -12,10 +12,12 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.openstreetmap.josm.testutils.annotations.FunctionalTest; /** * Unit tests of {@link ImageProvider} class for manual execution. */ +@FunctionalTest class ImageProviderTestManual { /** * Test getting a cursor diff --git a/test/performance/org/openstreetmap/josm/data/osm/KeyValuePerformanceTest.java b/test/performance/org/openstreetmap/josm/data/osm/KeyValuePerformanceTest.java index 9da13bdf239..3f754c6dcb1 100644 --- a/test/performance/org/openstreetmap/josm/data/osm/KeyValuePerformanceTest.java +++ b/test/performance/org/openstreetmap/josm/data/osm/KeyValuePerformanceTest.java @@ -19,6 +19,7 @@ import org.openstreetmap.josm.PerformanceTestUtils; import org.openstreetmap.josm.PerformanceTestUtils.PerformanceTestTimer; import org.openstreetmap.josm.data.osm.OsmDataGenerator.KeyValueDataGenerator; +import org.openstreetmap.josm.testutils.annotations.PerformanceTest; import org.openstreetmap.josm.testutils.annotations.Projection; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -27,6 +28,7 @@ * This test measures the performance of {@link OsmPrimitive#get(String)} and related. * @author Michael Zangl */ +@PerformanceTest @Projection @Timeout(value = 15, unit = TimeUnit.MINUTES) class KeyValuePerformanceTest { diff --git a/test/performance/org/openstreetmap/josm/data/osm/RoundingPerformanceTest.java b/test/performance/org/openstreetmap/josm/data/osm/RoundingPerformanceTest.java index a26bc7737d6..dbe2969da00 100644 --- a/test/performance/org/openstreetmap/josm/data/osm/RoundingPerformanceTest.java +++ b/test/performance/org/openstreetmap/josm/data/osm/RoundingPerformanceTest.java @@ -8,10 +8,12 @@ import org.openstreetmap.josm.data.coor.LatLonTest; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import org.openstreetmap.josm.testutils.annotations.PerformanceTest; /** * Checks that rounding of coordinates is not too slow. */ +@PerformanceTest class RoundingPerformanceTest { private static double oldRoundToOsmPrecision(double value) { diff --git a/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRendererPerformanceTestParent.java b/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRendererPerformanceTestParent.java index 569111b3bf0..8ba6ff884ce 100644 --- a/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRendererPerformanceTestParent.java +++ b/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRendererPerformanceTestParent.java @@ -23,6 +23,7 @@ import org.openstreetmap.josm.gui.progress.NullProgressMonitor; import org.openstreetmap.josm.io.Compression; import org.openstreetmap.josm.io.OsmReader; +import org.openstreetmap.josm.testutils.annotations.PerformanceTest; import org.openstreetmap.josm.testutils.annotations.Projection; import org.openstreetmap.josm.testutils.annotations.Territories; @@ -31,6 +32,7 @@ /** * Abstract superclass of {@code StyledMapRendererPerformanceTest} and {@code WireframeMapRendererPerformanceTest}. */ +@PerformanceTest @Projection @Territories @Timeout(value = 15, unit = TimeUnit.MINUTES) diff --git a/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRendererPerformanceTest.java b/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRendererPerformanceTest.java index ded650f02ec..e5a1c4ddb4c 100644 --- a/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRendererPerformanceTest.java +++ b/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRendererPerformanceTest.java @@ -11,10 +11,12 @@ import org.openstreetmap.josm.gui.mappaint.MapPaintStyles; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import org.openstreetmap.josm.testutils.annotations.PerformanceTest; /** * Performance test of {@code StyledMapRenderer}. */ +@PerformanceTest class StyledMapRendererPerformanceTest extends AbstractMapRendererPerformanceTestParent { @BeforeAll diff --git a/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRendererPerformanceTest.java b/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRendererPerformanceTest.java index 91da62e4a31..2a23ec9a616 100644 --- a/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRendererPerformanceTest.java +++ b/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRendererPerformanceTest.java @@ -3,10 +3,12 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; +import org.openstreetmap.josm.testutils.annotations.PerformanceTest; /** * Performance test of {@code WireframeMapRenderer}. */ +@PerformanceTest class WireframeMapRendererPerformanceTest extends AbstractMapRendererPerformanceTestParent { @BeforeAll diff --git a/test/performance/org/openstreetmap/josm/data/validation/ValidationTaskPerformanceTest.java b/test/performance/org/openstreetmap/josm/data/validation/ValidationTaskPerformanceTest.java index d42baf1234f..30ab2041517 100644 --- a/test/performance/org/openstreetmap/josm/data/validation/ValidationTaskPerformanceTest.java +++ b/test/performance/org/openstreetmap/josm/data/validation/ValidationTaskPerformanceTest.java @@ -17,6 +17,7 @@ import org.openstreetmap.josm.gui.layer.OsmDataLayer; import org.openstreetmap.josm.gui.progress.NullProgressMonitor; import org.openstreetmap.josm.testutils.annotations.BasicPreferences; +import org.openstreetmap.josm.testutils.annotations.PerformanceTest; import org.openstreetmap.josm.testutils.annotations.Projection; import org.openstreetmap.josm.testutils.annotations.Territories; @@ -24,6 +25,7 @@ * Performance test of {@code ValidationTask}. */ @BasicPreferences +@PerformanceTest @Projection @Territories class ValidationTaskPerformanceTest { diff --git a/test/performance/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerPerformanceTest.java b/test/performance/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerPerformanceTest.java index aef783c9379..25307dfa8e8 100644 --- a/test/performance/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerPerformanceTest.java +++ b/test/performance/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerPerformanceTest.java @@ -6,6 +6,7 @@ import org.openstreetmap.josm.PerformanceTestUtils; import org.openstreetmap.josm.data.osm.DataSet; import org.openstreetmap.josm.testutils.annotations.BasicPreferences; +import org.openstreetmap.josm.testutils.annotations.PerformanceTest; import org.openstreetmap.josm.testutils.annotations.Projection; import org.openstreetmap.josm.testutils.annotations.Territories; @@ -13,6 +14,7 @@ * Performance test of {@code MapCSSTagChecker}. */ @BasicPreferences +@PerformanceTest @Projection @Territories class MapCSSTagCheckerPerformanceTest { diff --git a/test/performance/org/openstreetmap/josm/gui/mappaint/MapRendererPerformanceTest.java b/test/performance/org/openstreetmap/josm/gui/mappaint/MapRendererPerformanceTest.java index 0279c539ba4..f1ac81ece69 100644 --- a/test/performance/org/openstreetmap/josm/gui/mappaint/MapRendererPerformanceTest.java +++ b/test/performance/org/openstreetmap/josm/gui/mappaint/MapRendererPerformanceTest.java @@ -45,6 +45,7 @@ import org.openstreetmap.josm.gui.mappaint.styleelement.StyleElement; import org.openstreetmap.josm.testutils.annotations.BasicPreferences; import org.openstreetmap.josm.testutils.annotations.Main; +import org.openstreetmap.josm.testutils.annotations.PerformanceTest; import org.openstreetmap.josm.testutils.annotations.Projection; import org.openstreetmap.josm.testutils.annotations.Territories; @@ -55,6 +56,7 @@ */ @BasicPreferences @Main +@PerformanceTest @Projection @Territories @Timeout(value = 15, unit = TimeUnit.MINUTES) diff --git a/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSConditionPerformanceTest.java b/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSConditionPerformanceTest.java index 8afd2f04001..a562656d25f 100644 --- a/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSConditionPerformanceTest.java +++ b/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSConditionPerformanceTest.java @@ -6,11 +6,13 @@ import org.junit.jupiter.api.Test; import org.openstreetmap.josm.PerformanceTestUtils; import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.Op; +import org.openstreetmap.josm.testutils.annotations.PerformanceTest; /** * Performance test of MapCSS Condition objects. * @author Michael Zangl */ +@PerformanceTest class MapCSSConditionPerformanceTest { /** * Test the performance of all OP entries. diff --git a/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSPerformanceTest.java b/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSPerformanceTest.java index d039f66c459..9ffdf87d8b9 100644 --- a/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSPerformanceTest.java +++ b/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSPerformanceTest.java @@ -19,6 +19,7 @@ import org.openstreetmap.josm.gui.NavigatableComponent; import org.openstreetmap.josm.gui.mappaint.MapRendererPerformanceTest; import org.openstreetmap.josm.io.IllegalDataException; +import org.openstreetmap.josm.testutils.annotations.PerformanceTest; import org.openstreetmap.josm.testutils.annotations.Projection; /** @@ -26,6 +27,7 @@ * against a test data set using a test style. * */ +@PerformanceTest @Projection class MapCSSPerformanceTest { diff --git a/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSourceFilterPerformanceTest.java b/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSourceFilterPerformanceTest.java index c213a38c169..a0d2b1265d8 100644 --- a/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSourceFilterPerformanceTest.java +++ b/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSourceFilterPerformanceTest.java @@ -10,12 +10,14 @@ import org.openstreetmap.josm.data.osm.OsmDataGenerator; import org.openstreetmap.josm.data.osm.OsmDataGenerator.KeyValueDataGenerator; import org.openstreetmap.josm.gui.mappaint.MultiCascade; +import org.openstreetmap.josm.testutils.annotations.PerformanceTest; import org.openstreetmap.josm.testutils.annotations.Projection; /** * Tests how fast {@link MapCSSStyleSource} finds the right style candidates for one object. * @author Michael Zangl */ +@PerformanceTest @Projection @Timeout(value = 15, unit = TimeUnit.MINUTES) class MapCSSStyleSourceFilterPerformanceTest { diff --git a/test/performance/org/openstreetmap/josm/io/OsmReaderPerformanceTest.java b/test/performance/org/openstreetmap/josm/io/OsmReaderPerformanceTest.java index e3ff36a36a1..c8db434f8eb 100644 --- a/test/performance/org/openstreetmap/josm/io/OsmReaderPerformanceTest.java +++ b/test/performance/org/openstreetmap/josm/io/OsmReaderPerformanceTest.java @@ -16,6 +16,7 @@ import org.openstreetmap.josm.PerformanceTestUtils; import org.openstreetmap.josm.PerformanceTestUtils.PerformanceTestTimer; import org.openstreetmap.josm.data.osm.DataSet; +import org.openstreetmap.josm.testutils.annotations.PerformanceTest; /** * This test tests how fast we are at reading an OSM file. @@ -24,6 +25,7 @@ * * @author Michael Zangl */ +@PerformanceTest @Timeout(value = 15, unit = TimeUnit.MINUTES) class OsmReaderPerformanceTest { private static final int TIMES = 4; diff --git a/test/performance/org/openstreetmap/josm/io/OsmWriterPerformanceTest.java b/test/performance/org/openstreetmap/josm/io/OsmWriterPerformanceTest.java index f9e9d5d2e0c..0e9e862d493 100644 --- a/test/performance/org/openstreetmap/josm/io/OsmWriterPerformanceTest.java +++ b/test/performance/org/openstreetmap/josm/io/OsmWriterPerformanceTest.java @@ -11,12 +11,14 @@ import org.openstreetmap.josm.PerformanceTestUtils; import org.openstreetmap.josm.PerformanceTestUtils.PerformanceTestTimer; import org.openstreetmap.josm.data.osm.DataSet; +import org.openstreetmap.josm.testutils.annotations.PerformanceTest; /** * This test tests how fast we are at writing an OSM file. *

* For this, we use the neubrandenburg-file, which is a good real world example of an OSM file. */ +@PerformanceTest @Timeout(value = 15, unit = TimeUnit.MINUTES) class OsmWriterPerformanceTest { private static final int TIMES = 4; diff --git a/test/unit/org/openstreetmap/josm/data/validation/routines/DomainValidatorTestIT.java b/test/unit/org/openstreetmap/josm/data/validation/routines/DomainValidatorTestIT.java index 84943267eb7..0aa9960f55f 100644 --- a/test/unit/org/openstreetmap/josm/data/validation/routines/DomainValidatorTestIT.java +++ b/test/unit/org/openstreetmap/josm/data/validation/routines/DomainValidatorTestIT.java @@ -47,6 +47,7 @@ import org.junit.jupiter.api.Test; import org.openstreetmap.josm.testutils.annotations.HTTPS; +import org.openstreetmap.josm.testutils.annotations.IntegrationTest; import org.openstreetmap.josm.tools.Logging; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -57,6 +58,7 @@ * @version $Revision: 1723861 $ */ @HTTPS +@IntegrationTest class DomainValidatorTestIT { /** * Download and process local copy of http://data.iana.org/TLD/tlds-alpha-by-domain.txt diff --git a/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTestIT.java b/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTestIT.java index a6fe8021086..957f71553ad 100644 --- a/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTestIT.java +++ b/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTestIT.java @@ -5,6 +5,7 @@ import org.junit.jupiter.api.Test; import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser; import org.openstreetmap.josm.testutils.annotations.HTTPS; +import org.openstreetmap.josm.testutils.annotations.IntegrationTest; import org.openstreetmap.josm.testutils.annotations.Projection; /** @@ -12,6 +13,7 @@ */ @HTTPS @Projection +@IntegrationTest class MapCSSParserTestIT { /** * Checks Kothic stylesheets diff --git a/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java b/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java index 4583801da9e..e382f0a0441 100644 --- a/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java +++ b/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java @@ -67,6 +67,7 @@ import org.openstreetmap.josm.io.imagery.WMSImagery.WMSGetCapabilitiesException; import org.openstreetmap.josm.testutils.annotations.HTTPS; import org.openstreetmap.josm.testutils.annotations.I18n; +import org.openstreetmap.josm.testutils.annotations.IntegrationTest; import org.openstreetmap.josm.testutils.annotations.ProjectionNadGrids; import org.openstreetmap.josm.tools.HttpClient; import org.openstreetmap.josm.tools.HttpClient.Response; @@ -78,6 +79,7 @@ */ @HTTPS @I18n +@IntegrationTest @org.openstreetmap.josm.testutils.annotations.Projection @ProjectionNadGrids @Timeout(value = 40, unit = TimeUnit.MINUTES) diff --git a/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTestIT.java b/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTestIT.java index e5587cc2d66..245a05696ea 100644 --- a/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTestIT.java +++ b/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTestIT.java @@ -26,12 +26,14 @@ import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource; import org.openstreetmap.josm.gui.preferences.AbstractExtendedSourceEntryTestCase; import org.openstreetmap.josm.testutils.annotations.HTTPS; +import org.openstreetmap.josm.testutils.annotations.IntegrationTest; import org.openstreetmap.josm.tools.ImageProvider; /** * Integration tests of {@link MapPaintPreference} class. */ @HTTPS +@IntegrationTest @Timeout(value = 15, unit = TimeUnit.MINUTES) class MapPaintPreferenceTestIT extends AbstractExtendedSourceEntryTestCase { /** diff --git a/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTestIT.java b/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTestIT.java index 48552302847..4aa8382bbde 100644 --- a/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTestIT.java +++ b/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTestIT.java @@ -38,6 +38,7 @@ import org.openstreetmap.josm.gui.tagging.presets.items.Link; import org.openstreetmap.josm.spi.preferences.Config; import org.openstreetmap.josm.testutils.annotations.HTTPS; +import org.openstreetmap.josm.testutils.annotations.IntegrationTest; import org.openstreetmap.josm.testutils.annotations.Territories; import org.openstreetmap.josm.tools.HttpClient; import org.openstreetmap.josm.tools.HttpClient.Response; @@ -50,6 +51,7 @@ * Integration tests of {@link TaggingPresetPreference} class. */ @HTTPS +@IntegrationTest @Territories @Timeout(value = 20, unit = TimeUnit.MINUTES) class TaggingPresetPreferenceTestIT extends AbstractExtendedSourceEntryTestCase { diff --git a/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorTagCheckerRulesPreferenceTestIT.java b/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorTagCheckerRulesPreferenceTestIT.java index 0be0991356a..a3d0b29ee16 100644 --- a/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorTagCheckerRulesPreferenceTestIT.java +++ b/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorTagCheckerRulesPreferenceTestIT.java @@ -24,11 +24,13 @@ import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.ParseResult; import org.openstreetmap.josm.gui.preferences.AbstractExtendedSourceEntryTestCase; import org.openstreetmap.josm.testutils.annotations.HTTPS; +import org.openstreetmap.josm.testutils.annotations.IntegrationTest; /** * Integration tests of {@link ValidatorTagCheckerRulesPreference} class. */ @HTTPS +@IntegrationTest @Timeout(20) class ValidatorTagCheckerRulesPreferenceTestIT extends AbstractExtendedSourceEntryTestCase { /** diff --git a/test/unit/org/openstreetmap/josm/io/CertificateAmendmentTestIT.java b/test/unit/org/openstreetmap/josm/io/CertificateAmendmentTestIT.java index 085f99cf541..35bf0032289 100644 --- a/test/unit/org/openstreetmap/josm/io/CertificateAmendmentTestIT.java +++ b/test/unit/org/openstreetmap/josm/io/CertificateAmendmentTestIT.java @@ -17,11 +17,13 @@ import org.junit.jupiter.api.Timeout; import org.openstreetmap.josm.TestUtils; import org.openstreetmap.josm.testutils.annotations.HTTPS; +import org.openstreetmap.josm.testutils.annotations.IntegrationTest; /** * Integration tests of {@link CertificateAmendment} class. */ @HTTPS +@IntegrationTest @Timeout(20) class CertificateAmendmentTestIT { private static final List errorsToIgnore = new ArrayList<>(); diff --git a/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTestIT.java b/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTestIT.java index b3108b5ff02..2a6f528db49 100644 --- a/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTestIT.java +++ b/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTestIT.java @@ -41,6 +41,7 @@ import org.openstreetmap.josm.spi.preferences.Config; import org.openstreetmap.josm.testutils.annotations.BasicPreferences; import org.openstreetmap.josm.testutils.annotations.HTTPS; +import org.openstreetmap.josm.testutils.annotations.IntegrationTest; import org.openstreetmap.josm.testutils.annotations.Main; import org.openstreetmap.josm.testutils.annotations.Plugins; import org.openstreetmap.josm.testutils.annotations.Projection; @@ -55,6 +56,7 @@ */ @BasicPreferences @HTTPS +@IntegrationTest @Main @Projection @Territories diff --git a/test/unit/org/openstreetmap/josm/testutils/ImageTestUtils.java b/test/unit/org/openstreetmap/josm/testutils/ImageTestUtils.java index 2fd05605a12..fe63a31d514 100644 --- a/test/unit/org/openstreetmap/josm/testutils/ImageTestUtils.java +++ b/test/unit/org/openstreetmap/josm/testutils/ImageTestUtils.java @@ -147,7 +147,7 @@ public static void assertImageEquals(String testIdentifier, BufferedImage refere */ public static void writeDebugImages(@Nonnull Path directory, @Nonnull String filePrefix, @Nonnull BufferedImage diff, @Nullable BufferedImage oldImage, @Nullable BufferedImage newImage) { - if (!UPDATE_ALL) { + if (!UPDATE_ALL && false) { return; } try { diff --git a/test/unit/org/openstreetmap/josm/testutils/annotations/FunctionalTest.java b/test/unit/org/openstreetmap/josm/testutils/annotations/FunctionalTest.java new file mode 100644 index 00000000000..d9527722f48 --- /dev/null +++ b/test/unit/org/openstreetmap/josm/testutils/annotations/FunctionalTest.java @@ -0,0 +1,25 @@ +// License: GPL. For details, see LICENSE file. +package org.openstreetmap.josm.testutils.annotations; + +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.TYPE; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Documented; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import org.junit.jupiter.api.Tag; + +/** + * Mark this test as a Functional test + * @author Taylor Smock + */ +@Inherited +@Documented +@Retention(RUNTIME) +@Target({TYPE, METHOD}) +@Tag("FunctionalTest") +public @interface FunctionalTest { +} diff --git a/test/unit/org/openstreetmap/josm/testutils/annotations/IntegrationTest.java b/test/unit/org/openstreetmap/josm/testutils/annotations/IntegrationTest.java new file mode 100644 index 00000000000..2c818b3313b --- /dev/null +++ b/test/unit/org/openstreetmap/josm/testutils/annotations/IntegrationTest.java @@ -0,0 +1,25 @@ +// License: GPL. For details, see LICENSE file. +package org.openstreetmap.josm.testutils.annotations; + +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.TYPE; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Documented; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import org.junit.jupiter.api.Tag; + +/** + * Mark this test as an Integration test + * @author Taylor Smock + */ +@Inherited +@Documented +@Retention(RUNTIME) +@Target({TYPE, METHOD}) +@Tag("IntegrationTest") +public @interface IntegrationTest { +} diff --git a/test/unit/org/openstreetmap/josm/testutils/annotations/PerformanceTest.java b/test/unit/org/openstreetmap/josm/testutils/annotations/PerformanceTest.java new file mode 100644 index 00000000000..17eaa0236d7 --- /dev/null +++ b/test/unit/org/openstreetmap/josm/testutils/annotations/PerformanceTest.java @@ -0,0 +1,25 @@ +// License: GPL. For details, see LICENSE file. +package org.openstreetmap.josm.testutils.annotations; + +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.TYPE; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Documented; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import org.junit.jupiter.api.Tag; + +/** + * Mark this test as a Performance test + * @author Taylor Smock + */ +@Inherited +@Documented +@Retention(RUNTIME) +@Target({TYPE, METHOD}) +@Tag("PerformanceTest") +public @interface PerformanceTest { +} diff --git a/test/unit/org/openstreetmap/josm/tools/PlatformHookTestIT.java b/test/unit/org/openstreetmap/josm/tools/PlatformHookTestIT.java index 12b2e79bf1c..1efe6307022 100644 --- a/test/unit/org/openstreetmap/josm/tools/PlatformHookTestIT.java +++ b/test/unit/org/openstreetmap/josm/tools/PlatformHookTestIT.java @@ -10,10 +10,12 @@ import org.junit.jupiter.api.Test; import jakarta.json.Json; +import org.openstreetmap.josm.testutils.annotations.IntegrationTest; /** * Integration tests of {@link PlatformHook} class. */ +@IntegrationTest class PlatformHookTestIT { /** * Test that we always support the latest Ubuntu version. diff --git a/test/unit/org/openstreetmap/josm/tools/TerritoriesTestIT.java b/test/unit/org/openstreetmap/josm/tools/TerritoriesTestIT.java index 73a4c05addf..80681a35d28 100644 --- a/test/unit/org/openstreetmap/josm/tools/TerritoriesTestIT.java +++ b/test/unit/org/openstreetmap/josm/tools/TerritoriesTestIT.java @@ -13,6 +13,7 @@ * Integration tests of {@link Territories} class. */ @Projection +@org.openstreetmap.josm.testutils.annotations.Territories class TerritoriesTestIT { /** * Test of {@link Territories#initialize} method.