-
From b09393fc7348a8db171bc91188361147878fef5f Mon Sep 17 00:00:00 2001
From: Taylor Smock <tsmock@fb.com>
Date: Thu, 1 Jul 2021 13:22:36 -0600
Subject: [PATCH] JUnit5 Extension: Add utilities for basic preferences
Also, move many tests that rely solely on
* JOSMTestRules#preferences
* JOSMTestRules#timeout
* JOSMTestRules#i18n
* JOSMTestRules with no further calls
Signed-off-by: Taylor Smock <tsmock@fb.com>
---
.../josm/actions/ExpertToggleActionTest.java | 15 +--
.../josm/command/AddCommandTest.java | 18 +--
.../command/AddPrimitivesCommandTest.java | 18 +--
.../josm/command/ChangeCommandTest.java | 21 ++--
.../command/ChangeMembersCommandTest.java | 19 ++--
.../josm/command/ChangeNodesCommandTest.java | 21 ++--
.../command/ChangePropertyCommandTest.java | 19 ++--
.../command/ChangePropertyKeyCommandTest.java | 19 ++--
.../ChangeRelationMemberRoleCommandTest.java | 19 ++--
.../josm/command/CommandTest.java | 18 +--
.../josm/command/DeleteCommandTest.java | 21 ++--
.../josm/command/PurgeCommandTest.java | 16 +--
.../josm/command/RemoveNodesCommandTest.java | 17 +--
.../josm/command/SelectCommandTest.java | 19 +---
.../josm/command/SequenceCommandTest.java | 17 +--
.../josm/data/PreferencesUtilsTest.java | 17 +--
.../josm/data/UserIdentityManagerTest.java | 103 ++++++------------
.../josm/data/cache/JCSCacheManagerTest.java | 19 +---
.../josm/data/osm/TagCollectionTest.java | 15 +--
.../osm/event/SelectionEventManagerTest.java | 13 +--
.../data/osm/search/SearchCompilerTest.java | 20 ++--
.../preferences/NamedColorPropertyTest.java | 16 +--
.../preferences/PreferencesWriterTest.java | 12 +-
.../data/preferences/StrokePropertyTest.java | 15 +--
.../data/projection/CustomProjectionTest.java | 15 +--
.../josm/data/protobuf/ProtobufTest.java | 7 +-
.../tests/DuplicateRelationTest.java | 15 +--
.../validation/tests/OpeningHourTestTest.java | 18 +--
.../data/validation/util/EntitiesTest.java | 14 +--
.../util/MultipleNameVisitorTest.java | 15 +--
.../josm/data/vector/VectorRelationTest.java | 16 ++-
.../josm/data/vector/VectorWayTest.java | 27 +++--
.../gui/autofilter/AutoFilterRuleTest.java | 17 +--
.../josm/gui/bbox/SizeButtonTest.java | 15 +--
.../bugreport/BugReportSettingsPanelTest.java | 13 +--
.../gui/bugreport/DebugTextDisplayTest.java | 14 +--
.../conflict/pair/ConflictResolverTest.java | 15 +--
.../pair/nodes/NodeListMergeModelTest.java | 18 +--
.../pair/nodes/NodeListMergerTest.java | 15 +--
.../properties/PropertiesMergeModelTest.java | 19 +---
.../pair/properties/PropertiesMergerTest.java | 15 +--
.../relation/RelationMemberMergerTest.java | 15 +--
.../RelationMemberTableCellEditorTest.java | 15 +--
.../RelationMemberTableCellRendererTest.java | 15 +--
.../conflict/pair/tags/TagMergeItemTest.java | 16 +--
.../conflict/pair/tags/TagMergeModelTest.java | 16 +--
.../gui/conflict/pair/tags/TagMergerTest.java | 15 +--
.../tags/MultiValueCellEditorTest.java | 12 --
.../tags/MultiValueCellRendererTest.java | 15 +--
.../PasteTagsConflictResolverDialogTest.java | 16 +--
...lationMemberConflictResolverModelTest.java | 16 +--
.../RelationMemberConflictResolverTest.java | 15 +--
.../tags/TagConflictResolutionUtilTest.java | 14 +--
.../gui/datatransfer/ClipboardUtilsTest.java | 13 +--
.../PrimitiveTransferableTest.java | 17 +--
.../RelationMemberTransferableTest.java | 18 +--
.../gui/datatransfer/TagTransferableTest.java | 15 +--
.../data/PrimitiveTagTransferDataTest.java | 15 +--
.../importers/OsmLinkPasterTest.java | 12 +-
.../josm/gui/dialogs/NotesDialogTest.java | 15 +--
.../changeset/ChangesetCacheManagerTest.java | 22 +---
.../ChangesetCacheTableColumnModelTest.java | 12 --
.../changeset/ChangesetContentPanelTest.java | 6 +-
.../changeset/ChangesetDetailPanelTest.java | 15 +--
.../ChangesetDiscussionPanelTest.java | 15 +--
.../changeset/ChangesetTagsPanelTest.java | 15 +--
.../AdvancedChangesetQueryPanelTest.java | 15 +--
.../query/BasicChangesetQueryPanelTest.java | 15 +--
.../query/UrlBasedQueryPanelTest.java | 15 +--
.../dialogs/layer/DuplicateActionTest.java | 15 +--
.../properties/PropertiesDialogTest.java | 15 +--
.../properties/RecentTagCollectionTest.java | 15 +--
.../relation/ChildRelationBrowserTest.java | 15 +--
.../MemberTableLinkedCellRendererTest.java | 15 +--
.../MemberTableMemberCellRendererTest.java | 15 +--
.../relation/MemberTableModelTest.java | 15 +--
.../MemberTableRoleCellRendererTest.java | 15 +--
.../ReferringRelationsBrowserTest.java | 15 +--
.../RelationTreeCellRendererTest.java | 15 +--
.../SelectionTableCellRendererTest.java | 15 +--
.../validator/ValidatorTreePanelTest.java | 15 +--
.../gui/download/BookmarkSelectionTest.java | 15 +--
.../download/BoundingBoxSelectionTest.java | 15 +--
.../josm/gui/download/PlaceSelectionTest.java | 15 +--
.../josm/gui/download/TileSelectionTest.java | 15 +--
.../josm/gui/help/HyperlinkHandlerTest.java | 15 +--
.../gui/history/CoordinateInfoViewerTest.java | 15 +--
.../josm/gui/history/NodeListViewerTest.java | 15 +--
.../gui/io/BasicUploadSettingsPanelTest.java | 15 +--
.../gui/io/ChangesetCellRendererTest.java | 13 +--
.../gui/io/ChangesetManagementPanelTest.java | 14 +--
.../josm/gui/io/CredentialDialogTest.java | 14 +--
.../josm/gui/io/CustomConfiguratorTest.java | 14 +--
.../io/LayerNameAndFilePathTableCellTest.java | 13 +--
.../josm/gui/io/UploadDialogTest.java | 14 +--
.../io/UploadParameterSummaryPanelTest.java | 14 +--
.../io/UploadTextComponentValidatorTest.java | 14 +--
.../josm/gui/layer/ImageryLayerTest.java | 14 +--
.../gui/layer/geoimage/GeoImageLayerTest.java | 13 +--
.../gui/layer/geoimage/ImageDisplayTest.java | 13 +--
.../gui/layer/geoimage/ThumbsLoaderTest.java | 12 +-
.../geoimage/WikimediaCommonsLoaderTest.java | 13 +--
.../gpx/DownloadAlongTrackActionTest.java | 14 +--
.../mappaint/mapcss/ConditionFactoryTest.java | 13 +--
.../gui/mappaint/mapcss/ConditionTest.java | 13 +--
.../FullyAutomaticAuthorizationUITest.java | 15 +--
.../FullyAutomaticPropertiesPanelTest.java | 14 +--
.../gui/oauth/ManualAuthorizationUITest.java | 14 +--
.../SemiAutomaticAuthorizationUITest.java | 14 +--
.../imagery/AddTMSLayerPanelTest.java | 16 +--
.../imagery/AddWMSLayerPanelTest.java | 16 +--
.../imagery/AddWMTSLayerPanelTest.java | 15 +--
.../server/ProxyPreferenceTest.java | 17 +--
.../server/ServerAccessPreferenceTest.java | 19 +---
.../josm/gui/util/WindowGeometryTest.java | 52 ++-------
.../josm/io/CertificateAmendmentTest.java | 15 +--
.../josm/io/ChangesetQueryTest.java | 13 +--
.../josm/io/DiffResultProcessorTest.java | 15 +--
.../josm/io/GeoJSONReaderTest.java | 14 +--
.../openstreetmap/josm/io/GpxReaderTest.java | 19 +---
.../openstreetmap/josm/io/GpxWriterTest.java | 15 +--
.../MultiFetchOverpassObjectReaderTest.java | 14 +--
.../josm/io/OsmApiExceptionTest.java | 14 +--
.../josm/io/OsmChangeBuilderTest.java | 15 +--
.../josm/io/OsmChangeReaderTest.java | 15 +--
.../io/OsmChangesetContentParserTest.java | 14 +--
.../josm/io/OsmChangesetParserTest.java | 13 +--
.../josm/io/OsmJsonReaderTest.java | 15 +--
.../openstreetmap/josm/io/OsmReaderTest.java | 15 +--
.../openstreetmap/josm/io/OsmWriterTest.java | 16 +--
.../josm/io/ParseWithChangesetReaderTest.java | 15 +--
.../auth/CredentialsAgentExceptionTest.java | 12 --
.../io/remotecontrol/AddTagsDialogTest.java | 13 +--
.../handler/AddWayHandlerTest.java | 14 +--
.../handler/ImageryHandlerTest.java | 16 +--
.../handler/LoadAndZoomHandlerTest.java | 14 +--
.../handler/LoadObjectHandlerTest.java | 15 +--
.../handler/RequestHandlerTest.java | 13 +--
.../plugins/PluginDownloadExceptionTest.java | 12 --
.../josm/plugins/PluginExceptionTest.java | 12 --
.../josm/plugins/PluginHandlerTest.java | 15 +--
.../plugins/PluginListParseExceptionTest.java | 12 --
.../spi/preferences/ListListSettingTest.java | 13 +--
.../josm/spi/preferences/ListSettingTest.java | 13 +--
.../spi/preferences/MapListSettingTest.java | 13 +--
.../spi/preferences/StringSettingTest.java | 13 +--
.../annotations/AnnotationUtils.java | 82 ++++++++++++++
.../annotations/BasicPreferences.java | 77 +++++++++++++
.../annotations/FullPreferences.java | 61 +++++++++++
.../josm/tools/CheckParameterUtilTest.java | 14 +--
.../josm/tools/FontsManagerTest.java | 14 +--
.../josm/tools/ImageResizeModeTest.java | 14 +--
.../josm/tools/KeyboardUtilsTest.java | 11 --
.../tools/ListenableWeakReferenceTest.java | 10 --
.../josm/tools/OptionParserTest.java | 16 +--
.../josm/tools/OsmUrlToBoundsTest.java | 15 +--
.../josm/tools/StreamUtilsTest.java | 14 +--
.../josm/tools/Tag2LinkTest.java | 13 +--
.../josm/tools/TextTagParserTest.java | 14 +--
.../openstreetmap/josm/tools/UtilsTest.java | 13 +--
.../josm/tools/XmlUtilsTest.java | 35 +++---
.../BugReportExceptionHandlerTest.java | 11 --
.../josm/tools/bugreport/BugReportTest.java | 14 +--
163 files changed, 797 insertions(+), 1965 deletions(-)
create mode 100644 test/unit/org/openstreetmap/josm/testutils/annotations/AnnotationUtils.java
create mode 100644 test/unit/org/openstreetmap/josm/testutils/annotations/BasicPreferences.java
create mode 100644 test/unit/org/openstreetmap/josm/testutils/annotations/FullPreferences.java
diff --git a/test/unit/org/openstreetmap/josm/actions/ExpertToggleActionTest.java b/test/unit/org/openstreetmap/josm/actions/ExpertToggleActionTest.java
index c6518f066..13f41f103 100644
a
|
b
|
import java.util.concurrent.atomic.AtomicBoolean;
|
8 | 8 | |
9 | 9 | import javax.swing.JPanel; |
10 | 10 | |
11 | | import org.junit.jupiter.api.extension.RegisterExtension; |
12 | | import org.junit.jupiter.api.Test; |
13 | 11 | import org.openstreetmap.josm.actions.ExpertToggleAction.ExpertModeChangeListener; |
14 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 12 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
15 | 13 | |
16 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 14 | import org.junit.jupiter.api.Test; |
17 | 15 | |
18 | 16 | /** |
19 | 17 | * Test {@link ExpertToggleAction} |
20 | 18 | * @author Michael Zangl |
21 | 19 | * @since 11224 |
22 | 20 | */ |
| 21 | // We need prefs to store expert mode state. |
| 22 | @BasicPreferences |
23 | 23 | class ExpertToggleActionTest { |
24 | | /** |
25 | | * We need prefs to store expert mode state. |
26 | | */ |
27 | | @RegisterExtension |
28 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
29 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
30 | | |
31 | 24 | /** |
32 | 25 | * Test {@link ExpertToggleAction#addVisibilitySwitcher(java.awt.Component)} |
33 | 26 | * and {@link ExpertToggleAction#removeVisibilitySwitcher(java.awt.Component)} |
-
diff --git a/test/unit/org/openstreetmap/josm/command/AddCommandTest.java b/test/unit/org/openstreetmap/josm/command/AddCommandTest.java
index 0ea16321b..526bc57ab 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
6 | 6 | |
7 | 7 | import java.util.ArrayList; |
8 | 8 | |
9 | | import org.junit.jupiter.api.extension.RegisterExtension; |
10 | | import org.junit.jupiter.api.Test; |
11 | 9 | import org.openstreetmap.josm.TestUtils; |
12 | 10 | import org.openstreetmap.josm.data.coor.LatLon; |
13 | 11 | import org.openstreetmap.josm.data.osm.DataSet; |
… |
… |
import org.openstreetmap.josm.data.osm.Relation;
|
17 | 15 | import org.openstreetmap.josm.data.osm.User; |
18 | 16 | import org.openstreetmap.josm.data.osm.Way; |
19 | 17 | import org.openstreetmap.josm.gui.layer.OsmDataLayer; |
20 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 18 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
| 19 | import org.openstreetmap.josm.testutils.annotations.I18n; |
21 | 20 | |
22 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
23 | 21 | import nl.jqno.equalsverifier.EqualsVerifier; |
24 | 22 | import nl.jqno.equalsverifier.Warning; |
| 23 | import org.junit.jupiter.api.Test; |
25 | 24 | |
26 | 25 | /** |
27 | 26 | * Unit tests of {@link AddCommand} class. |
28 | 27 | */ |
| 28 | @I18n |
| 29 | // We need prefs for nodes. |
| 30 | @BasicPreferences |
29 | 31 | class AddCommandTest { |
30 | | |
31 | | /** |
32 | | * We need prefs for nodes. |
33 | | */ |
34 | | @RegisterExtension |
35 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
36 | | public JOSMTestRules test = new JOSMTestRules().preferences().i18n(); |
37 | | |
38 | 32 | /** |
39 | 33 | * Test if the add command is executed correctly and sets the modified flag. |
40 | 34 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/command/AddPrimitivesCommandTest.java b/test/unit/org/openstreetmap/josm/command/AddPrimitivesCommandTest.java
index df9ef62f9..4610aba31 100644
a
|
b
|
import java.util.Arrays;
|
11 | 11 | import java.util.HashSet; |
12 | 12 | import java.util.List; |
13 | 13 | |
14 | | import org.junit.jupiter.api.Test; |
15 | | import org.junit.jupiter.api.extension.RegisterExtension; |
16 | 14 | import org.openstreetmap.josm.TestUtils; |
17 | 15 | import org.openstreetmap.josm.data.coor.LatLon; |
18 | 16 | import org.openstreetmap.josm.data.osm.DataSet; |
… |
… |
import org.openstreetmap.josm.data.osm.User;
|
24 | 22 | import org.openstreetmap.josm.data.osm.Way; |
25 | 23 | import org.openstreetmap.josm.data.osm.WayData; |
26 | 24 | import org.openstreetmap.josm.gui.layer.OsmDataLayer; |
27 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 25 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
| 26 | import org.openstreetmap.josm.testutils.annotations.I18n; |
28 | 27 | |
29 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
30 | 28 | import nl.jqno.equalsverifier.EqualsVerifier; |
31 | 29 | import nl.jqno.equalsverifier.Warning; |
| 30 | import org.junit.jupiter.api.Test; |
32 | 31 | |
33 | 32 | /** |
34 | 33 | * Unit tests of {@link AddPrimitivesCommand} class. |
35 | 34 | */ |
| 35 | @I18n |
| 36 | // We need prefs for nodes. |
| 37 | @BasicPreferences |
36 | 38 | class AddPrimitivesCommandTest { |
37 | | |
38 | | /** |
39 | | * We need prefs for nodes. |
40 | | */ |
41 | | @RegisterExtension |
42 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
43 | | public JOSMTestRules test = new JOSMTestRules().preferences().i18n(); |
44 | | |
45 | 39 | /** |
46 | 40 | * Test if the add command is executed correctly and does not set the modified flag. |
47 | 41 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/command/ChangeCommandTest.java b/test/unit/org/openstreetmap/josm/command/ChangeCommandTest.java
index be41fa58b..aaf4a2ac9 100644
a
|
b
|
package org.openstreetmap.josm.command;
|
4 | 4 | import static org.junit.jupiter.api.Assertions.assertArrayEquals; |
5 | 5 | import static org.junit.jupiter.api.Assertions.assertEquals; |
6 | 6 | import static org.junit.jupiter.api.Assertions.assertNull; |
7 | | import static org.junit.jupiter.api.Assertions.assertTrue; |
8 | 7 | import static org.junit.jupiter.api.Assertions.assertThrows; |
| 8 | import static org.junit.jupiter.api.Assertions.assertTrue; |
9 | 9 | |
10 | 10 | import java.util.ArrayList; |
11 | 11 | import java.util.Collections; |
12 | 12 | import java.util.List; |
13 | 13 | |
14 | | import org.junit.jupiter.api.BeforeEach; |
15 | | import org.junit.jupiter.api.Test; |
16 | | import org.junit.jupiter.api.extension.RegisterExtension; |
17 | 14 | import org.openstreetmap.josm.TestUtils; |
18 | 15 | import org.openstreetmap.josm.command.CommandTest.CommandTestData; |
19 | 16 | import org.openstreetmap.josm.data.coor.LatLon; |
… |
… |
import org.openstreetmap.josm.data.osm.Relation;
|
25 | 22 | import org.openstreetmap.josm.data.osm.User; |
26 | 23 | import org.openstreetmap.josm.data.osm.Way; |
27 | 24 | import org.openstreetmap.josm.gui.layer.OsmDataLayer; |
28 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 25 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
| 26 | import org.openstreetmap.josm.testutils.annotations.I18n; |
29 | 27 | |
30 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
31 | 28 | import nl.jqno.equalsverifier.EqualsVerifier; |
32 | 29 | import nl.jqno.equalsverifier.Warning; |
| 30 | import org.junit.jupiter.api.BeforeEach; |
| 31 | import org.junit.jupiter.api.Test; |
33 | 32 | |
34 | 33 | /** |
35 | 34 | * Unit tests of {@link ChangeCommand} class. |
36 | 35 | */ |
| 36 | @I18n |
| 37 | // We need prefs for nodes. |
| 38 | @BasicPreferences |
37 | 39 | class ChangeCommandTest { |
38 | | |
39 | | /** |
40 | | * We need prefs for nodes. |
41 | | */ |
42 | | @RegisterExtension |
43 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
44 | | public JOSMTestRules test = new JOSMTestRules().preferences().i18n(); |
45 | 40 | private CommandTestData testData; |
46 | 41 | |
47 | 42 | /** |
-
diff --git a/test/unit/org/openstreetmap/josm/command/ChangeMembersCommandTest.java b/test/unit/org/openstreetmap/josm/command/ChangeMembersCommandTest.java
index ade6c9a2d..672fa6b5c 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
7 | 7 | import java.util.Collections; |
8 | 8 | import java.util.List; |
9 | 9 | |
10 | | import org.junit.jupiter.api.BeforeEach; |
11 | | import org.junit.jupiter.api.Test; |
12 | | import org.junit.jupiter.api.extension.RegisterExtension; |
13 | 10 | import org.openstreetmap.josm.TestUtils; |
14 | 11 | import org.openstreetmap.josm.command.CommandTest.CommandTestDataWithRelation; |
15 | 12 | import org.openstreetmap.josm.data.osm.DataSet; |
… |
… |
import org.openstreetmap.josm.data.osm.OsmPrimitive;
|
18 | 15 | import org.openstreetmap.josm.data.osm.RelationMember; |
19 | 16 | import org.openstreetmap.josm.data.osm.User; |
20 | 17 | import org.openstreetmap.josm.gui.layer.OsmDataLayer; |
21 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 18 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
| 19 | import org.openstreetmap.josm.testutils.annotations.I18n; |
22 | 20 | |
23 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
24 | 21 | import nl.jqno.equalsverifier.EqualsVerifier; |
25 | 22 | import nl.jqno.equalsverifier.Warning; |
| 23 | import org.junit.jupiter.api.BeforeEach; |
| 24 | import org.junit.jupiter.api.Test; |
26 | 25 | |
27 | 26 | /** |
28 | 27 | * Unit tests of {@link ChangeMembersCommand} class. |
29 | 28 | */ |
| 29 | @I18n |
| 30 | // We need prefs for nodes. |
| 31 | @BasicPreferences |
30 | 32 | class ChangeMembersCommandTest { |
31 | | |
32 | | /** |
33 | | * We need prefs for nodes. |
34 | | */ |
35 | | @RegisterExtension |
36 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
37 | | public JOSMTestRules test = new JOSMTestRules().preferences().i18n(); |
38 | 33 | private CommandTestDataWithRelation testData; |
39 | 34 | |
40 | 35 | /** |
-
diff --git a/test/unit/org/openstreetmap/josm/command/ChangeNodesCommandTest.java b/test/unit/org/openstreetmap/josm/command/ChangeNodesCommandTest.java
index 0cd482a5a..673ef3779 100644
a
|
b
|
package org.openstreetmap.josm.command;
|
4 | 4 | import static org.junit.jupiter.api.Assertions.assertArrayEquals; |
5 | 5 | import static org.junit.jupiter.api.Assertions.assertEquals; |
6 | 6 | import static org.junit.jupiter.api.Assertions.assertFalse; |
7 | | import static org.junit.jupiter.api.Assertions.assertTrue; |
8 | 7 | import static org.junit.jupiter.api.Assertions.assertThrows; |
| 8 | import static org.junit.jupiter.api.Assertions.assertTrue; |
9 | 9 | |
10 | 10 | import java.util.ArrayList; |
11 | 11 | import java.util.Arrays; |
12 | 12 | import java.util.Collections; |
13 | 13 | import java.util.List; |
14 | 14 | |
15 | | import org.junit.jupiter.api.BeforeEach; |
16 | | import org.junit.jupiter.api.Test; |
17 | | import org.junit.jupiter.api.extension.RegisterExtension; |
18 | 15 | import org.openstreetmap.josm.TestUtils; |
19 | 16 | import org.openstreetmap.josm.command.CommandTest.CommandTestData; |
20 | 17 | import org.openstreetmap.josm.data.coor.LatLon; |
… |
… |
import org.openstreetmap.josm.data.osm.OsmPrimitive;
|
24 | 21 | import org.openstreetmap.josm.data.osm.User; |
25 | 22 | import org.openstreetmap.josm.data.osm.Way; |
26 | 23 | import org.openstreetmap.josm.gui.layer.OsmDataLayer; |
27 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 24 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
| 25 | import org.openstreetmap.josm.testutils.annotations.I18n; |
28 | 26 | |
29 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
30 | 27 | import nl.jqno.equalsverifier.EqualsVerifier; |
31 | 28 | import nl.jqno.equalsverifier.Warning; |
| 29 | import org.junit.jupiter.api.BeforeEach; |
| 30 | import org.junit.jupiter.api.Test; |
32 | 31 | |
33 | 32 | /** |
34 | 33 | * Unit tests of {@link ChangeNodesCommand} class. |
35 | 34 | */ |
| 35 | @I18n |
| 36 | // We need prefs for nodes. |
| 37 | @BasicPreferences |
36 | 38 | class ChangeNodesCommandTest { |
37 | | |
38 | | /** |
39 | | * We need prefs for nodes. |
40 | | */ |
41 | | @RegisterExtension |
42 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
43 | | public JOSMTestRules test = new JOSMTestRules().preferences().i18n(); |
44 | 39 | private CommandTestData testData; |
45 | 40 | |
46 | 41 | /** |
-
diff --git a/test/unit/org/openstreetmap/josm/command/ChangePropertyCommandTest.java b/test/unit/org/openstreetmap/josm/command/ChangePropertyCommandTest.java
index 3ee4de8ae..a9eabd794 100644
a
|
b
|
import java.util.Collection;
|
13 | 13 | import java.util.HashMap; |
14 | 14 | import java.util.List; |
15 | 15 | |
16 | | import org.junit.jupiter.api.BeforeEach; |
17 | | import org.junit.jupiter.api.Test; |
18 | | import org.junit.jupiter.api.extension.RegisterExtension; |
19 | 16 | import org.openstreetmap.josm.TestUtils; |
20 | 17 | import org.openstreetmap.josm.command.CommandTest.CommandTestData; |
21 | 18 | import org.openstreetmap.josm.data.osm.DataSet; |
… |
… |
import org.openstreetmap.josm.data.osm.TagMap;
|
26 | 23 | import org.openstreetmap.josm.data.osm.User; |
27 | 24 | import org.openstreetmap.josm.data.osm.Way; |
28 | 25 | import org.openstreetmap.josm.gui.layer.OsmDataLayer; |
29 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 26 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
| 27 | import org.openstreetmap.josm.testutils.annotations.I18n; |
30 | 28 | |
31 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
32 | 29 | import nl.jqno.equalsverifier.EqualsVerifier; |
33 | 30 | import nl.jqno.equalsverifier.Warning; |
| 31 | import org.junit.jupiter.api.BeforeEach; |
| 32 | import org.junit.jupiter.api.Test; |
34 | 33 | |
35 | 34 | /** |
36 | 35 | * Unit tests of {@link ChangePropertyCommand} class. |
37 | 36 | */ |
| 37 | @I18n |
| 38 | // We need prefs for nodes. |
| 39 | @BasicPreferences |
38 | 40 | class ChangePropertyCommandTest { |
39 | | |
40 | | /** |
41 | | * We need prefs for nodes. |
42 | | */ |
43 | | @RegisterExtension |
44 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
45 | | public JOSMTestRules test = new JOSMTestRules().preferences().i18n(); |
46 | 41 | private CommandTestData testData; |
47 | 42 | |
48 | 43 | /** |
-
diff --git a/test/unit/org/openstreetmap/josm/command/ChangePropertyKeyCommandTest.java b/test/unit/org/openstreetmap/josm/command/ChangePropertyKeyCommandTest.java
index d5be8e9e2..876fc2031 100644
a
|
b
|
import java.util.ArrayList;
|
10 | 10 | import java.util.Arrays; |
11 | 11 | import java.util.Collection; |
12 | 12 | |
13 | | import org.junit.jupiter.api.BeforeEach; |
14 | | import org.junit.jupiter.api.Test; |
15 | | import org.junit.jupiter.api.extension.RegisterExtension; |
16 | 13 | import org.openstreetmap.josm.TestUtils; |
17 | 14 | import org.openstreetmap.josm.command.CommandTest.CommandTestData; |
18 | 15 | import org.openstreetmap.josm.data.osm.DataSet; |
… |
… |
import org.openstreetmap.josm.data.osm.Node;
|
20 | 17 | import org.openstreetmap.josm.data.osm.OsmPrimitive; |
21 | 18 | import org.openstreetmap.josm.data.osm.User; |
22 | 19 | import org.openstreetmap.josm.gui.layer.OsmDataLayer; |
23 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 20 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
| 21 | import org.openstreetmap.josm.testutils.annotations.I18n; |
24 | 22 | |
25 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
26 | 23 | import nl.jqno.equalsverifier.EqualsVerifier; |
27 | 24 | import nl.jqno.equalsverifier.Warning; |
| 25 | import org.junit.jupiter.api.BeforeEach; |
| 26 | import org.junit.jupiter.api.Test; |
28 | 27 | |
29 | 28 | /** |
30 | 29 | * Unit tests of {@link ChangePropertyKeyCommand} class. |
31 | 30 | */ |
| 31 | @I18n |
| 32 | // We need prefs for nodes. |
| 33 | @BasicPreferences |
32 | 34 | class ChangePropertyKeyCommandTest { |
33 | | |
34 | | /** |
35 | | * We need prefs for nodes. |
36 | | */ |
37 | | @RegisterExtension |
38 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
39 | | public JOSMTestRules test = new JOSMTestRules().preferences().i18n(); |
40 | 35 | private CommandTestData testData; |
41 | 36 | |
42 | 37 | /** |
-
diff --git a/test/unit/org/openstreetmap/josm/command/ChangeRelationMemberRoleCommandTest.java b/test/unit/org/openstreetmap/josm/command/ChangeRelationMemberRoleCommandTest.java
index 1bd3066bc..80a792153 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
9 | 9 | |
10 | 10 | import java.util.ArrayList; |
11 | 11 | |
12 | | import org.junit.jupiter.api.BeforeEach; |
13 | | import org.junit.jupiter.api.Test; |
14 | | import org.junit.jupiter.api.extension.RegisterExtension; |
15 | 12 | import org.openstreetmap.josm.TestUtils; |
16 | 13 | import org.openstreetmap.josm.command.CommandTest.CommandTestDataWithRelation; |
17 | 14 | import org.openstreetmap.josm.data.osm.DataSet; |
… |
… |
import org.openstreetmap.josm.data.osm.OsmPrimitive;
|
19 | 16 | import org.openstreetmap.josm.data.osm.Relation; |
20 | 17 | import org.openstreetmap.josm.data.osm.User; |
21 | 18 | import org.openstreetmap.josm.gui.layer.OsmDataLayer; |
22 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 19 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
| 20 | import org.openstreetmap.josm.testutils.annotations.I18n; |
23 | 21 | |
24 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
25 | 22 | import nl.jqno.equalsverifier.EqualsVerifier; |
26 | 23 | import nl.jqno.equalsverifier.Warning; |
| 24 | import org.junit.jupiter.api.BeforeEach; |
| 25 | import org.junit.jupiter.api.Test; |
27 | 26 | |
28 | 27 | /** |
29 | 28 | * Unit tests of {@link ChangeRelationMemberRoleCommand} class. |
30 | 29 | */ |
| 30 | @I18n |
| 31 | // We need prefs for nodes. |
| 32 | @BasicPreferences |
31 | 33 | class ChangeRelationMemberRoleCommandTest { |
32 | | |
33 | | /** |
34 | | * We need prefs for nodes. |
35 | | */ |
36 | | @RegisterExtension |
37 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
38 | | public JOSMTestRules test = new JOSMTestRules().preferences().i18n(); |
39 | 34 | private CommandTestDataWithRelation testData; |
40 | 35 | |
41 | 36 | /** |
-
diff --git a/test/unit/org/openstreetmap/josm/command/CommandTest.java b/test/unit/org/openstreetmap/josm/command/CommandTest.java
index 30986bebc..302b81953 100644
a
|
b
|
package org.openstreetmap.josm.command;
|
3 | 3 | |
4 | 4 | import java.util.Arrays; |
5 | 5 | |
6 | | import org.junit.jupiter.api.Test; |
7 | | import org.junit.jupiter.api.extension.RegisterExtension; |
8 | 6 | import org.openstreetmap.josm.TestUtils; |
9 | 7 | import org.openstreetmap.josm.data.coor.LatLon; |
10 | 8 | import org.openstreetmap.josm.data.osm.DataSet; |
… |
… |
import org.openstreetmap.josm.data.osm.User;
|
15 | 13 | import org.openstreetmap.josm.data.osm.Way; |
16 | 14 | import org.openstreetmap.josm.gui.MainApplication; |
17 | 15 | import org.openstreetmap.josm.gui.layer.OsmDataLayer; |
18 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 16 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
| 17 | import org.openstreetmap.josm.testutils.annotations.I18n; |
19 | 18 | |
20 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
21 | 19 | import nl.jqno.equalsverifier.EqualsVerifier; |
22 | 20 | import nl.jqno.equalsverifier.Warning; |
| 21 | import org.junit.jupiter.api.Test; |
23 | 22 | |
24 | 23 | /** |
25 | 24 | * Unit tests of {@link Command} class. |
26 | 25 | */ |
| 26 | @I18n |
| 27 | // We need prefs for nodes / data sets. |
| 28 | @BasicPreferences |
27 | 29 | public class CommandTest { |
28 | | |
29 | | /** |
30 | | * We need prefs for nodes / data sets. |
31 | | */ |
32 | | @RegisterExtension |
33 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
34 | | public JOSMTestRules test = new JOSMTestRules().preferences().i18n(); |
35 | | |
36 | 30 | /** |
37 | 31 | * Unit test of methods {@link Command#equals} and {@link Command#hashCode}. |
38 | 32 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/command/DeleteCommandTest.java b/test/unit/org/openstreetmap/josm/command/DeleteCommandTest.java
index 448e65556..02e541e7a 100644
a
|
b
|
package org.openstreetmap.josm.command;
|
4 | 4 | import static org.junit.jupiter.api.Assertions.assertArrayEquals; |
5 | 5 | import static org.junit.jupiter.api.Assertions.assertEquals; |
6 | 6 | import static org.junit.jupiter.api.Assertions.assertFalse; |
7 | | import static org.junit.jupiter.api.Assertions.assertTrue; |
8 | 7 | import static org.junit.jupiter.api.Assertions.assertThrows; |
| 8 | import static org.junit.jupiter.api.Assertions.assertTrue; |
9 | 9 | |
10 | 10 | import java.util.ArrayList; |
11 | 11 | import java.util.Arrays; |
… |
… |
import java.util.Collection;
|
13 | 13 | import java.util.List; |
14 | 14 | import java.util.NoSuchElementException; |
15 | 15 | |
16 | | import org.junit.jupiter.api.BeforeEach; |
17 | | import org.junit.jupiter.api.Test; |
18 | | import org.junit.jupiter.api.extension.RegisterExtension; |
19 | 16 | import org.openstreetmap.josm.TestUtils; |
20 | 17 | import org.openstreetmap.josm.command.CommandTest.CommandTestDataWithRelation; |
21 | 18 | import org.openstreetmap.josm.data.osm.DataSet; |
… |
… |
import org.openstreetmap.josm.data.osm.User;
|
26 | 23 | import org.openstreetmap.josm.data.osm.Way; |
27 | 24 | import org.openstreetmap.josm.data.osm.WaySegment; |
28 | 25 | import org.openstreetmap.josm.gui.layer.OsmDataLayer; |
29 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 26 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
| 27 | import org.openstreetmap.josm.testutils.annotations.I18n; |
30 | 28 | |
31 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
32 | 29 | import nl.jqno.equalsverifier.EqualsVerifier; |
33 | 30 | import nl.jqno.equalsverifier.Warning; |
| 31 | import org.junit.jupiter.api.BeforeEach; |
| 32 | import org.junit.jupiter.api.Test; |
34 | 33 | |
35 | 34 | /** |
36 | 35 | * Unit tests of {@link DeleteCommand} class. |
37 | 36 | */ |
| 37 | // We need prefs for nodes. |
| 38 | @BasicPreferences |
| 39 | @I18n |
38 | 40 | class DeleteCommandTest { |
39 | | |
40 | | /** |
41 | | * We need prefs for nodes. |
42 | | */ |
43 | | @RegisterExtension |
44 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
45 | | public JOSMTestRules test = new JOSMTestRules().preferences().i18n(); |
46 | 41 | private CommandTestDataWithRelation testData; |
47 | 42 | |
48 | 43 | /** |
-
diff --git a/test/unit/org/openstreetmap/josm/command/PurgeCommandTest.java b/test/unit/org/openstreetmap/josm/command/PurgeCommandTest.java
index 86a6df45e..2d65a6368 100644
a
|
b
|
import java.util.ArrayList;
|
12 | 12 | import java.util.Arrays; |
13 | 13 | import java.util.List; |
14 | 14 | |
15 | | import org.junit.jupiter.api.BeforeEach; |
16 | | import org.junit.jupiter.api.Test; |
17 | | import org.junit.jupiter.api.extension.RegisterExtension; |
18 | 15 | import org.openstreetmap.josm.TestUtils; |
19 | 16 | import org.openstreetmap.josm.command.CommandTest.CommandTestDataWithRelation; |
20 | 17 | import org.openstreetmap.josm.data.conflict.Conflict; |
… |
… |
import org.openstreetmap.josm.data.osm.RelationMember;
|
27 | 24 | import org.openstreetmap.josm.data.osm.Storage; |
28 | 25 | import org.openstreetmap.josm.data.osm.User; |
29 | 26 | import org.openstreetmap.josm.gui.layer.OsmDataLayer; |
30 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 27 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
31 | 28 | |
32 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
33 | 29 | import nl.jqno.equalsverifier.EqualsVerifier; |
34 | 30 | import nl.jqno.equalsverifier.Warning; |
| 31 | import org.junit.jupiter.api.BeforeEach; |
| 32 | import org.junit.jupiter.api.Test; |
35 | 33 | |
36 | 34 | /** |
37 | 35 | * Unit tests of {@link PurgeCommand} class. |
38 | 36 | */ |
| 37 | // We need prefs for nodes. |
| 38 | @BasicPreferences |
39 | 39 | class PurgeCommandTest { |
40 | | /** |
41 | | * We need prefs for nodes. |
42 | | */ |
43 | | @RegisterExtension |
44 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
45 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
46 | 40 | private CommandTestDataWithRelation testData; |
47 | 41 | |
48 | 42 | /** |
-
diff --git a/test/unit/org/openstreetmap/josm/command/RemoveNodesCommandTest.java b/test/unit/org/openstreetmap/josm/command/RemoveNodesCommandTest.java
index dc8662c33..4dacadcbe 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
8 | 8 | import java.util.ArrayList; |
9 | 9 | import java.util.Collections; |
10 | 10 | |
11 | | import org.junit.jupiter.api.BeforeEach; |
12 | | import org.junit.jupiter.api.Test; |
13 | | import org.junit.jupiter.api.extension.RegisterExtension; |
14 | 11 | import org.openstreetmap.josm.TestUtils; |
15 | 12 | import org.openstreetmap.josm.command.CommandTest.CommandTestDataWithRelation; |
16 | 13 | import org.openstreetmap.josm.data.osm.DataSet; |
… |
… |
import org.openstreetmap.josm.data.osm.OsmPrimitive;
|
18 | 15 | import org.openstreetmap.josm.data.osm.User; |
19 | 16 | import org.openstreetmap.josm.data.osm.Way; |
20 | 17 | import org.openstreetmap.josm.gui.layer.OsmDataLayer; |
21 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 18 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
22 | 19 | |
23 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
24 | 20 | import nl.jqno.equalsverifier.EqualsVerifier; |
25 | 21 | import nl.jqno.equalsverifier.Warning; |
| 22 | import org.junit.jupiter.api.BeforeEach; |
| 23 | import org.junit.jupiter.api.Test; |
26 | 24 | |
27 | 25 | /** |
28 | 26 | * Unit tests of {@link RemoveNodesCommand} class. |
29 | 27 | */ |
| 28 | // We need prefs for nodes. |
| 29 | @BasicPreferences |
30 | 30 | class RemoveNodesCommandTest { |
31 | | |
32 | | /** |
33 | | * We need prefs for nodes. |
34 | | */ |
35 | | @RegisterExtension |
36 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
37 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
38 | 31 | private CommandTestDataWithRelation testData; |
39 | 32 | |
40 | 33 | /** |
-
diff --git a/test/unit/org/openstreetmap/josm/command/SelectCommandTest.java b/test/unit/org/openstreetmap/josm/command/SelectCommandTest.java
index 8304ea28e..c61e85892 100644
a
|
b
|
package org.openstreetmap.josm.command;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertArrayEquals; |
5 | 5 | import static org.junit.jupiter.api.Assertions.assertFalse; |
6 | | import static org.junit.jupiter.api.Assertions.assertTrue; |
7 | 6 | import static org.junit.jupiter.api.Assertions.assertThrows; |
| 7 | import static org.junit.jupiter.api.Assertions.assertTrue; |
8 | 8 | |
9 | 9 | import java.util.ArrayList; |
10 | 10 | import java.util.Arrays; |
11 | 11 | import java.util.List; |
12 | 12 | |
13 | | import org.junit.jupiter.api.BeforeEach; |
14 | | import org.junit.jupiter.api.Test; |
15 | | import org.junit.jupiter.api.extension.RegisterExtension; |
16 | 13 | import org.openstreetmap.josm.TestUtils; |
17 | 14 | import org.openstreetmap.josm.command.CommandTest.CommandTestDataWithRelation; |
18 | 15 | import org.openstreetmap.josm.data.osm.DataSet; |
19 | 16 | import org.openstreetmap.josm.data.osm.OsmPrimitive; |
20 | 17 | import org.openstreetmap.josm.data.osm.User; |
21 | 18 | import org.openstreetmap.josm.gui.layer.OsmDataLayer; |
22 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 19 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
23 | 20 | |
24 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
25 | 21 | import nl.jqno.equalsverifier.EqualsVerifier; |
26 | 22 | import nl.jqno.equalsverifier.Warning; |
| 23 | import org.junit.jupiter.api.BeforeEach; |
| 24 | import org.junit.jupiter.api.Test; |
27 | 25 | |
28 | 26 | /** |
29 | 27 | * Unit tests of {@link SelectCommand} class. |
30 | 28 | */ |
| 29 | // We need prefs for nodes. |
| 30 | @BasicPreferences |
31 | 31 | class SelectCommandTest { |
32 | | |
33 | | /** |
34 | | * We need prefs for nodes. |
35 | | */ |
36 | | @RegisterExtension |
37 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
38 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
39 | 32 | private CommandTestDataWithRelation testData; |
40 | 33 | |
41 | 34 | /** |
-
diff --git a/test/unit/org/openstreetmap/josm/command/SequenceCommandTest.java b/test/unit/org/openstreetmap/josm/command/SequenceCommandTest.java
index 7945c60fb..71b7941ff 100644
a
|
b
|
import java.util.Arrays;
|
18 | 18 | import java.util.Collection; |
19 | 19 | import java.util.Collections; |
20 | 20 | |
21 | | import org.junit.jupiter.api.BeforeEach; |
22 | | import org.junit.jupiter.api.Test; |
23 | | import org.junit.jupiter.api.extension.RegisterExtension; |
24 | 21 | import org.openstreetmap.josm.TestUtils; |
25 | 22 | import org.openstreetmap.josm.command.CommandTest.CommandTestDataWithRelation; |
26 | 23 | import org.openstreetmap.josm.data.osm.DataSet; |
… |
… |
import org.openstreetmap.josm.data.osm.Node;
|
28 | 25 | import org.openstreetmap.josm.data.osm.OsmPrimitive; |
29 | 26 | import org.openstreetmap.josm.data.osm.User; |
30 | 27 | import org.openstreetmap.josm.gui.layer.OsmDataLayer; |
31 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 28 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
32 | 29 | import org.openstreetmap.josm.tools.bugreport.ReportedException; |
33 | 30 | |
34 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
35 | 31 | import nl.jqno.equalsverifier.EqualsVerifier; |
36 | 32 | import nl.jqno.equalsverifier.Warning; |
| 33 | import org.junit.jupiter.api.BeforeEach; |
| 34 | import org.junit.jupiter.api.Test; |
37 | 35 | |
38 | 36 | /** |
39 | 37 | * Unit tests of {@link SequenceCommand} class. |
40 | 38 | */ |
| 39 | // We need prefs for nodes. |
| 40 | @BasicPreferences |
41 | 41 | class SequenceCommandTest { |
42 | | |
43 | | /** |
44 | | * We need prefs for nodes. |
45 | | */ |
46 | | @RegisterExtension |
47 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
48 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
49 | 42 | private CommandTestDataWithRelation testData; |
50 | 43 | |
51 | 44 | /** |
-
diff --git a/test/unit/org/openstreetmap/josm/data/PreferencesUtilsTest.java b/test/unit/org/openstreetmap/josm/data/PreferencesUtilsTest.java
index dc2b77b2e..4066a13ab 100644
a
|
b
|
package org.openstreetmap.josm.data;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertEquals; |
5 | 5 | |
6 | | import org.junit.jupiter.api.BeforeEach; |
7 | | import org.junit.jupiter.api.Test; |
8 | | import org.junit.jupiter.api.extension.RegisterExtension; |
9 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 6 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
10 | 7 | |
11 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
12 | 8 | import net.trajano.commons.testing.UtilityClassTestUtil; |
| 9 | import org.junit.jupiter.api.BeforeEach; |
| 10 | import org.junit.jupiter.api.Test; |
13 | 11 | |
14 | 12 | /** |
15 | 13 | * Unit tests for class {@link PreferencesUtils}. |
16 | 14 | */ |
| 15 | @BasicPreferences |
17 | 16 | class PreferencesUtilsTest { |
18 | | |
19 | | /** |
20 | | * Setup test. |
21 | | */ |
22 | | @RegisterExtension |
23 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
24 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
25 | | |
26 | 17 | /** |
27 | 18 | * Setup test. |
28 | 19 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/data/UserIdentityManagerTest.java b/test/unit/org/openstreetmap/josm/data/UserIdentityManagerTest.java
index 538575877..4bb4d5fd3 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
6 | 6 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
7 | 7 | import static org.junit.jupiter.api.Assertions.assertNull; |
8 | 8 | import static org.junit.jupiter.api.Assertions.assertSame; |
9 | | import static org.junit.jupiter.api.Assertions.assertTrue; |
10 | 9 | import static org.junit.jupiter.api.Assertions.assertThrows; |
| 10 | import static org.junit.jupiter.api.Assertions.assertTrue; |
| 11 | import static org.junit.jupiter.api.Assertions.fail; |
| 12 | |
| 13 | import java.util.function.Function; |
| 14 | import java.util.stream.Stream; |
11 | 15 | |
12 | | import org.junit.jupiter.api.Test; |
13 | | import org.junit.jupiter.api.extension.RegisterExtension; |
14 | 16 | import org.openstreetmap.josm.data.osm.User; |
15 | 17 | import org.openstreetmap.josm.data.osm.UserInfo; |
16 | 18 | import org.openstreetmap.josm.spi.preferences.Config; |
17 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 19 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
18 | 20 | |
19 | 21 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 22 | import org.junit.jupiter.api.Test; |
| 23 | import org.junit.jupiter.params.ParameterizedTest; |
| 24 | import org.junit.jupiter.params.provider.Arguments; |
| 25 | import org.junit.jupiter.params.provider.MethodSource; |
20 | 26 | |
21 | 27 | /** |
22 | 28 | * Unit tests of {@link UserIdentityManager} class. |
23 | 29 | */ |
| 30 | @BasicPreferences |
24 | 31 | class UserIdentityManagerTest { |
25 | | |
26 | | /** |
27 | | * Setup test. |
28 | | */ |
29 | | @RegisterExtension |
30 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
31 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
32 | | |
33 | 32 | private static UserInfo newUserInfo() { |
34 | 33 | return newUserInfo(1, "a description"); |
35 | 34 | } |
… |
… |
class UserIdentityManagerTest {
|
179 | 178 | assertThrows(IllegalArgumentException.class, () -> UserIdentityManager.getInstance().setFullyIdentified("test", null)); |
180 | 179 | } |
181 | 180 | |
182 | | /** |
183 | | * Preferences include neither an url nor a user name => we have an anonymous user |
184 | | */ |
185 | | @Test |
186 | | void testInitFromPreferences1() { |
187 | | UserIdentityManager im = UserIdentityManager.getInstance(); |
188 | | |
189 | | // reset it |
190 | | im.setAnonymous(); |
191 | | |
192 | | // for this test we disable the listener |
193 | | Config.getPref().removePreferenceChangeListener(im); |
194 | | |
195 | | try { |
196 | | Config.getPref().put("osm-server.url", null); |
197 | | Config.getPref().put("osm-server.username", null); |
198 | | |
199 | | im.initFromPreferences(); |
200 | | |
201 | | assertTrue(im.isAnonymous()); |
202 | | } finally { |
203 | | Config.getPref().addPreferenceChangeListener(im); |
204 | | } |
| 181 | static Stream<Arguments> testInitFromPreferences() { |
| 182 | return Stream.of( |
| 183 | Arguments.of((Function<UserIdentityManager, Boolean>) UserIdentityManager::isAnonymous, |
| 184 | new String[] {"osm-server.url", null, "osm-server.username", null}, |
| 185 | "Preferences include neither an url nor a user name => we have an anonymous user"), |
| 186 | Arguments.of((Function<UserIdentityManager, Boolean>) UserIdentityManager::isAnonymous, |
| 187 | new String[] {"osm-server.url", "http://api.openstreetmap.org", "osm-server.username", null}, |
| 188 | "Preferences include neither an url nor a user name => we have an anonymous user"), |
| 189 | Arguments.of((Function<UserIdentityManager, Boolean>) UserIdentityManager::isPartiallyIdentified, |
| 190 | new String[] {"osm-server.url", "http://api.openstreetmap.org", "osm-server.username", "test"}, |
| 191 | "Preferences include an user name => we have a partially identified user") |
| 192 | ); |
205 | 193 | } |
206 | 194 | |
207 | | /** |
208 | | * Preferences include neither an url nor a user name => we have an anonymous user |
209 | | */ |
210 | | @Test |
211 | | void testInitFromPreferences2() { |
| 195 | @ParameterizedTest |
| 196 | @MethodSource |
| 197 | void testInitFromPreferences(Function<UserIdentityManager, Boolean> verifier, String[] config, String failureMessage) { |
| 198 | if (config.length % 2 != 0) { |
| 199 | fail("The arguments must be paired"); |
| 200 | } |
212 | 201 | UserIdentityManager im = UserIdentityManager.getInstance(); |
213 | 202 | |
214 | 203 | // reset it |
… |
… |
class UserIdentityManagerTest {
|
218 | 207 | Config.getPref().removePreferenceChangeListener(im); |
219 | 208 | |
220 | 209 | try { |
221 | | Config.getPref().put("osm-server.url", "http://api.openstreetmap.org"); |
222 | | Config.getPref().put("osm-server.username", null); |
223 | | |
224 | | im.initFromPreferences(); |
225 | | |
226 | | assertTrue(im.isAnonymous()); |
227 | | } finally { |
228 | | Config.getPref().addPreferenceChangeListener(im); |
229 | | } |
230 | | } |
231 | | |
232 | | /** |
233 | | * Preferences include an user name => we have a partially identified user |
234 | | */ |
235 | | @Test |
236 | | void testInitFromPreferences3() { |
237 | | UserIdentityManager im = UserIdentityManager.getInstance(); |
238 | | |
239 | | // for this test we disable the listener |
240 | | Config.getPref().removePreferenceChangeListener(im); |
241 | | |
242 | | try { |
243 | | // reset it |
244 | | im.setAnonymous(); |
245 | | |
246 | | Config.getPref().put("osm-server.url", "http://api.openstreetmap.org"); |
247 | | Config.getPref().put("osm-server.username", "test"); |
| 210 | for (int i = 0; i < config.length / 2; i++) { |
| 211 | Config.getPref().put(config[2 * i], config[2 * i + 1]); |
| 212 | } |
248 | 213 | |
249 | 214 | im.initFromPreferences(); |
250 | 215 | |
251 | | assertTrue(im.isPartiallyIdentified()); |
| 216 | assertTrue(verifier.apply(im), failureMessage); |
252 | 217 | } finally { |
253 | 218 | Config.getPref().addPreferenceChangeListener(im); |
254 | 219 | } |
… |
… |
class UserIdentityManagerTest {
|
258 | 223 | * Preferences include an user name which is different from the current |
259 | 224 | * user name and we are currently fully identifed => josm user becomes |
260 | 225 | * partially identified |
| 226 | * |
| 227 | * Note: Test #4 since the other three are parameterized |
261 | 228 | */ |
262 | 229 | @Test |
263 | 230 | void testInitFromPreferences4() { |
-
diff --git a/test/unit/org/openstreetmap/josm/data/cache/JCSCacheManagerTest.java b/test/unit/org/openstreetmap/josm/data/cache/JCSCacheManagerTest.java
index 4157a945a..b07c2d483 100644
a
|
b
|
import java.io.FileOutputStream;
|
8 | 8 | import java.io.IOException; |
9 | 9 | import java.util.logging.Logger; |
10 | 10 | |
| 11 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
| 12 | |
| 13 | import net.trajano.commons.testing.UtilityClassTestUtil; |
11 | 14 | import org.apache.commons.jcs3.access.CacheAccess; |
12 | 15 | import org.apache.commons.jcs3.auxiliary.disk.block.BlockDiskCacheAttributes; |
13 | 16 | import org.junit.jupiter.api.Test; |
14 | | import org.junit.jupiter.api.extension.RegisterExtension; |
15 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
16 | | |
17 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
18 | | import net.trajano.commons.testing.UtilityClassTestUtil; |
| 17 | import org.junit.jupiter.api.Timeout; |
19 | 18 | |
20 | 19 | /** |
21 | 20 | * Unit tests for class {@link JCSCacheManager}. |
22 | 21 | */ |
| 22 | @Timeout(20) |
| 23 | @BasicPreferences |
23 | 24 | class JCSCacheManagerTest { |
24 | | |
25 | | /** |
26 | | * Setup test. |
27 | | */ |
28 | | @RegisterExtension |
29 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
30 | | public JOSMTestRules test = new JOSMTestRules().preferences().timeout(20000); |
31 | | |
32 | 25 | /** |
33 | 26 | * Tests that {@code JCSCacheManager} satisfies utility class criteria. |
34 | 27 | * @throws ReflectiveOperationException if an error occurs |
-
diff --git a/test/unit/org/openstreetmap/josm/data/osm/TagCollectionTest.java b/test/unit/org/openstreetmap/josm/data/osm/TagCollectionTest.java
index 1d82e2e80..759bd5093 100644
a
|
b
|
import java.util.Set;
|
16 | 16 | import java.util.stream.Collectors; |
17 | 17 | import java.util.stream.Stream; |
18 | 18 | |
19 | | import org.junit.jupiter.api.Test; |
20 | | import org.junit.jupiter.api.extension.RegisterExtension; |
21 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 19 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
22 | 20 | |
23 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 21 | import org.junit.jupiter.api.Test; |
24 | 22 | |
25 | 23 | /** |
26 | 24 | * Tests of {@link TagCollection}. |
27 | 25 | * @author Michael Zangl |
28 | 26 | */ |
| 27 | // We need prefs for using primitives |
| 28 | @BasicPreferences |
29 | 29 | class TagCollectionTest { |
30 | 30 | private final Tag tagA = new Tag("k", "v"); |
31 | 31 | private final Tag tagB = new Tag("k", "b"); |
… |
… |
class TagCollectionTest {
|
35 | 35 | private final Tag tagNullKey = new Tag(null, "b"); |
36 | 36 | private final Tag tagNullValue = new Tag("k2", null); |
37 | 37 | |
38 | | /** |
39 | | * We need prefs for using primitives |
40 | | */ |
41 | | @RegisterExtension |
42 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
43 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
44 | | |
45 | 38 | private void assertTagCounts(TagCollection collection, int a, int b, int c, int d) { |
46 | 39 | assertEquals(a, collection.getTagOccurrence(tagA)); |
47 | 40 | assertEquals(b, collection.getTagOccurrence(tagB)); |
-
diff --git a/test/unit/org/openstreetmap/josm/data/osm/event/SelectionEventManagerTest.java b/test/unit/org/openstreetmap/josm/data/osm/event/SelectionEventManagerTest.java
index cbae3921b..96eea98ac 100644
a
|
b
|
import java.util.Collection;
|
8 | 8 | import java.util.HashSet; |
9 | 9 | import java.util.List; |
10 | 10 | |
11 | | import org.junit.jupiter.api.Test; |
12 | | import org.junit.jupiter.api.extension.RegisterExtension; |
13 | 11 | import org.openstreetmap.josm.command.CommandTest.CommandTestDataWithRelation; |
14 | 12 | import org.openstreetmap.josm.data.osm.DataSelectionListener; |
15 | 13 | import org.openstreetmap.josm.data.osm.OsmPrimitive; |
16 | 14 | import org.openstreetmap.josm.gui.MainApplication; |
17 | 15 | import org.openstreetmap.josm.gui.util.GuiHelper; |
18 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 16 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
19 | 17 | |
20 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 18 | import org.junit.jupiter.api.Test; |
21 | 19 | |
22 | 20 | /** |
23 | 21 | * Tests the {@link SelectionEventManager} |
24 | 22 | * @author Michael Zangl |
25 | 23 | * @since 12048 |
26 | 24 | */ |
| 25 | @BasicPreferences |
27 | 26 | class SelectionEventManagerTest { |
28 | 27 | private final class SelectionListener implements DataSelectionListener { |
29 | 28 | private Collection<? extends OsmPrimitive> newSelection; |
… |
… |
class SelectionEventManagerTest {
|
39 | 38 | } |
40 | 39 | } |
41 | 40 | |
42 | | /** |
43 | | */ |
44 | | @RegisterExtension |
45 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
46 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
47 | | |
48 | 41 | /** |
49 | 42 | * Tests that events in the active layer are propagated. |
50 | 43 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/data/osm/search/SearchCompilerTest.java b/test/unit/org/openstreetmap/josm/data/osm/search/SearchCompilerTest.java
index b8f4f2a73..9545c88cd 100644
a
|
b
|
import java.util.Collection;
|
18 | 18 | import java.util.Collections; |
19 | 19 | import java.util.Set; |
20 | 20 | |
21 | | import org.junit.Assert; |
22 | | import org.junit.jupiter.api.Test; |
23 | | import org.junit.jupiter.api.extension.RegisterExtension; |
24 | 21 | import org.openstreetmap.josm.TestUtils; |
25 | 22 | import org.openstreetmap.josm.data.coor.LatLon; |
26 | 23 | import org.openstreetmap.josm.data.osm.DataSet; |
… |
… |
import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetMenu;
|
42 | 39 | import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetType; |
43 | 40 | import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets; |
44 | 41 | import org.openstreetmap.josm.gui.tagging.presets.items.Key; |
45 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 42 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
46 | 43 | import org.openstreetmap.josm.tools.Logging; |
47 | 44 | |
48 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
49 | 45 | import nl.jqno.equalsverifier.EqualsVerifier; |
50 | 46 | import nl.jqno.equalsverifier.Warning; |
| 47 | import org.junit.Assert; |
| 48 | import org.junit.jupiter.api.Test; |
| 49 | import org.junit.jupiter.api.Timeout; |
51 | 50 | |
52 | 51 | /** |
53 | 52 | * Unit tests for class {@link SearchCompiler}. |
54 | 53 | */ |
| 54 | // We need prefs for this. We access preferences when creating OSM primitives |
| 55 | @BasicPreferences |
| 56 | @Timeout(30) |
55 | 57 | class SearchCompilerTest { |
56 | | |
57 | | /** |
58 | | * We need prefs for this. We access preferences when creating OSM primitives. |
59 | | */ |
60 | | @RegisterExtension |
61 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
62 | | public JOSMTestRules test = new JOSMTestRules().preferences().timeout(30000); |
63 | | |
64 | 58 | private static final class SearchContext { |
65 | 59 | final DataSet ds = new DataSet(); |
66 | 60 | final Node n1 = new Node(LatLon.ZERO); |
-
diff --git a/test/unit/org/openstreetmap/josm/data/preferences/NamedColorPropertyTest.java b/test/unit/org/openstreetmap/josm/data/preferences/NamedColorPropertyTest.java
index bba3ef891..23418b471 100644
a
|
b
|
import java.util.Collections;
|
10 | 10 | |
11 | 11 | import javax.swing.UIManager; |
12 | 12 | |
13 | | import org.junit.jupiter.api.BeforeEach; |
14 | | import org.junit.jupiter.api.Test; |
15 | | import org.junit.jupiter.api.extension.RegisterExtension; |
16 | 13 | import org.openstreetmap.josm.data.Preferences; |
17 | 14 | import org.openstreetmap.josm.spi.preferences.Config; |
18 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 15 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
19 | 16 | |
20 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 17 | import org.junit.jupiter.api.BeforeEach; |
| 18 | import org.junit.jupiter.api.Test; |
21 | 19 | |
22 | 20 | /** |
23 | 21 | * Test {@link NamedColorProperty} |
24 | 22 | * @author Michael Zangl |
25 | 23 | */ |
| 24 | // This is a preference test |
| 25 | @BasicPreferences |
26 | 26 | class NamedColorPropertyTest { |
27 | | /** |
28 | | * This is a preference test. |
29 | | */ |
30 | | @RegisterExtension |
31 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
32 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
33 | 27 | private NamedColorProperty base; |
34 | 28 | |
35 | 29 | /** |
-
diff --git a/test/unit/org/openstreetmap/josm/data/preferences/PreferencesWriterTest.java b/test/unit/org/openstreetmap/josm/data/preferences/PreferencesWriterTest.java
index e9a56df73..b9bb49fae 100644
a
|
b
|
import java.util.Map;
|
12 | 12 | import java.util.SortedMap; |
13 | 13 | import java.util.TreeMap; |
14 | 14 | |
15 | | import org.junit.jupiter.api.Test; |
16 | 15 | import org.openstreetmap.josm.data.Version; |
17 | | import org.openstreetmap.josm.spi.preferences.Setting; |
| 16 | import org.openstreetmap.josm.spi.preferences.AbstractSetting; |
18 | 17 | import org.openstreetmap.josm.spi.preferences.ListListSetting; |
19 | 18 | import org.openstreetmap.josm.spi.preferences.ListSetting; |
20 | | import org.openstreetmap.josm.spi.preferences.AbstractSetting; |
21 | | import org.openstreetmap.josm.spi.preferences.StringSetting; |
22 | 19 | import org.openstreetmap.josm.spi.preferences.MapListSetting; |
| 20 | import org.openstreetmap.josm.spi.preferences.Setting; |
| 21 | import org.openstreetmap.josm.spi.preferences.StringSetting; |
| 22 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
| 23 | |
| 24 | import org.junit.jupiter.api.Test; |
23 | 25 | |
24 | 26 | /** |
25 | 27 | * Unit tests for class {@link PreferencesWriter}. |
26 | 28 | */ |
| 29 | // This is a preference test |
| 30 | @BasicPreferences |
27 | 31 | class PreferencesWriterTest { |
28 | 32 | |
29 | 33 | private static <T extends AbstractSetting<?>> T setting(T s, long time) { |
-
diff --git a/test/unit/org/openstreetmap/josm/data/preferences/StrokePropertyTest.java b/test/unit/org/openstreetmap/josm/data/preferences/StrokePropertyTest.java
index 65eaab5d3..d4f81bfe1 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
6 | 6 | |
7 | 7 | import java.awt.BasicStroke; |
8 | 8 | |
9 | | import org.junit.jupiter.api.extension.RegisterExtension; |
10 | | import org.junit.jupiter.api.Test; |
11 | 9 | import org.openstreetmap.josm.spi.preferences.Config; |
12 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 10 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
13 | 11 | |
14 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 12 | import org.junit.jupiter.api.Test; |
15 | 13 | |
16 | 14 | /** |
17 | 15 | * Test {@link StrokeProperty} |
18 | 16 | * @author Michael Zangl |
19 | 17 | */ |
| 18 | // This is a preference test |
| 19 | @BasicPreferences |
20 | 20 | class StrokePropertyTest { |
21 | | /** |
22 | | * This is a preference test |
23 | | */ |
24 | | @RegisterExtension |
25 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
26 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
27 | | |
28 | 21 | /** |
29 | 22 | * Test {@link StrokeProperty#get()} |
30 | 23 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/data/projection/CustomProjectionTest.java b/test/unit/org/openstreetmap/josm/data/projection/CustomProjectionTest.java
index b2966474b..1b8ae7654 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.fail;
|
7 | 7 | |
8 | 8 | import java.util.stream.Stream; |
9 | 9 | |
10 | | import org.junit.jupiter.api.extension.RegisterExtension; |
11 | | import org.junit.jupiter.api.Test; |
12 | 10 | import org.openstreetmap.josm.data.coor.LatLon; |
13 | 11 | import org.openstreetmap.josm.data.projection.CustomProjection.Polarity; |
14 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 12 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
15 | 13 | |
16 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 14 | import org.junit.jupiter.api.Test; |
17 | 15 | |
18 | 16 | /** |
19 | 17 | * Tests for {@link CustomProjection}. |
20 | 18 | * @author Michael Zangl |
21 | 19 | */ |
| 20 | // Need pref to load pref |
| 21 | @BasicPreferences |
22 | 22 | class CustomProjectionTest { |
23 | | /** |
24 | | * Need pref to load pref. |
25 | | */ |
26 | | @RegisterExtension |
27 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
28 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
29 | | |
30 | 23 | /** |
31 | 24 | * Test {@link CustomProjection#parseAngle(String, String)} |
32 | 25 | * @throws ProjectionConfigurationException in case of error |
-
diff --git a/test/unit/org/openstreetmap/josm/data/protobuf/ProtobufTest.java b/test/unit/org/openstreetmap/josm/data/protobuf/ProtobufTest.java
index 21f610f36..0844c6ebd 100644
a
|
b
|
import org.openstreetmap.josm.data.vector.VectorDataSet;
|
31 | 31 | import org.openstreetmap.josm.data.vector.VectorNode; |
32 | 32 | import org.openstreetmap.josm.data.vector.VectorWay; |
33 | 33 | import org.openstreetmap.josm.io.Compression; |
34 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 34 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
35 | 35 | |
36 | 36 | import org.junit.jupiter.api.Test; |
37 | | import org.junit.jupiter.api.extension.RegisterExtension; |
38 | 37 | |
39 | 38 | /** |
40 | 39 | * Test class for {@link ProtobufParser} and {@link ProtobufRecord} |
… |
… |
class ProtobufTest {
|
59 | 58 | return byteArray; |
60 | 59 | } |
61 | 60 | |
62 | | @RegisterExtension |
63 | | JOSMTestRules josmTestRules = new JOSMTestRules().preferences(); |
64 | | |
65 | 61 | private Number bytesToVarInt(int... bytes) { |
66 | 62 | byte[] byteArray = new byte[bytes.length]; |
67 | 63 | for (int i = 0; i < bytes.length; i++) { |
… |
… |
class ProtobufTest {
|
107 | 103 | assertEquals(0, Integer.parseInt(testSequence.getTags().get("pano"))); |
108 | 104 | } |
109 | 105 | |
| 106 | @BasicPreferences |
110 | 107 | @Test |
111 | 108 | void testRead_17_26028_50060() throws IOException { |
112 | 109 | File vectorTile = Paths.get(TestUtils.getTestDataRoot(), "pbf", "openinframap", "17", "26028", "50060.pbf") |
-
diff --git a/test/unit/org/openstreetmap/josm/data/validation/tests/DuplicateRelationTest.java b/test/unit/org/openstreetmap/josm/data/validation/tests/DuplicateRelationTest.java
index e36485922..c6676b105 100644
a
|
b
|
package org.openstreetmap.josm.data.validation.tests;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertEquals; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | | import org.junit.jupiter.api.Test; |
8 | 6 | import org.openstreetmap.josm.TestUtils; |
9 | 7 | import org.openstreetmap.josm.data.coor.LatLon; |
10 | 8 | import org.openstreetmap.josm.data.osm.DataSet; |
… |
… |
import org.openstreetmap.josm.data.osm.Node;
|
12 | 10 | import org.openstreetmap.josm.data.osm.RelationMember; |
13 | 11 | import org.openstreetmap.josm.data.validation.TestError; |
14 | 12 | import org.openstreetmap.josm.gui.progress.NullProgressMonitor; |
15 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 13 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
16 | 14 | |
17 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 15 | import org.junit.jupiter.api.Test; |
18 | 16 | |
19 | 17 | /** |
20 | 18 | * JUnit Test of "Duplicate relation" validation test. |
21 | 19 | */ |
| 20 | @BasicPreferences |
22 | 21 | class DuplicateRelationTest { |
23 | | |
24 | | /** |
25 | | * Setup test by initializing JOSM preferences and projection. |
26 | | */ |
27 | | @RegisterExtension |
28 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
29 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
30 | | |
31 | 22 | static class ExpectedResult { |
32 | 23 | final int code; |
33 | 24 | final boolean fixable; |
-
diff --git a/test/unit/org/openstreetmap/josm/data/validation/tests/OpeningHourTestTest.java b/test/unit/org/openstreetmap/josm/data/validation/tests/OpeningHourTestTest.java
index 646df05d5..b021ff219 100644
a
|
b
|
import java.util.List;
|
16 | 16 | import java.util.Locale; |
17 | 17 | import java.util.Set; |
18 | 18 | |
19 | | import org.junit.jupiter.api.BeforeEach; |
20 | | import org.junit.jupiter.api.Test; |
21 | | import org.junit.jupiter.api.extension.RegisterExtension; |
22 | 19 | import org.openstreetmap.josm.command.ChangePropertyCommand; |
23 | 20 | import org.openstreetmap.josm.data.coor.LatLon; |
24 | 21 | import org.openstreetmap.josm.data.osm.DataSet; |
… |
… |
import org.openstreetmap.josm.gui.tagging.presets.TaggingPreset;
|
31 | 28 | import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItem; |
32 | 29 | import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetReader; |
33 | 30 | import org.openstreetmap.josm.gui.tagging.presets.items.KeyedItem; |
34 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 31 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
| 32 | import org.openstreetmap.josm.testutils.annotations.I18n; |
35 | 33 | import org.openstreetmap.josm.tools.Logging; |
36 | 34 | |
37 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 35 | import org.junit.jupiter.api.BeforeEach; |
| 36 | import org.junit.jupiter.api.Test; |
38 | 37 | |
39 | 38 | /** |
40 | 39 | * JUnit Test of "Opening hours" validation test. |
41 | 40 | * @see OpeningHourTest |
42 | 41 | */ |
| 42 | @I18n |
| 43 | @BasicPreferences |
43 | 44 | class OpeningHourTestTest { |
44 | | /** |
45 | | * We need preferences for this. We check strings so we need i18n. |
46 | | */ |
47 | | @RegisterExtension |
48 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
49 | | public JOSMTestRules test = new JOSMTestRules().preferences().i18n(); |
50 | | |
51 | 45 | private OpeningHourTest openingHourTest; |
52 | 46 | |
53 | 47 | /** |
-
diff --git a/test/unit/org/openstreetmap/josm/data/validation/util/EntitiesTest.java b/test/unit/org/openstreetmap/josm/data/validation/util/EntitiesTest.java
index 9efebd1a5..f48f89f6f 100644
a
|
b
|
|
1 | 1 | // License: GPL. For details, see LICENSE file. |
2 | 2 | package org.openstreetmap.josm.data.validation.util; |
3 | 3 | |
4 | | import org.junit.jupiter.api.extension.RegisterExtension; |
5 | | import org.junit.jupiter.api.Test; |
6 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
7 | | |
8 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
9 | 4 | import net.trajano.commons.testing.UtilityClassTestUtil; |
| 5 | import org.junit.jupiter.api.Test; |
10 | 6 | |
11 | 7 | /** |
12 | 8 | * Unit tests for class {@link Entities}. |
13 | 9 | */ |
14 | 10 | class EntitiesTest { |
15 | | |
16 | | /** |
17 | | * Setup test. |
18 | | */ |
19 | | @RegisterExtension |
20 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
21 | | public JOSMTestRules test = new JOSMTestRules(); |
22 | | |
23 | 11 | /** |
24 | 12 | * Tests that {@code Entities} satisfies utility class criteria. |
25 | 13 | * @throws ReflectiveOperationException if an error occurs |
-
diff --git a/test/unit/org/openstreetmap/josm/data/validation/util/MultipleNameVisitorTest.java b/test/unit/org/openstreetmap/josm/data/validation/util/MultipleNameVisitorTest.java
index e12d1e23a..89e4a544b 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
5 | 5 | |
6 | 6 | import java.util.Arrays; |
7 | 7 | |
8 | | import org.junit.jupiter.api.extension.RegisterExtension; |
9 | | import org.junit.jupiter.api.Test; |
10 | 8 | import org.openstreetmap.josm.TestUtils; |
11 | 9 | import org.openstreetmap.josm.data.osm.Way; |
12 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 10 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
13 | 11 | |
14 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 12 | import org.junit.jupiter.api.Test; |
15 | 13 | |
16 | 14 | /** |
17 | 15 | * Unit tests for class {@link MultipleNameVisitor}. |
18 | 16 | */ |
| 17 | @BasicPreferences |
19 | 18 | class MultipleNameVisitorTest { |
20 | | |
21 | | /** |
22 | | * Setup test. |
23 | | */ |
24 | | @RegisterExtension |
25 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
26 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
27 | | |
28 | 19 | /** |
29 | 20 | * Non-regression test for bug #11967. |
30 | 21 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/data/vector/VectorRelationTest.java b/test/unit/org/openstreetmap/josm/data/vector/VectorRelationTest.java
index 57a724dad..2367dbe35 100644
a
|
b
|
|
1 | 1 | // License: GPL. For details, see LICENSE file. |
2 | 2 | package org.openstreetmap.josm.data.vector; |
3 | 3 | |
4 | | import org.junit.jupiter.api.Test; |
5 | | import org.junit.jupiter.api.extension.RegisterExtension; |
6 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
7 | | |
8 | | import java.util.Arrays; |
9 | | |
10 | 4 | import static org.junit.jupiter.api.Assertions.assertEquals; |
11 | 5 | import static org.junit.jupiter.api.Assertions.assertFalse; |
12 | 6 | import static org.junit.jupiter.api.Assertions.assertSame; |
13 | 7 | import static org.junit.jupiter.api.Assertions.assertThrows; |
14 | 8 | import static org.junit.jupiter.api.Assertions.assertTrue; |
15 | 9 | |
| 10 | import java.util.Arrays; |
| 11 | |
| 12 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
| 13 | |
| 14 | import org.junit.jupiter.api.Test; |
| 15 | |
16 | 16 | /** |
17 | 17 | * Test class for {@link VectorRelation} |
18 | 18 | * @author Taylor Smock |
19 | 19 | * @since 17862 |
20 | 20 | */ |
| 21 | @BasicPreferences |
21 | 22 | class VectorRelationTest { |
22 | | @RegisterExtension |
23 | | JOSMTestRules rule = new JOSMTestRules(); |
24 | | |
25 | 23 | @Test |
26 | 24 | void testMembers() { |
27 | 25 | VectorNode node1 = new VectorNode("test"); |
-
diff --git a/test/unit/org/openstreetmap/josm/data/vector/VectorWayTest.java b/test/unit/org/openstreetmap/josm/data/vector/VectorWayTest.java
index 508fb4a24..2dbf5f6cb 100644
a
|
b
|
|
1 | 1 | // License: GPL. For details, see LICENSE file. |
2 | 2 | package org.openstreetmap.josm.data.vector; |
3 | 3 | |
4 | | import org.junit.jupiter.api.Test; |
| 4 | import static org.junit.jupiter.api.Assertions.assertEquals; |
| 5 | import static org.junit.jupiter.api.Assertions.assertFalse; |
| 6 | import static org.junit.jupiter.api.Assertions.assertNull; |
| 7 | import static org.junit.jupiter.api.Assertions.assertSame; |
| 8 | import static org.junit.jupiter.api.Assertions.assertTrue; |
| 9 | import static org.junit.jupiter.api.Assertions.fail; |
| 10 | |
| 11 | import java.util.ArrayList; |
| 12 | import java.util.Arrays; |
| 13 | import java.util.Collections; |
| 14 | import java.util.List; |
| 15 | |
5 | 16 | import org.openstreetmap.josm.data.coor.LatLon; |
6 | 17 | import org.openstreetmap.josm.data.osm.BBox; |
7 | 18 | import org.openstreetmap.josm.data.osm.INode; |
… |
… |
import org.openstreetmap.josm.data.osm.IRelation;
|
9 | 20 | import org.openstreetmap.josm.data.osm.IWay; |
10 | 21 | import org.openstreetmap.josm.data.osm.OsmPrimitiveType; |
11 | 22 | import org.openstreetmap.josm.data.osm.visitor.PrimitiveVisitor; |
| 23 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
12 | 24 | |
13 | | import java.util.ArrayList; |
14 | | import java.util.Arrays; |
15 | | import java.util.Collections; |
16 | | import java.util.List; |
17 | | |
18 | | import static org.junit.jupiter.api.Assertions.assertEquals; |
19 | | import static org.junit.jupiter.api.Assertions.assertFalse; |
20 | | import static org.junit.jupiter.api.Assertions.assertNull; |
21 | | import static org.junit.jupiter.api.Assertions.assertSame; |
22 | | import static org.junit.jupiter.api.Assertions.assertTrue; |
23 | | import static org.junit.jupiter.api.Assertions.fail; |
| 25 | import org.junit.jupiter.api.Test; |
24 | 26 | |
25 | 27 | /** |
26 | 28 | * Test class for {@link VectorWay} |
… |
… |
class VectorWayTest {
|
49 | 51 | } |
50 | 52 | |
51 | 53 | @Test |
| 54 | @BasicPreferences |
52 | 55 | void testNodes() { |
53 | 56 | VectorNode node1 = new VectorNode("test"); |
54 | 57 | VectorNode node2 = new VectorNode("test"); |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/autofilter/AutoFilterRuleTest.java b/test/unit/org/openstreetmap/josm/gui/autofilter/AutoFilterRuleTest.java
index 52b0b790d..d68b4bcae 100644
a
|
b
|
import java.util.NoSuchElementException;
|
8 | 8 | import java.util.stream.Collectors; |
9 | 9 | import java.util.stream.IntStream; |
10 | 10 | |
11 | | import org.junit.jupiter.api.extension.RegisterExtension; |
12 | | import org.junit.jupiter.api.Test; |
13 | 11 | import org.openstreetmap.josm.data.osm.OsmPrimitive; |
14 | 12 | import org.openstreetmap.josm.data.osm.OsmUtils; |
15 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 13 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
| 14 | import org.openstreetmap.josm.testutils.annotations.I18n; |
16 | 15 | |
17 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 16 | import org.junit.jupiter.api.Test; |
18 | 17 | |
19 | 18 | /** |
20 | 19 | * Unit tests of {@link AutoFilterRule} class. |
21 | 20 | */ |
| 21 | @BasicPreferences |
| 22 | @I18n |
22 | 23 | class AutoFilterRuleTest { |
23 | | |
24 | | /** |
25 | | * Setup tests |
26 | | */ |
27 | | @RegisterExtension |
28 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
29 | | public JOSMTestRules test = new JOSMTestRules().i18n(); |
30 | | |
31 | 24 | /** |
32 | 25 | * Unit test of {@link AutoFilterRule#getTagValuesForPrimitive}. |
33 | 26 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/bbox/SizeButtonTest.java b/test/unit/org/openstreetmap/josm/gui/bbox/SizeButtonTest.java
index f0105178b..b54306338 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
5 | 5 | import static org.junit.jupiter.api.Assertions.assertFalse; |
6 | 6 | import static org.junit.jupiter.api.Assertions.assertTrue; |
7 | 7 | |
8 | | import org.junit.jupiter.api.extension.RegisterExtension; |
9 | | import org.junit.jupiter.api.Test; |
10 | 8 | import org.openstreetmap.josm.TestUtils; |
11 | 9 | import org.openstreetmap.josm.gui.bbox.SizeButton.AccessibleSizeButton; |
12 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 10 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
13 | 11 | |
14 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 12 | import org.junit.jupiter.api.Test; |
15 | 13 | |
16 | 14 | /** |
17 | 15 | * Unit tests of {@link SizeButton} class. |
18 | 16 | */ |
| 17 | @BasicPreferences |
19 | 18 | class SizeButtonTest { |
20 | | |
21 | | /** |
22 | | * Setup tests |
23 | | */ |
24 | | @RegisterExtension |
25 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
26 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
27 | | |
28 | 19 | /** |
29 | 20 | * Unit test of {@link SizeButton#SizeButton}. |
30 | 21 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/bugreport/BugReportSettingsPanelTest.java b/test/unit/org/openstreetmap/josm/gui/bugreport/BugReportSettingsPanelTest.java
index 755a05c20..d11ae1d79 100644
a
|
b
|
package org.openstreetmap.josm.gui.bugreport;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | | import org.junit.jupiter.api.Test; |
8 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
9 | 6 | import org.openstreetmap.josm.tools.bugreport.BugReport; |
10 | 7 | |
11 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 8 | import org.junit.jupiter.api.Test; |
12 | 9 | |
13 | 10 | /** |
14 | 11 | * Tests the {@link BugReportSettingsPanel} class. |
15 | 12 | */ |
16 | 13 | class BugReportSettingsPanelTest { |
17 | | |
18 | | /** |
19 | | * Setup test |
20 | | */ |
21 | | @RegisterExtension |
22 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
23 | | public JOSMTestRules test = new JOSMTestRules(); |
24 | | |
25 | 14 | /** |
26 | 15 | * Test {@link BugReportSettingsPanel} |
27 | 16 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/bugreport/DebugTextDisplayTest.java b/test/unit/org/openstreetmap/josm/gui/bugreport/DebugTextDisplayTest.java
index 3d97f6a02..302363a31 100644
a
|
b
|
package org.openstreetmap.josm.gui.bugreport;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertEquals; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | | import org.junit.jupiter.api.Test; |
8 | 6 | import org.openstreetmap.josm.gui.datatransfer.ClipboardUtils; |
9 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 7 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
10 | 8 | |
11 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 9 | import org.junit.jupiter.api.Test; |
12 | 10 | |
13 | 11 | /** |
14 | 12 | * Unit test of {@link DebugTextDisplay} class. |
15 | 13 | */ |
| 14 | @BasicPreferences |
16 | 15 | class DebugTextDisplayTest { |
17 | | /** |
18 | | * Setup test |
19 | | */ |
20 | | @RegisterExtension |
21 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
22 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
23 | | |
24 | 16 | /** |
25 | 17 | * Test {@link DebugTextDisplay#getCodeText} |
26 | 18 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/conflict/pair/ConflictResolverTest.java b/test/unit/org/openstreetmap/josm/gui/conflict/pair/ConflictResolverTest.java
index 2b663acb5..017c77c07 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
6 | 6 | |
7 | 7 | import java.util.NoSuchElementException; |
8 | 8 | |
9 | | import org.junit.jupiter.api.Test; |
10 | | import org.junit.jupiter.api.extension.RegisterExtension; |
11 | 9 | import org.openstreetmap.josm.command.SequenceCommand; |
12 | 10 | import org.openstreetmap.josm.data.conflict.Conflict; |
13 | 11 | import org.openstreetmap.josm.data.coor.LatLon; |
… |
… |
import org.openstreetmap.josm.data.osm.DataSet;
|
15 | 13 | import org.openstreetmap.josm.data.osm.Node; |
16 | 14 | import org.openstreetmap.josm.data.osm.Relation; |
17 | 15 | import org.openstreetmap.josm.data.osm.Way; |
18 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 16 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
19 | 17 | |
20 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 18 | import org.junit.jupiter.api.Test; |
21 | 19 | |
22 | 20 | /** |
23 | 21 | * Unit tests of {@link ConflictResolver} class. |
24 | 22 | */ |
| 23 | @BasicPreferences |
25 | 24 | class ConflictResolverTest { |
26 | | |
27 | | /** |
28 | | * Setup test. |
29 | | */ |
30 | | @RegisterExtension |
31 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
32 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
33 | | |
34 | 25 | /** |
35 | 26 | * Unit test of {@link ConflictResolver#buildResolveCommand} - empty case. |
36 | 27 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergeModelTest.java b/test/unit/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergeModelTest.java
index 68f130aa0..3e885f138 100644
a
|
b
|
|
1 | 1 | // License: GPL. For details, see LICENSE file. |
2 | 2 | package org.openstreetmap.josm.gui.conflict.pair.nodes; |
3 | 3 | |
4 | | import static org.junit.jupiter.api.Assertions.fail; |
5 | 4 | import static org.junit.jupiter.api.Assertions.assertEquals; |
6 | 5 | import static org.junit.jupiter.api.Assertions.assertFalse; |
7 | 6 | import static org.junit.jupiter.api.Assertions.assertTrue; |
| 7 | import static org.junit.jupiter.api.Assertions.fail; |
8 | 8 | |
9 | 9 | import java.beans.PropertyChangeEvent; |
10 | 10 | import java.beans.PropertyChangeListener; |
… |
… |
import java.util.Set;
|
18 | 18 | |
19 | 19 | import javax.swing.DefaultListSelectionModel; |
20 | 20 | |
21 | | import org.junit.jupiter.api.Test; |
22 | | import org.junit.jupiter.api.extension.RegisterExtension; |
23 | 21 | import org.openstreetmap.josm.TestUtils; |
24 | 22 | import org.openstreetmap.josm.data.osm.Node; |
25 | 23 | import org.openstreetmap.josm.data.osm.Way; |
26 | 24 | import org.openstreetmap.josm.gui.conflict.pair.AbstractListMergeModel; |
27 | 25 | import org.openstreetmap.josm.testutils.DatasetFactory; |
28 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 26 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
29 | 27 | import org.openstreetmap.josm.tools.Logging; |
30 | 28 | |
31 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 29 | import org.junit.jupiter.api.Test; |
32 | 30 | |
33 | 31 | /** |
34 | 32 | * Unit tests of {@link NodeListMergeModel}. |
35 | 33 | */ |
| 34 | // Needed to due to OSM primitive dependencies |
| 35 | @BasicPreferences |
36 | 36 | class NodeListMergeModelTest { |
37 | | |
38 | 37 | private final DatasetFactory my = new DatasetFactory(); |
39 | 38 | private final DatasetFactory their = new DatasetFactory(); |
40 | 39 | |
41 | | /** |
42 | | * Setup test. |
43 | | */ |
44 | | @RegisterExtension |
45 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
46 | | public JOSMTestRules test = new JOSMTestRules(); |
47 | | |
48 | 40 | @SuppressWarnings("unchecked") |
49 | 41 | protected List<Node> inspectNodeList(NodeListMergeModel model, String name) { |
50 | 42 | try { |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergerTest.java b/test/unit/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergerTest.java
index 04445952b..353192466 100644
a
|
b
|
package org.openstreetmap.josm.gui.conflict.pair.nodes;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | | import org.junit.jupiter.api.Test; |
8 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 6 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
9 | 7 | |
10 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 8 | import org.junit.jupiter.api.Test; |
11 | 9 | |
12 | 10 | /** |
13 | 11 | * Unit tests of {@link NodeListMerger} class. |
14 | 12 | */ |
| 13 | @BasicPreferences |
15 | 14 | class NodeListMergerTest { |
16 | | |
17 | | /** |
18 | | * Setup test. |
19 | | */ |
20 | | @RegisterExtension |
21 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
22 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
23 | | |
24 | 15 | /** |
25 | 16 | * Unit test of {@link NodeListMerger#NodeListMerger}. |
26 | 17 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMergeModelTest.java b/test/unit/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMergeModelTest.java
index 8e550f60a..d148716a2 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
8 | 8 | import javax.swing.event.ChangeEvent; |
9 | 9 | import javax.swing.event.ChangeListener; |
10 | 10 | |
11 | | import org.junit.jupiter.api.BeforeEach; |
12 | | import org.junit.jupiter.api.Test; |
13 | | import org.junit.jupiter.api.extension.RegisterExtension; |
14 | 11 | import org.openstreetmap.josm.data.conflict.Conflict; |
15 | 12 | import org.openstreetmap.josm.data.coor.LatLon; |
16 | 13 | import org.openstreetmap.josm.data.osm.DataSet; |
… |
… |
import org.openstreetmap.josm.data.osm.OsmPrimitive;
|
19 | 16 | import org.openstreetmap.josm.data.osm.Relation; |
20 | 17 | import org.openstreetmap.josm.data.osm.Way; |
21 | 18 | import org.openstreetmap.josm.gui.conflict.pair.MergeDecisionType; |
22 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 19 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
23 | 20 | |
24 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 21 | import org.junit.jupiter.api.BeforeEach; |
| 22 | import org.junit.jupiter.api.Test; |
25 | 23 | |
26 | 24 | /** |
27 | 25 | * Unit tests of {@link PropertiesMergeModel}. |
28 | 26 | */ |
| 27 | // Needed to due to OSM primitive dependencies |
| 28 | @BasicPreferences |
29 | 29 | class PropertiesMergeModelTest { |
30 | 30 | |
31 | 31 | private abstract static class TestChangeListener implements ChangeListener { |
… |
… |
class PropertiesMergeModelTest {
|
46 | 46 | |
47 | 47 | PropertiesMergeModel model; |
48 | 48 | |
49 | | /** |
50 | | * Setup test. |
51 | | */ |
52 | | @RegisterExtension |
53 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
54 | | public JOSMTestRules test = new JOSMTestRules(); |
55 | | |
56 | 49 | /** |
57 | 50 | * Setup test. |
58 | 51 | */ |
59 | 52 | @BeforeEach |
60 | | public void setUp() { |
| 53 | void setUp() { |
61 | 54 | model = new PropertiesMergeModel(); |
62 | 55 | } |
63 | 56 | |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMergerTest.java b/test/unit/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMergerTest.java
index 7df01ce16..743f3c129 100644
a
|
b
|
package org.openstreetmap.josm.gui.conflict.pair.properties;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | | import org.junit.jupiter.api.Test; |
8 | 6 | import org.openstreetmap.josm.TestUtils; |
9 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 7 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
10 | 8 | |
11 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 9 | import org.junit.jupiter.api.Test; |
12 | 10 | |
13 | 11 | /** |
14 | 12 | * Unit tests of {@link PropertiesMerger} class. |
15 | 13 | */ |
| 14 | @BasicPreferences |
16 | 15 | class PropertiesMergerTest { |
17 | | |
18 | | /** |
19 | | * Setup test. |
20 | | */ |
21 | | @RegisterExtension |
22 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
23 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
24 | | |
25 | 16 | /** |
26 | 17 | * Unit test of {@link PropertiesMerger#PropertiesMerger}. |
27 | 18 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberMergerTest.java b/test/unit/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberMergerTest.java
index f97effb2e..4a1167e0b 100644
a
|
b
|
package org.openstreetmap.josm.gui.conflict.pair.relation;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | | import org.junit.jupiter.api.Test; |
8 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 6 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
9 | 7 | |
10 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 8 | import org.junit.jupiter.api.Test; |
11 | 9 | |
12 | 10 | /** |
13 | 11 | * Unit tests of {@link RelationMemberMerger} class. |
14 | 12 | */ |
| 13 | @BasicPreferences |
15 | 14 | class RelationMemberMergerTest { |
16 | | |
17 | | /** |
18 | | * Setup test. |
19 | | */ |
20 | | @RegisterExtension |
21 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
22 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
23 | | |
24 | 15 | /** |
25 | 16 | * Unit test of {@link RelationMemberMerger#RelationMemberMerger}. |
26 | 17 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellEditorTest.java b/test/unit/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellEditorTest.java
index f064d6b39..d6db80f39 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertNull;
|
7 | 7 | |
8 | 8 | import java.awt.Component; |
9 | 9 | |
10 | | import org.junit.jupiter.api.extension.RegisterExtension; |
11 | | import org.junit.jupiter.api.Test; |
12 | 10 | import org.openstreetmap.josm.data.osm.Node; |
13 | 11 | import org.openstreetmap.josm.data.osm.RelationMember; |
14 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 12 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
15 | 13 | |
16 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 14 | import org.junit.jupiter.api.Test; |
17 | 15 | |
18 | 16 | /** |
19 | 17 | * Unit tests of {@link RelationMemberTableCellEditor} class. |
20 | 18 | */ |
| 19 | @BasicPreferences |
21 | 20 | class RelationMemberTableCellEditorTest { |
22 | | |
23 | | /** |
24 | | * Setup test. |
25 | | */ |
26 | | @RegisterExtension |
27 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
28 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
29 | | |
30 | 21 | /** |
31 | 22 | * Unit test of {@link RelationMemberTableCellEditor#RelationMemberTableCellEditor}. |
32 | 23 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellRendererTest.java b/test/unit/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellRendererTest.java
index 408eb2ec4..988ea6f07 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
5 | 5 | |
6 | 6 | import javax.swing.JTable; |
7 | 7 | |
8 | | import org.junit.jupiter.api.extension.RegisterExtension; |
9 | | import org.junit.jupiter.api.Test; |
10 | 8 | import org.openstreetmap.josm.data.osm.Node; |
11 | 9 | import org.openstreetmap.josm.data.osm.RelationMember; |
12 | 10 | import org.openstreetmap.josm.gui.conflict.pair.ListRole; |
13 | 11 | import org.openstreetmap.josm.gui.conflict.pair.nodes.NodeListMergeModel; |
14 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 12 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
15 | 13 | |
16 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 14 | import org.junit.jupiter.api.Test; |
17 | 15 | |
18 | 16 | /** |
19 | 17 | * Unit tests of {@link RelationMemberTableCellRenderer} class. |
20 | 18 | */ |
| 19 | @BasicPreferences |
21 | 20 | class RelationMemberTableCellRendererTest { |
22 | | |
23 | | /** |
24 | | * Setup test. |
25 | | */ |
26 | | @RegisterExtension |
27 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
28 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
29 | | |
30 | 21 | /** |
31 | 22 | * Unit test of {@link RelationMemberTableCellRenderer#RelationMemberTableCellRenderer}. |
32 | 23 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergeItemTest.java b/test/unit/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergeItemTest.java
index 9d7c80066..6d848e410 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
5 | 5 | import static org.junit.jupiter.api.Assertions.assertNull; |
6 | 6 | import static org.junit.jupiter.api.Assertions.fail; |
7 | 7 | |
8 | | import org.junit.jupiter.api.extension.RegisterExtension; |
9 | | import org.junit.jupiter.api.Test; |
10 | 8 | import org.openstreetmap.josm.data.osm.Node; |
11 | 9 | import org.openstreetmap.josm.gui.conflict.pair.MergeDecisionType; |
12 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 10 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
13 | 11 | import org.openstreetmap.josm.tools.Logging; |
14 | 12 | |
15 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 13 | import org.junit.jupiter.api.Test; |
16 | 14 | |
17 | 15 | /** |
18 | 16 | * Unit tests of {@link TagMergeItem} class. |
19 | 17 | */ |
| 18 | // Needed to due to OSM primitive dependencies |
| 19 | @BasicPreferences |
20 | 20 | class TagMergeItemTest { |
21 | | |
22 | | /** |
23 | | * Setup test. |
24 | | */ |
25 | | @RegisterExtension |
26 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
27 | | public JOSMTestRules test = new JOSMTestRules(); |
28 | | |
29 | 21 | @Test |
30 | 22 | void testTagMergeItem() { |
31 | 23 | TagMergeItem item = new TagMergeItem("key", "myvalue", "theirvalue"); |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergeModelTest.java b/test/unit/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergeModelTest.java
index dbbb3c6d0..54ff26515 100644
a
|
b
|
import java.beans.PropertyChangeListener;
|
8 | 8 | import java.util.List; |
9 | 9 | import java.util.Set; |
10 | 10 | |
11 | | import org.junit.jupiter.api.extension.RegisterExtension; |
12 | | import org.junit.jupiter.api.Test; |
13 | 11 | import org.openstreetmap.josm.TestUtils; |
14 | 12 | import org.openstreetmap.josm.data.osm.Node; |
15 | 13 | import org.openstreetmap.josm.gui.conflict.pair.MergeDecisionType; |
16 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 14 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
17 | 15 | |
18 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 16 | import org.junit.jupiter.api.Test; |
19 | 17 | |
20 | 18 | /** |
21 | 19 | * Unit tests of {@link TagMergeModel} class. |
22 | 20 | */ |
23 | 21 | @SuppressWarnings("unchecked") |
| 22 | // Needed to due to OSM primitive dependencies |
| 23 | @BasicPreferences |
24 | 24 | class TagMergeModelTest { |
25 | | |
26 | | /** |
27 | | * Setup test. |
28 | | */ |
29 | | @RegisterExtension |
30 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
31 | | public JOSMTestRules test = new JOSMTestRules(); |
32 | | |
33 | 25 | protected Set<PropertyChangeListener> getListeners(TagMergeModel model) throws ReflectiveOperationException { |
34 | 26 | return (Set<PropertyChangeListener>) TestUtils.getPrivateField(model, "listeners"); |
35 | 27 | } |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergerTest.java b/test/unit/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergerTest.java
index eb74174ad..5db9db9f6 100644
a
|
b
|
package org.openstreetmap.josm.gui.conflict.pair.tags;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | | import org.junit.jupiter.api.Test; |
8 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 6 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
9 | 7 | |
10 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 8 | import org.junit.jupiter.api.Test; |
11 | 9 | |
12 | 10 | /** |
13 | 11 | * Unit tests of {@link TagMerger} class. |
14 | 12 | */ |
| 13 | @BasicPreferences |
15 | 14 | class TagMergerTest { |
16 | | |
17 | | /** |
18 | | * Setup test. |
19 | | */ |
20 | | @RegisterExtension |
21 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
22 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
23 | | |
24 | 15 | /** |
25 | 16 | * Unit test of {@link TagMerger#TagMerger}. |
26 | 17 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellEditorTest.java b/test/unit/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellEditorTest.java
index 0b42626bd..8309ff5d0 100644
a
|
b
|
package org.openstreetmap.josm.gui.conflict.tags;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | 6 | import org.junit.jupiter.api.Test; |
8 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
9 | | |
10 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
11 | 7 | |
12 | 8 | /** |
13 | 9 | * Unit tests of {@link MultiValueCellEditor} class. |
14 | 10 | */ |
15 | 11 | class MultiValueCellEditorTest { |
16 | | |
17 | | /** |
18 | | * Setup test. |
19 | | */ |
20 | | @RegisterExtension |
21 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
22 | | public JOSMTestRules test = new JOSMTestRules(); |
23 | | |
24 | 12 | /** |
25 | 13 | * Unit test of {@link MultiValueCellEditor#MultiValueCellEditor}. |
26 | 14 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellRendererTest.java b/test/unit/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellRendererTest.java
index 534a3a679..34aaee285 100644
a
|
b
|
import java.util.Collections;
|
9 | 9 | |
10 | 10 | import javax.swing.JTable; |
11 | 11 | |
12 | | import org.junit.jupiter.api.extension.RegisterExtension; |
13 | | import org.junit.jupiter.api.Test; |
14 | 12 | import org.openstreetmap.josm.data.osm.Tag; |
15 | 13 | import org.openstreetmap.josm.data.osm.TagCollection; |
16 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 14 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
17 | 15 | |
18 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 16 | import org.junit.jupiter.api.Test; |
19 | 17 | |
20 | 18 | /** |
21 | 19 | * Unit tests of {@link MultiValueCellRenderer} class. |
22 | 20 | */ |
| 21 | @BasicPreferences |
23 | 22 | class MultiValueCellRendererTest { |
24 | | |
25 | | /** |
26 | | * Setup test. |
27 | | */ |
28 | | @RegisterExtension |
29 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
30 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
31 | | |
32 | 23 | /** |
33 | 24 | * Unit test of {@link MultiValueCellRenderer#MultiValueCellRenderer}. |
34 | 25 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/conflict/tags/PasteTagsConflictResolverDialogTest.java b/test/unit/org/openstreetmap/josm/gui/conflict/tags/PasteTagsConflictResolverDialogTest.java
index f915d1b20..a38e8a67a 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertNull;
|
8 | 8 | |
9 | 9 | import java.awt.Insets; |
10 | 10 | |
11 | | import org.junit.jupiter.api.extension.RegisterExtension; |
12 | | import org.junit.jupiter.api.Test; |
13 | 11 | import org.openstreetmap.josm.data.osm.OsmPrimitiveType; |
14 | 12 | import org.openstreetmap.josm.gui.conflict.tags.PasteTagsConflictResolverDialog.StatisticsInfo; |
15 | 13 | import org.openstreetmap.josm.gui.conflict.tags.PasteTagsConflictResolverDialog.StatisticsInfoTable; |
16 | 14 | import org.openstreetmap.josm.gui.conflict.tags.PasteTagsConflictResolverDialog.StatisticsTableModel; |
17 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 15 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
18 | 16 | |
19 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 17 | import org.junit.jupiter.api.Test; |
20 | 18 | |
21 | 19 | /** |
22 | 20 | * Unit tests of {@link PasteTagsConflictResolverDialog} class. |
23 | 21 | */ |
| 22 | // Needed to due to OSM primitive dependencies |
| 23 | @BasicPreferences |
24 | 24 | class PasteTagsConflictResolverDialogTest { |
25 | | |
26 | | /** |
27 | | * Setup test. |
28 | | */ |
29 | | @RegisterExtension |
30 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
31 | | public JOSMTestRules test = new JOSMTestRules(); |
32 | | |
33 | 25 | /** |
34 | 26 | * Unit test of {@link PasteTagsConflictResolverDialog#PANE_TITLES}. |
35 | 27 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverModelTest.java b/test/unit/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverModelTest.java
index 5da656c75..201c6a6ae 100644
a
|
b
|
import java.util.Arrays;
|
9 | 9 | import java.util.Collections; |
10 | 10 | import java.util.List; |
11 | 11 | |
12 | | import org.junit.jupiter.api.extension.RegisterExtension; |
13 | | import org.junit.jupiter.api.Test; |
14 | 12 | import org.openstreetmap.josm.data.coor.LatLon; |
15 | 13 | import org.openstreetmap.josm.data.osm.DataSet; |
16 | 14 | import org.openstreetmap.josm.data.osm.Node; |
17 | 15 | import org.openstreetmap.josm.data.osm.Relation; |
18 | 16 | import org.openstreetmap.josm.data.osm.RelationMember; |
19 | 17 | import org.openstreetmap.josm.data.osm.Way; |
20 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 18 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
21 | 19 | |
22 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 20 | import org.junit.jupiter.api.Test; |
23 | 21 | |
24 | 22 | /** |
25 | 23 | * Unit tests of {@link RelationMemberConflictResolverModel} class. |
26 | 24 | */ |
| 25 | // Only needed for OSM primitives |
| 26 | @BasicPreferences |
27 | 27 | class RelationMemberConflictResolverModelTest { |
28 | | |
29 | | /** |
30 | | * Setup test. |
31 | | */ |
32 | | @RegisterExtension |
33 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
34 | | public JOSMTestRules test = new JOSMTestRules(); |
35 | | |
36 | 28 | List<Way> buildTestDataSet() { |
37 | 29 | final DataSet ds = new DataSet(); |
38 | 30 | final Node n1 = new Node(new LatLon(1, 1)); |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverTest.java b/test/unit/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverTest.java
index df2e94516..deef3d2cb 100644
a
|
b
|
package org.openstreetmap.josm.gui.conflict.tags;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | | import org.junit.jupiter.api.Test; |
8 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 6 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
9 | 7 | |
10 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 8 | import org.junit.jupiter.api.Test; |
11 | 9 | |
12 | 10 | /** |
13 | 11 | * Unit tests of {@link RelationMemberConflictResolver} class. |
14 | 12 | */ |
| 13 | @BasicPreferences |
15 | 14 | class RelationMemberConflictResolverTest { |
16 | | |
17 | | /** |
18 | | * Setup test. |
19 | | */ |
20 | | @RegisterExtension |
21 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
22 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
23 | | |
24 | 15 | /** |
25 | 16 | * Unit test for {@link RelationMemberConflictResolver#RelationMemberConflictResolver}. |
26 | 17 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolutionUtilTest.java b/test/unit/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolutionUtilTest.java
index dfc54348d..7656eb377 100644
a
|
b
|
import java.util.List;
|
14 | 14 | import java.util.regex.PatternSyntaxException; |
15 | 15 | import java.util.stream.Collectors; |
16 | 16 | |
17 | | import org.junit.jupiter.api.Test; |
18 | | import org.junit.jupiter.api.extension.RegisterExtension; |
19 | 17 | import org.openstreetmap.josm.data.osm.Tag; |
20 | 18 | import org.openstreetmap.josm.data.osm.TagCollection; |
21 | 19 | import org.openstreetmap.josm.gui.conflict.tags.TagConflictResolutionUtil.AutomaticChoice; |
22 | 20 | import org.openstreetmap.josm.gui.conflict.tags.TagConflictResolutionUtil.AutomaticChoiceGroup; |
23 | 21 | import org.openstreetmap.josm.gui.conflict.tags.TagConflictResolutionUtil.AutomaticCombine; |
24 | 22 | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 23 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
25 | 24 | |
26 | 25 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 26 | import org.junit.jupiter.api.Test; |
| 27 | import org.junit.jupiter.api.extension.RegisterExtension; |
27 | 28 | |
28 | 29 | /** |
29 | 30 | * Unit tests of {@link TagConflictResolutionUtil} class. |
30 | 31 | */ |
| 32 | @BasicPreferences |
31 | 33 | class TagConflictResolutionUtilTest { |
32 | | |
33 | | /** |
34 | | * Setup test. |
35 | | */ |
36 | | @RegisterExtension |
37 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
38 | | public JOSMTestRules test = new JOSMTestRules(); |
39 | | |
40 | 34 | private static HashSet<String> newHashSet(String... values) { |
41 | 35 | return Arrays.stream(values).collect(Collectors.toCollection(HashSet::new)); |
42 | 36 | } |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/datatransfer/ClipboardUtilsTest.java b/test/unit/org/openstreetmap/josm/gui/datatransfer/ClipboardUtilsTest.java
index 77270e8dc..5af5a3876 100644
a
|
b
|
import java.awt.datatransfer.Transferable;
|
16 | 16 | import java.awt.datatransfer.UnsupportedFlavorException; |
17 | 17 | import java.io.IOException; |
18 | 18 | |
19 | | import org.junit.jupiter.api.extension.RegisterExtension; |
20 | | import org.junit.jupiter.api.Test; |
21 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
22 | | |
23 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
24 | 19 | import net.trajano.commons.testing.UtilityClassTestUtil; |
| 20 | import org.junit.jupiter.api.Test; |
25 | 21 | |
26 | 22 | /** |
27 | 23 | * Basic tests for the clipboard utils class. |
… |
… |
class ClipboardUtilsTest {
|
66 | 62 | } |
67 | 63 | } |
68 | 64 | |
69 | | /** |
70 | | * No dependencies |
71 | | */ |
72 | | @RegisterExtension |
73 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
74 | | public JOSMTestRules test = new JOSMTestRules(); |
75 | | |
76 | 65 | /** |
77 | 66 | * Test {@link ClipboardUtils#getClipboard()} |
78 | 67 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/datatransfer/PrimitiveTransferableTest.java b/test/unit/org/openstreetmap/josm/gui/datatransfer/PrimitiveTransferableTest.java
index 684632c70..ae8ab36d4 100644
a
|
b
|
package org.openstreetmap.josm.gui.datatransfer;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertEquals; |
5 | 5 | import static org.junit.jupiter.api.Assertions.assertFalse; |
6 | | import static org.junit.jupiter.api.Assertions.assertTrue; |
7 | 6 | import static org.junit.jupiter.api.Assertions.assertThrows; |
| 7 | import static org.junit.jupiter.api.Assertions.assertTrue; |
8 | 8 | |
9 | 9 | import java.awt.datatransfer.DataFlavor; |
10 | 10 | import java.awt.datatransfer.UnsupportedFlavorException; |
… |
… |
import java.util.Collection;
|
13 | 13 | import java.util.Collections; |
14 | 14 | import java.util.List; |
15 | 15 | |
16 | | import org.junit.jupiter.api.Test; |
17 | | import org.junit.jupiter.api.extension.RegisterExtension; |
18 | 16 | import org.openstreetmap.josm.data.osm.Node; |
19 | 17 | import org.openstreetmap.josm.data.osm.NodeData; |
20 | 18 | import org.openstreetmap.josm.data.osm.PrimitiveData; |
21 | 19 | import org.openstreetmap.josm.gui.datatransfer.data.PrimitiveTransferData; |
22 | 20 | import org.openstreetmap.josm.gui.datatransfer.data.TagTransferData; |
23 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 21 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
24 | 22 | |
25 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 23 | import org.junit.jupiter.api.Test; |
26 | 24 | |
27 | 25 | /** |
28 | 26 | * Unit tests of {@link PrimitiveTransferable} class. |
29 | 27 | */ |
| 28 | // Only needed for OSM primitives |
| 29 | @BasicPreferences |
30 | 30 | class PrimitiveTransferableTest { |
31 | | /** |
32 | | * Prefs to use OSM primitives |
33 | | */ |
34 | | @RegisterExtension |
35 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
36 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
37 | | |
38 | 31 | /** |
39 | 32 | * Test of {@link PrimitiveTransferable#getTransferDataFlavors()} method response order |
40 | 33 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/datatransfer/RelationMemberTransferableTest.java b/test/unit/org/openstreetmap/josm/gui/datatransfer/RelationMemberTransferableTest.java
index 71680311c..ad3d1a8da 100644
a
|
b
|
package org.openstreetmap.josm.gui.datatransfer;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertEquals; |
5 | 5 | import static org.junit.jupiter.api.Assertions.assertFalse; |
6 | | import static org.junit.jupiter.api.Assertions.assertTrue; |
7 | 6 | import static org.junit.jupiter.api.Assertions.assertThrows; |
| 7 | import static org.junit.jupiter.api.Assertions.assertTrue; |
| 8 | |
8 | 9 | import static org.openstreetmap.josm.gui.datatransfer.RelationMemberTransferable.RELATION_MEMBER_DATA; |
9 | 10 | |
10 | 11 | import java.awt.datatransfer.DataFlavor; |
… |
… |
import java.awt.datatransfer.UnsupportedFlavorException;
|
12 | 13 | import java.util.Collection; |
13 | 14 | import java.util.Collections; |
14 | 15 | |
15 | | import org.junit.jupiter.api.Test; |
16 | | import org.junit.jupiter.api.extension.RegisterExtension; |
17 | 16 | import org.openstreetmap.josm.data.osm.Node; |
18 | 17 | import org.openstreetmap.josm.data.osm.PrimitiveData; |
19 | 18 | import org.openstreetmap.josm.data.osm.RelationMember; |
20 | 19 | import org.openstreetmap.josm.data.osm.RelationMemberData; |
21 | 20 | import org.openstreetmap.josm.gui.datatransfer.data.PrimitiveTransferData; |
22 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 21 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
23 | 22 | |
24 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 23 | import org.junit.jupiter.api.Test; |
25 | 24 | |
26 | 25 | /** |
27 | 26 | * Unit tests of {@link RelationMemberTransferable} class. |
28 | 27 | */ |
29 | 28 | class RelationMemberTransferableTest { |
30 | | |
31 | | /** |
32 | | * Setup tests |
33 | | */ |
34 | | @RegisterExtension |
35 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
36 | | public JOSMTestRules test = new JOSMTestRules(); |
37 | | |
38 | 29 | /** |
39 | 30 | * Test of {@link RelationMemberTransferable#getTransferDataFlavors()} method. |
40 | 31 | */ |
… |
… |
class RelationMemberTransferableTest {
|
63 | 54 | * @throws UnsupportedFlavorException never |
64 | 55 | */ |
65 | 56 | @Test |
| 57 | @BasicPreferences |
66 | 58 | void testGetTransferDataNominal() throws UnsupportedFlavorException { |
67 | 59 | RelationMemberTransferable rmt = new RelationMemberTransferable(Collections.singleton(new RelationMember("test", new Node(1)))); |
68 | 60 | assertEquals("node 1 test # incomplete\n", rmt.getTransferData(DataFlavor.stringFlavor)); |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/datatransfer/TagTransferableTest.java b/test/unit/org/openstreetmap/josm/gui/datatransfer/TagTransferableTest.java
index f01391f80..6473bfd16 100644
a
|
b
|
package org.openstreetmap.josm.gui.datatransfer;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertEquals; |
5 | 5 | import static org.junit.jupiter.api.Assertions.assertFalse; |
6 | | import static org.junit.jupiter.api.Assertions.assertTrue; |
7 | 6 | import static org.junit.jupiter.api.Assertions.assertThrows; |
| 7 | import static org.junit.jupiter.api.Assertions.assertTrue; |
8 | 8 | |
9 | 9 | import java.awt.datatransfer.DataFlavor; |
10 | 10 | import java.awt.datatransfer.UnsupportedFlavorException; |
11 | 11 | import java.util.HashMap; |
12 | 12 | import java.util.Map; |
13 | 13 | |
14 | | import org.junit.jupiter.api.Test; |
15 | | import org.junit.jupiter.api.extension.RegisterExtension; |
16 | 14 | import org.openstreetmap.josm.gui.datatransfer.data.TagTransferData; |
17 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
18 | 15 | |
19 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 16 | import org.junit.jupiter.api.Test; |
20 | 17 | |
21 | 18 | /** |
22 | 19 | * Unit tests of {@link TagTransferable} class. |
23 | 20 | */ |
24 | 21 | class TagTransferableTest { |
25 | | |
26 | | /** |
27 | | * Setup tests |
28 | | */ |
29 | | @RegisterExtension |
30 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
31 | | public JOSMTestRules test = new JOSMTestRules(); |
32 | | |
33 | 22 | /** |
34 | 23 | * Test of {@link TagTransferable#isDataFlavorSupported} method. |
35 | 24 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/datatransfer/data/PrimitiveTagTransferDataTest.java b/test/unit/org/openstreetmap/josm/gui/datatransfer/data/PrimitiveTagTransferDataTest.java
index d2ffe0d1f..5c0c44ed0 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
8 | 8 | import java.util.Arrays; |
9 | 9 | import java.util.Map; |
10 | 10 | |
11 | | import org.junit.jupiter.api.extension.RegisterExtension; |
12 | | import org.junit.jupiter.api.Test; |
13 | 11 | import org.openstreetmap.josm.data.osm.Node; |
14 | 12 | import org.openstreetmap.josm.data.osm.NodeData; |
15 | 13 | import org.openstreetmap.josm.data.osm.OsmPrimitiveType; |
… |
… |
import org.openstreetmap.josm.data.osm.PrimitiveData;
|
17 | 15 | import org.openstreetmap.josm.data.osm.RelationData; |
18 | 16 | import org.openstreetmap.josm.data.osm.TagCollection; |
19 | 17 | import org.openstreetmap.josm.data.osm.WayData; |
20 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 18 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
21 | 19 | |
22 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 20 | import org.junit.jupiter.api.Test; |
23 | 21 | |
24 | 22 | /** |
25 | 23 | * Test {@link PrimitiveTagTransferData} |
26 | 24 | * @author Michael Zangl |
27 | 25 | */ |
| 26 | // Only required due to OSM primitive dependencies |
| 27 | @BasicPreferences |
28 | 28 | class PrimitiveTagTransferDataTest { |
29 | | /** |
30 | | * Prefs only required because of the dependencies of OSM primitives. |
31 | | */ |
32 | | @RegisterExtension |
33 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
34 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
35 | | |
36 | 29 | private static boolean isHeterogeneousSource(PrimitiveData... t) { |
37 | 30 | return new PrimitiveTagTransferData(Arrays.asList(t)).isHeterogeneousSource(); |
38 | 31 | } |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/datatransfer/importers/OsmLinkPasterTest.java b/test/unit/org/openstreetmap/josm/gui/datatransfer/importers/OsmLinkPasterTest.java
index 66f9bb5a0..07857dfd5 100644
a
|
b
|
package org.openstreetmap.josm.gui.datatransfer.importers;
|
4 | 4 | import static org.junit.jupiter.api.Assertions.assertEquals; |
5 | 5 | import static org.junit.jupiter.api.Assertions.assertNull; |
6 | 6 | |
7 | | import org.junit.jupiter.api.extension.RegisterExtension; |
8 | | import org.junit.jupiter.api.Test; |
9 | 7 | import org.openstreetmap.josm.data.coor.LatLon; |
10 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
11 | 8 | |
12 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 9 | import org.junit.jupiter.api.Test; |
13 | 10 | |
14 | 11 | /** |
15 | 12 | * Test {@link OsmLinkPaster} |
16 | 13 | * @author Michael Zangl |
17 | 14 | */ |
18 | 15 | class OsmLinkPasterTest { |
19 | | /** |
20 | | * No dependencies |
21 | | */ |
22 | | @RegisterExtension |
23 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
24 | | public JOSMTestRules test = new JOSMTestRules(); |
25 | | |
26 | 16 | /** |
27 | 17 | * Test of {@link OsmLinkPaster#parseLatLon(String)} |
28 | 18 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/NotesDialogTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/NotesDialogTest.java
index 31ce40fb3..a8ec189fc 100644
a
|
b
|
import java.time.Instant;
|
10 | 10 | import javax.swing.JLabel; |
11 | 11 | import javax.swing.JList; |
12 | 12 | |
13 | | import org.junit.jupiter.api.Test; |
14 | | import org.junit.jupiter.api.extension.RegisterExtension; |
15 | 13 | import org.openstreetmap.josm.data.coor.LatLon; |
16 | 14 | import org.openstreetmap.josm.data.notes.Note; |
17 | 15 | import org.openstreetmap.josm.data.notes.NoteComment; |
18 | 16 | import org.openstreetmap.josm.data.osm.User; |
19 | 17 | import org.openstreetmap.josm.gui.dialogs.NotesDialog.NoteRenderer; |
20 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 18 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
21 | 19 | |
22 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 20 | import org.junit.jupiter.api.Test; |
23 | 21 | |
24 | 22 | /** |
25 | 23 | * Unit tests of {@link NotesDialog} |
26 | 24 | */ |
| 25 | @BasicPreferences |
27 | 26 | class NotesDialogTest { |
28 | | |
29 | | /** |
30 | | * Setup tests |
31 | | */ |
32 | | @RegisterExtension |
33 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
34 | | public JOSMTestRules josmTestRules = new JOSMTestRules().preferences(); |
35 | | |
36 | 27 | private Note createMultiLineNote() { |
37 | 28 | Note note = new Note(LatLon.ZERO); |
38 | 29 | note.setCreatedAt(Instant.now()); |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManagerTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManagerTest.java
index 6eb63f8fa..03cd82bcb 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
7 | 7 | |
8 | 8 | import java.awt.GraphicsEnvironment; |
9 | 9 | import java.awt.event.ActionEvent; |
10 | | import javax.swing.JButton; |
11 | | import javax.swing.JDialog; |
12 | | |
13 | 10 | import java.util.Collections; |
14 | 11 | import java.util.List; |
15 | 12 | |
16 | | import org.junit.jupiter.api.extension.RegisterExtension; |
17 | | import org.junit.jupiter.api.Test; |
| 13 | import javax.swing.JButton; |
| 14 | import javax.swing.JDialog; |
| 15 | |
18 | 16 | import org.openstreetmap.josm.TestUtils; |
19 | 17 | import org.openstreetmap.josm.data.osm.Changeset; |
20 | 18 | import org.openstreetmap.josm.gui.dialogs.changeset.ChangesetCacheManager.CancelAction; |
… |
… |
import org.openstreetmap.josm.gui.dialogs.changeset.ChangesetCacheManager.QueryA
|
27 | 25 | import org.openstreetmap.josm.gui.dialogs.changeset.ChangesetCacheManager.RemoveFromCacheAction; |
28 | 26 | import org.openstreetmap.josm.gui.dialogs.changeset.ChangesetCacheManager.ShowDetailAction; |
29 | 27 | import org.openstreetmap.josm.gui.dialogs.changeset.query.ChangesetQueryDialog; |
30 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 28 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
31 | 29 | import org.openstreetmap.josm.testutils.mockers.HelpAwareOptionPaneMocker; |
32 | 30 | import org.openstreetmap.josm.testutils.mockers.WindowMocker; |
33 | 31 | |
34 | 32 | import mockit.Invocation; |
35 | 33 | import mockit.Mock; |
36 | 34 | import mockit.MockUp; |
37 | | |
38 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 35 | import org.junit.jupiter.api.Test; |
39 | 36 | |
40 | 37 | /** |
41 | 38 | * Unit tests of {@link ChangesetCacheManager} class. |
42 | 39 | */ |
| 40 | @BasicPreferences |
43 | 41 | class ChangesetCacheManagerTest { |
44 | | |
45 | | /** |
46 | | * Setup tests |
47 | | */ |
48 | | @RegisterExtension |
49 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
50 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
51 | | |
52 | 42 | /** |
53 | 43 | * Unit test of {@link ChangesetCacheManager#destroyInstance}. |
54 | 44 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheTableColumnModelTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheTableColumnModelTest.java
index 46ce97a18..d7aab1c18 100644
a
|
b
|
package org.openstreetmap.josm.gui.dialogs.changeset;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | 6 | import org.junit.jupiter.api.Test; |
8 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
9 | | |
10 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
11 | 7 | |
12 | 8 | /** |
13 | 9 | * Unit tests of {@link ChangesetCacheTableColumnModel} class. |
14 | 10 | */ |
15 | 11 | class ChangesetCacheTableColumnModelTest { |
16 | | |
17 | | /** |
18 | | * Setup tests |
19 | | */ |
20 | | @RegisterExtension |
21 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
22 | | public JOSMTestRules test = new JOSMTestRules(); |
23 | | |
24 | 12 | /** |
25 | 13 | * Unit test of {@link ChangesetCacheTableColumnModel}. |
26 | 14 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanelTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanelTest.java
index ffbd64f9e..146c5a3ba 100644
a
|
b
|
package org.openstreetmap.josm.gui.dialogs.changeset;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | | import org.junit.jupiter.api.Test; |
8 | 6 | import org.openstreetmap.josm.testutils.JOSMTestRules; |
9 | 7 | |
10 | 8 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 9 | import org.junit.jupiter.api.Test; |
| 10 | import org.junit.jupiter.api.extension.RegisterExtension; |
11 | 11 | |
12 | 12 | /** |
13 | 13 | * Unit tests of {@link ChangesetContentPanel} class. |
… |
… |
class ChangesetContentPanelTest {
|
19 | 19 | */ |
20 | 20 | @RegisterExtension |
21 | 21 | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
22 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
| 22 | public JOSMTestRules test = new JOSMTestRules().preferences().main(); |
23 | 23 | |
24 | 24 | /** |
25 | 25 | * Unit test of {@link ChangesetContentPanel#ChangesetContentPanel}. |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanelTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanelTest.java
index 0c07d1cec..c9a8380b2 100644
a
|
b
|
package org.openstreetmap.josm.gui.dialogs.changeset;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | | import org.junit.jupiter.api.Test; |
8 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 6 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
9 | 7 | |
10 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 8 | import org.junit.jupiter.api.Test; |
11 | 9 | |
12 | 10 | /** |
13 | 11 | * Unit tests of {@link ChangesetDetailPanel} class. |
14 | 12 | */ |
| 13 | @BasicPreferences |
15 | 14 | class ChangesetDetailPanelTest { |
16 | | |
17 | | /** |
18 | | * Setup tests |
19 | | */ |
20 | | @RegisterExtension |
21 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
22 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
23 | | |
24 | 15 | /** |
25 | 16 | * Unit test of {@link ChangesetDetailPanel#ChangesetDetailPanel}. |
26 | 17 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDiscussionPanelTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDiscussionPanelTest.java
index 3f2326242..ccd4474a6 100644
a
|
b
|
package org.openstreetmap.josm.gui.dialogs.changeset;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | | import org.junit.jupiter.api.Test; |
8 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 6 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
9 | 7 | |
10 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 8 | import org.junit.jupiter.api.Test; |
11 | 9 | |
12 | 10 | /** |
13 | 11 | * Unit tests of {@link ChangesetDiscussionPanel} class. |
14 | 12 | */ |
| 13 | @BasicPreferences |
15 | 14 | class ChangesetDiscussionPanelTest { |
16 | | |
17 | | /** |
18 | | * Setup tests |
19 | | */ |
20 | | @RegisterExtension |
21 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
22 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
23 | | |
24 | 15 | /** |
25 | 16 | * Unit test of {@link ChangesetDiscussionPanel#ChangesetDiscussionPanel}. |
26 | 17 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetTagsPanelTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetTagsPanelTest.java
index e92e23c92..c5485ca2a 100644
a
|
b
|
package org.openstreetmap.josm.gui.dialogs.changeset;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | | import org.junit.jupiter.api.Test; |
8 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 6 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
9 | 7 | |
10 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 8 | import org.junit.jupiter.api.Test; |
11 | 9 | |
12 | 10 | /** |
13 | 11 | * Unit tests of {@link ChangesetTagsPanel} class. |
14 | 12 | */ |
| 13 | @BasicPreferences |
15 | 14 | class ChangesetTagsPanelTest { |
16 | | |
17 | | /** |
18 | | * Setup tests |
19 | | */ |
20 | | @RegisterExtension |
21 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
22 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
23 | | |
24 | 15 | /** |
25 | 16 | * Unit test of {@link ChangesetTagsPanel#ChangesetTagsPanel}. |
26 | 17 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanelTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanelTest.java
index 2b96ac461..9308accf6 100644
a
|
b
|
package org.openstreetmap.josm.gui.dialogs.changeset.query;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | | import org.junit.jupiter.api.Test; |
8 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 6 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
9 | 7 | |
10 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 8 | import org.junit.jupiter.api.Test; |
11 | 9 | |
12 | 10 | /** |
13 | 11 | * Unit tests of {@link AdvancedChangesetQueryPanel} class. |
14 | 12 | */ |
| 13 | @BasicPreferences |
15 | 14 | class AdvancedChangesetQueryPanelTest { |
16 | | |
17 | | /** |
18 | | * Setup test. |
19 | | */ |
20 | | @RegisterExtension |
21 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
22 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
23 | | |
24 | 15 | /** |
25 | 16 | * Unit test of {@link AdvancedChangesetQueryPanel#AdvancedChangesetQueryPanel}. |
26 | 17 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/query/BasicChangesetQueryPanelTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/query/BasicChangesetQueryPanelTest.java
index d0f076bf4..f4afca5ea 100644
a
|
b
|
package org.openstreetmap.josm.gui.dialogs.changeset.query;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | | import org.junit.jupiter.api.Test; |
8 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 6 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
9 | 7 | |
10 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 8 | import org.junit.jupiter.api.Test; |
11 | 9 | |
12 | 10 | /** |
13 | 11 | * Unit tests of {@link BasicChangesetQueryPanel} class. |
14 | 12 | */ |
| 13 | @BasicPreferences |
15 | 14 | class BasicChangesetQueryPanelTest { |
16 | | |
17 | | /** |
18 | | * Setup test. |
19 | | */ |
20 | | @RegisterExtension |
21 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
22 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
23 | | |
24 | 15 | /** |
25 | 16 | * Unit test of {@link BasicChangesetQueryPanel#BasicChangesetQueryPanel}. |
26 | 17 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanelTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanelTest.java
index 2f6c3012f..872ab9aa3 100644
a
|
b
|
package org.openstreetmap.josm.gui.dialogs.changeset.query;
|
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 5 | import static org.junit.jupiter.api.Assertions.assertTrue; |
6 | 6 | |
7 | | import org.junit.jupiter.api.Test; |
8 | | import org.junit.jupiter.api.extension.RegisterExtension; |
9 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 7 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
10 | 8 | |
11 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 9 | import org.junit.jupiter.api.Test; |
12 | 10 | |
13 | 11 | /** |
14 | 12 | * Unit tests of {@link UrlBasedQueryPanel} class. |
15 | 13 | */ |
| 14 | @BasicPreferences |
16 | 15 | class UrlBasedQueryPanelTest { |
17 | | |
18 | | /** |
19 | | * Setup test. |
20 | | */ |
21 | | @RegisterExtension |
22 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
23 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
24 | | |
25 | 16 | /** |
26 | 17 | * Unit test of {@link UrlBasedQueryPanel#UrlBasedQueryPanel}. |
27 | 18 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/layer/DuplicateActionTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/layer/DuplicateActionTest.java
index 024c51660..0e95c8273 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertNull;
|
8 | 8 | |
9 | 9 | import java.io.InputStream; |
10 | 10 | |
11 | | import org.junit.jupiter.api.extension.RegisterExtension; |
12 | | import org.junit.jupiter.api.Test; |
13 | 11 | import org.openstreetmap.josm.TestUtils; |
14 | 12 | import org.openstreetmap.josm.gui.MainApplication; |
15 | 13 | import org.openstreetmap.josm.gui.layer.OsmDataLayer; |
16 | 14 | import org.openstreetmap.josm.io.OsmReader; |
17 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 15 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
18 | 16 | |
19 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 17 | import org.junit.jupiter.api.Test; |
20 | 18 | |
21 | 19 | /** |
22 | 20 | * Unit tests of {@link DuplicateAction} class. |
23 | 21 | */ |
| 22 | // TMS layer needs prefs. Platform for LayerListDialog shortcuts. |
| 23 | @BasicPreferences |
24 | 24 | class DuplicateActionTest { |
25 | | /** |
26 | | * TMS layer needs prefs. Platform for LayerListDialog shortcuts. |
27 | | */ |
28 | | @RegisterExtension |
29 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
30 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
31 | | |
32 | 25 | /** |
33 | 26 | * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/4539">#4539</a>. |
34 | 27 | * @throws Exception if an error occurs |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialogTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialogTest.java
index 1cbf48a53..ffaed4b79 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
6 | 6 | import java.util.ArrayList; |
7 | 7 | import java.util.List; |
8 | 8 | |
9 | | import org.junit.jupiter.api.extension.RegisterExtension; |
10 | | import org.junit.jupiter.api.Test; |
11 | 9 | import org.openstreetmap.josm.data.coor.LatLon; |
12 | 10 | import org.openstreetmap.josm.data.osm.Node; |
13 | 11 | import org.openstreetmap.josm.data.osm.OsmPrimitive; |
14 | 12 | import org.openstreetmap.josm.data.osm.Way; |
15 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 13 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
16 | 14 | |
17 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 15 | import org.junit.jupiter.api.Test; |
18 | 16 | |
19 | 17 | /** |
20 | 18 | * Unit tests of {@link PropertiesDialog} class. |
21 | 19 | */ |
| 20 | @BasicPreferences |
22 | 21 | class PropertiesDialogTest { |
23 | | |
24 | | /** |
25 | | * Setup tests |
26 | | */ |
27 | | @RegisterExtension |
28 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
29 | | public JOSMTestRules test = new JOSMTestRules(); |
30 | | |
31 | 22 | private static String createSearchSetting(List<OsmPrimitive> sel, boolean sameType) { |
32 | 23 | return PropertiesDialog.createSearchSetting("foo", sel, sameType).text; |
33 | 24 | } |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/properties/RecentTagCollectionTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/properties/RecentTagCollectionTest.java
index 17e48c5e8..73c70306c 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
8 | 8 | import java.util.Arrays; |
9 | 9 | import java.util.Collections; |
10 | 10 | |
11 | | import org.junit.jupiter.api.extension.RegisterExtension; |
12 | | import org.junit.jupiter.api.Test; |
13 | 11 | import org.openstreetmap.josm.data.osm.Tag; |
14 | 12 | import org.openstreetmap.josm.data.osm.search.SearchParseError; |
15 | 13 | import org.openstreetmap.josm.data.osm.search.SearchSetting; |
16 | 14 | import org.openstreetmap.josm.data.preferences.ListProperty; |
17 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 15 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
18 | 16 | |
19 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 17 | import org.junit.jupiter.api.Test; |
20 | 18 | |
21 | 19 | /** |
22 | 20 | * Unit tests of {@link RecentTagCollection} class. |
23 | 21 | */ |
| 22 | @BasicPreferences |
24 | 23 | class RecentTagCollectionTest { |
25 | | |
26 | | /** |
27 | | * Setup tests |
28 | | */ |
29 | | @RegisterExtension |
30 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
31 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
32 | | |
33 | 24 | /** |
34 | 25 | * Performs various tests on a {@link RecentTagCollection}. |
35 | 26 | * |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowserTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowserTest.java
index f5da29e72..adba38848 100644
a
|
b
|
package org.openstreetmap.josm.gui.dialogs.relation;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | | import org.junit.jupiter.api.Test; |
8 | 6 | import org.openstreetmap.josm.data.osm.DataSet; |
9 | 7 | import org.openstreetmap.josm.data.osm.Relation; |
10 | 8 | import org.openstreetmap.josm.gui.layer.OsmDataLayer; |
11 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 9 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
12 | 10 | |
13 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 11 | import org.junit.jupiter.api.Test; |
14 | 12 | |
15 | 13 | /** |
16 | 14 | * Unit tests of {@link ChildRelationBrowser} class. |
17 | 15 | */ |
| 16 | @BasicPreferences |
18 | 17 | class ChildRelationBrowserTest { |
19 | | |
20 | | /** |
21 | | * Setup test. |
22 | | */ |
23 | | @RegisterExtension |
24 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
25 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
26 | | |
27 | 18 | /** |
28 | 19 | * Unit test of {@link ChildRelationBrowser#ChildRelationBrowser}. |
29 | 20 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/relation/MemberTableLinkedCellRendererTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/relation/MemberTableLinkedCellRendererTest.java
index a0c9593d4..33d31b87a 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
5 | 5 | |
6 | 6 | import javax.swing.JTable; |
7 | 7 | |
8 | | import org.junit.jupiter.api.extension.RegisterExtension; |
9 | | import org.junit.jupiter.api.Test; |
10 | 8 | import org.openstreetmap.josm.TestUtils; |
11 | 9 | import org.openstreetmap.josm.gui.dialogs.relation.sort.WayConnectionType; |
12 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 10 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
13 | 11 | |
14 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 12 | import org.junit.jupiter.api.Test; |
15 | 13 | |
16 | 14 | /** |
17 | 15 | * Unit tests of {@link MemberTableLinkedCellRenderer} class. |
18 | 16 | */ |
| 17 | @BasicPreferences |
19 | 18 | class MemberTableLinkedCellRendererTest { |
20 | | |
21 | | /** |
22 | | * Setup test. |
23 | | */ |
24 | | @RegisterExtension |
25 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
26 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
27 | | |
28 | 19 | /** |
29 | 20 | * Unit test of {@link MemberTableLinkedCellRenderer#MemberTableLinkedCellRenderer}. |
30 | 21 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/relation/MemberTableMemberCellRendererTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/relation/MemberTableMemberCellRendererTest.java
index 71e18b058..50c578c37 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
5 | 5 | |
6 | 6 | import javax.swing.JTable; |
7 | 7 | |
8 | | import org.junit.jupiter.api.extension.RegisterExtension; |
9 | | import org.junit.jupiter.api.Test; |
10 | 8 | import org.openstreetmap.josm.data.osm.DataSet; |
11 | 9 | import org.openstreetmap.josm.data.osm.Node; |
12 | 10 | import org.openstreetmap.josm.gui.layer.OsmDataLayer; |
13 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 11 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
14 | 12 | |
15 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 13 | import org.junit.jupiter.api.Test; |
16 | 14 | |
17 | 15 | /** |
18 | 16 | * Unit tests of {@link MemberTableMemberCellRenderer} class. |
19 | 17 | */ |
| 18 | @BasicPreferences |
20 | 19 | class MemberTableMemberCellRendererTest { |
21 | | |
22 | | /** |
23 | | * Setup test. |
24 | | */ |
25 | | @RegisterExtension |
26 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
27 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
28 | | |
29 | 20 | /** |
30 | 21 | * Unit test of {@link MemberTableMemberCellRenderer#MemberTableMemberCellRenderer}. |
31 | 22 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModelTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModelTest.java
index 886ca9d04..38f350231 100644
a
|
b
|
import java.util.Collection;
|
7 | 7 | import java.util.Collections; |
8 | 8 | import java.util.List; |
9 | 9 | |
10 | | import org.junit.jupiter.api.extension.RegisterExtension; |
11 | | import org.junit.jupiter.api.Test; |
12 | 10 | import org.openstreetmap.josm.data.osm.Node; |
13 | 11 | import org.openstreetmap.josm.data.osm.OsmPrimitive; |
14 | 12 | import org.openstreetmap.josm.data.osm.Tag; |
15 | 13 | import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetHandler; |
16 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 14 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
17 | 15 | |
18 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 16 | import org.junit.jupiter.api.Test; |
19 | 17 | |
20 | 18 | /** |
21 | 19 | * Unit tests of {@link MemberTableModel} class. |
22 | 20 | */ |
| 21 | @BasicPreferences |
23 | 22 | class MemberTableModelTest { |
24 | | |
25 | | /** |
26 | | * Setup test. |
27 | | */ |
28 | | @RegisterExtension |
29 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
30 | | public JOSMTestRules test = new JOSMTestRules(); |
31 | | |
32 | 23 | /** |
33 | 24 | * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/12443">#12443</a>. |
34 | 25 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/relation/MemberTableRoleCellRendererTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/relation/MemberTableRoleCellRendererTest.java
index 608438b91..48ab295a7 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
5 | 5 | |
6 | 6 | import javax.swing.JTable; |
7 | 7 | |
8 | | import org.junit.jupiter.api.extension.RegisterExtension; |
9 | | import org.junit.jupiter.api.Test; |
10 | 8 | import org.openstreetmap.josm.data.osm.DataSet; |
11 | 9 | import org.openstreetmap.josm.gui.layer.OsmDataLayer; |
12 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 10 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
13 | 11 | |
14 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 12 | import org.junit.jupiter.api.Test; |
15 | 13 | |
16 | 14 | /** |
17 | 15 | * Unit tests of {@link MemberTableRoleCellRenderer} class. |
18 | 16 | */ |
| 17 | @BasicPreferences |
19 | 18 | class MemberTableRoleCellRendererTest { |
20 | | |
21 | | /** |
22 | | * Setup test. |
23 | | */ |
24 | | @RegisterExtension |
25 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
26 | | public JOSMTestRules test = new JOSMTestRules(); |
27 | | |
28 | 19 | /** |
29 | 20 | * Unit test of {@link MemberTableRoleCellRenderer#MemberTableRoleCellRenderer}. |
30 | 21 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowserTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowserTest.java
index c89a44537..bf5ad2b4f 100644
a
|
b
|
|
1 | 1 | // License: GPL. For details, see LICENSE file. |
2 | 2 | package org.openstreetmap.josm.gui.dialogs.relation; |
3 | 3 | |
4 | | import org.junit.jupiter.api.extension.RegisterExtension; |
5 | | import org.junit.jupiter.api.Test; |
6 | 4 | import org.openstreetmap.josm.data.osm.DataSet; |
7 | 5 | import org.openstreetmap.josm.data.osm.Relation; |
8 | 6 | import org.openstreetmap.josm.gui.layer.OsmDataLayer; |
9 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 7 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
10 | 8 | |
11 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 9 | import org.junit.jupiter.api.Test; |
12 | 10 | |
13 | 11 | /** |
14 | 12 | * Unit tests of {@link ReferringRelationsBrowser} class. |
15 | 13 | */ |
| 14 | @BasicPreferences |
16 | 15 | class ReferringRelationsBrowserTest { |
17 | | |
18 | | /** |
19 | | * Setup test. |
20 | | */ |
21 | | @RegisterExtension |
22 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
23 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
24 | | |
25 | 16 | /** |
26 | 17 | * Unit test of {@link ReferringRelationsBrowser#ReferringRelationsBrowser}. |
27 | 18 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/relation/RelationTreeCellRendererTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/relation/RelationTreeCellRendererTest.java
index 21bc646c7..f60041be2 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
5 | 5 | |
6 | 6 | import javax.swing.JTree; |
7 | 7 | |
8 | | import org.junit.jupiter.api.extension.RegisterExtension; |
9 | | import org.junit.jupiter.api.Test; |
10 | 8 | import org.openstreetmap.josm.data.osm.Relation; |
11 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 9 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
12 | 10 | |
13 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 11 | import org.junit.jupiter.api.Test; |
14 | 12 | |
15 | 13 | /** |
16 | 14 | * Unit tests of {@link RelationTreeCellRenderer} class. |
17 | 15 | */ |
| 16 | @BasicPreferences |
18 | 17 | class RelationTreeCellRendererTest { |
19 | | |
20 | | /** |
21 | | * Setup test. |
22 | | */ |
23 | | @RegisterExtension |
24 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
25 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
26 | | |
27 | 18 | /** |
28 | 19 | * Unit test of {@link RelationTreeCellRenderer#RelationTreeCellRenderer}. |
29 | 20 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableCellRendererTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableCellRendererTest.java
index 0df3c59a3..e71c0bdb1 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
5 | 5 | |
6 | 6 | import javax.swing.JTable; |
7 | 7 | |
8 | | import org.junit.jupiter.api.extension.RegisterExtension; |
9 | | import org.junit.jupiter.api.Test; |
10 | 8 | import org.openstreetmap.josm.data.osm.Node; |
11 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 9 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
12 | 10 | |
13 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 11 | import org.junit.jupiter.api.Test; |
14 | 12 | |
15 | 13 | /** |
16 | 14 | * Unit tests of {@link SelectionTableCellRenderer} class. |
17 | 15 | */ |
| 16 | @BasicPreferences |
18 | 17 | class SelectionTableCellRendererTest { |
19 | | |
20 | | /** |
21 | | * Setup test. |
22 | | */ |
23 | | @RegisterExtension |
24 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
25 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
26 | | |
27 | 18 | /** |
28 | 19 | * Unit test of {@link SelectionTableCellRenderer#SelectionTableCellRenderer}. |
29 | 20 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanelTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanelTest.java
index 1778a7e25..5e9489b71 100644
a
|
b
|
import java.util.Enumeration;
|
12 | 12 | import java.util.HashSet; |
13 | 13 | import java.util.Set; |
14 | 14 | |
15 | | import org.junit.jupiter.api.extension.RegisterExtension; |
16 | | import org.junit.jupiter.api.Test; |
17 | 15 | import org.openstreetmap.josm.data.osm.Node; |
18 | 16 | import org.openstreetmap.josm.data.osm.OsmPrimitive; |
19 | 17 | import org.openstreetmap.josm.data.validation.Severity; |
20 | 18 | import org.openstreetmap.josm.data.validation.TestError; |
21 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 19 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
22 | 20 | |
23 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 21 | import org.junit.jupiter.api.Test; |
24 | 22 | |
25 | 23 | /** |
26 | 24 | * Unit tests of {@link ValidatorTreePanel} class. |
27 | 25 | */ |
| 26 | @BasicPreferences |
28 | 27 | class ValidatorTreePanelTest { |
29 | | |
30 | | /** |
31 | | * Setup tests |
32 | | */ |
33 | | @RegisterExtension |
34 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
35 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
36 | | |
37 | 28 | /** |
38 | 29 | * Unit test of {@link ValidatorTreePanel#ValidatorTreePanel}. |
39 | 30 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/download/BookmarkSelectionTest.java b/test/unit/org/openstreetmap/josm/gui/download/BookmarkSelectionTest.java
index 38da9fc24..ad494e506 100644
a
|
b
|
|
1 | 1 | // License: GPL. For details, see LICENSE file. |
2 | 2 | package org.openstreetmap.josm.gui.download; |
3 | 3 | |
4 | | import org.junit.jupiter.api.extension.RegisterExtension; |
5 | | import org.junit.jupiter.api.Test; |
6 | 4 | import org.openstreetmap.josm.data.Bounds; |
7 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 5 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
8 | 6 | |
9 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 7 | import org.junit.jupiter.api.Test; |
10 | 8 | |
11 | 9 | /** |
12 | 10 | * Unit tests of {@link BookmarkSelection} class. |
13 | 11 | */ |
| 12 | @BasicPreferences |
14 | 13 | class BookmarkSelectionTest { |
15 | | |
16 | | /** |
17 | | * Setup tests |
18 | | */ |
19 | | @RegisterExtension |
20 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
21 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
22 | | |
23 | 14 | /** |
24 | 15 | * Test for {@link BookmarkSelection#BookmarkSelection}. |
25 | 16 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/download/BoundingBoxSelectionTest.java b/test/unit/org/openstreetmap/josm/gui/download/BoundingBoxSelectionTest.java
index bd1ab3a00..7ea92ad79 100644
a
|
b
|
|
1 | 1 | // License: GPL. For details, see LICENSE file. |
2 | 2 | package org.openstreetmap.josm.gui.download; |
3 | 3 | |
4 | | import org.junit.jupiter.api.extension.RegisterExtension; |
5 | | import org.junit.jupiter.api.Test; |
6 | 4 | import org.openstreetmap.josm.data.Bounds; |
7 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 5 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
8 | 6 | |
9 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 7 | import org.junit.jupiter.api.Test; |
10 | 8 | |
11 | 9 | /** |
12 | 10 | * Unit tests of {@link BoundingBoxSelection} class. |
13 | 11 | */ |
| 12 | @BasicPreferences |
14 | 13 | class BoundingBoxSelectionTest { |
15 | | |
16 | | /** |
17 | | * Setup tests |
18 | | */ |
19 | | @RegisterExtension |
20 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
21 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
22 | | |
23 | 14 | /** |
24 | 15 | * Test for {@link BoundingBoxSelection#BoundingBoxSelection}. |
25 | 16 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/download/PlaceSelectionTest.java b/test/unit/org/openstreetmap/josm/gui/download/PlaceSelectionTest.java
index 2a4f56a37..eb6b0e884 100644
a
|
b
|
|
1 | 1 | // License: GPL. For details, see LICENSE file. |
2 | 2 | package org.openstreetmap.josm.gui.download; |
3 | 3 | |
4 | | import org.junit.jupiter.api.extension.RegisterExtension; |
5 | | import org.junit.jupiter.api.Test; |
6 | 4 | import org.openstreetmap.josm.data.Bounds; |
7 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 5 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
8 | 6 | |
9 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 7 | import org.junit.jupiter.api.Test; |
10 | 8 | |
11 | 9 | /** |
12 | 10 | * Unit tests of {@link PlaceSelection} class. |
13 | 11 | */ |
| 12 | @BasicPreferences |
14 | 13 | class PlaceSelectionTest { |
15 | | |
16 | | /** |
17 | | * Setup tests |
18 | | */ |
19 | | @RegisterExtension |
20 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
21 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
22 | | |
23 | 14 | /** |
24 | 15 | * Test for {@link PlaceSelection#PlaceSelection}. |
25 | 16 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/download/TileSelectionTest.java b/test/unit/org/openstreetmap/josm/gui/download/TileSelectionTest.java
index 2b4a59b89..136ebfe02 100644
a
|
b
|
|
1 | 1 | // License: GPL. For details, see LICENSE file. |
2 | 2 | package org.openstreetmap.josm.gui.download; |
3 | 3 | |
4 | | import org.junit.jupiter.api.extension.RegisterExtension; |
5 | | import org.junit.jupiter.api.Test; |
6 | 4 | import org.openstreetmap.josm.data.Bounds; |
7 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 5 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
8 | 6 | |
9 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 7 | import org.junit.jupiter.api.Test; |
10 | 8 | |
11 | 9 | /** |
12 | 10 | * Unit tests of {@link TileSelection} class. |
13 | 11 | */ |
| 12 | @BasicPreferences |
14 | 13 | class TileSelectionTest { |
15 | | |
16 | | /** |
17 | | * Setup tests |
18 | | */ |
19 | | @RegisterExtension |
20 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
21 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
22 | | |
23 | 14 | /** |
24 | 15 | * Test for {@link TileSelection#TileSelection}. |
25 | 16 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/help/HyperlinkHandlerTest.java b/test/unit/org/openstreetmap/josm/gui/help/HyperlinkHandlerTest.java
index 605463bde..38ac72fdc 100644
a
|
b
|
import javax.swing.text.Element;
|
10 | 10 | import javax.swing.text.html.HTMLDocument; |
11 | 11 | import javax.swing.text.html.HTMLEditorKit; |
12 | 12 | |
13 | | import org.junit.jupiter.api.extension.RegisterExtension; |
14 | | import org.junit.jupiter.api.Test; |
15 | 13 | import org.openstreetmap.josm.gui.widgets.JosmEditorPane; |
16 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 14 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
17 | 15 | |
18 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 16 | import org.junit.jupiter.api.Test; |
19 | 17 | |
20 | 18 | /** |
21 | 19 | * Unit tests of {@link HyperlinkHandler} class. |
22 | 20 | */ |
| 21 | @BasicPreferences |
23 | 22 | class HyperlinkHandlerTest { |
24 | | |
25 | | /** |
26 | | * Setup tests |
27 | | */ |
28 | | @RegisterExtension |
29 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
30 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
31 | | |
32 | 23 | /** |
33 | 24 | * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/17338">#17338</a>. |
34 | 25 | * @throws Exception if an error occurs |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/history/CoordinateInfoViewerTest.java b/test/unit/org/openstreetmap/josm/gui/history/CoordinateInfoViewerTest.java
index c59e9e4c2..6cbb5c401 100644
a
|
b
|
package org.openstreetmap.josm.gui.history;
|
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 5 | import static org.junit.jupiter.api.Assertions.assertThrows; |
6 | 6 | |
7 | | import org.junit.jupiter.api.Test; |
8 | | import org.junit.jupiter.api.extension.RegisterExtension; |
9 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 7 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
10 | 8 | |
11 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 9 | import org.junit.jupiter.api.Test; |
12 | 10 | |
13 | 11 | /** |
14 | 12 | * Unit tests of {@link CoordinateInfoViewer} class. |
15 | 13 | */ |
| 14 | @BasicPreferences |
16 | 15 | class CoordinateInfoViewerTest { |
17 | | |
18 | | /** |
19 | | * Setup test. |
20 | | */ |
21 | | @RegisterExtension |
22 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
23 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
24 | | |
25 | 16 | /** |
26 | 17 | * Test for {@link CoordinateInfoViewer#CoordinateInfoViewer} - {@code null} handling. |
27 | 18 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/history/NodeListViewerTest.java b/test/unit/org/openstreetmap/josm/gui/history/NodeListViewerTest.java
index ae5a29987..59874f4a7 100644
a
|
b
|
package org.openstreetmap.josm.gui.history;
|
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 5 | import static org.junit.jupiter.api.Assertions.assertThrows; |
6 | 6 | |
7 | | import org.junit.jupiter.api.Test; |
8 | | import org.junit.jupiter.api.extension.RegisterExtension; |
9 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 7 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
10 | 8 | |
11 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 9 | import org.junit.jupiter.api.Test; |
12 | 10 | |
13 | 11 | /** |
14 | 12 | * Unit tests of {@link NodeListViewer} class. |
15 | 13 | */ |
| 14 | @BasicPreferences |
16 | 15 | class NodeListViewerTest { |
17 | | |
18 | | /** |
19 | | * Setup test. |
20 | | */ |
21 | | @RegisterExtension |
22 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
23 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
24 | | |
25 | 16 | /** |
26 | 17 | * Test for {@link NodeListViewer#NodeListViewer} - {@code null} handling. |
27 | 18 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanelTest.java b/test/unit/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanelTest.java
index b9ccf9bc9..8ef31c96a 100644
a
|
b
|
package org.openstreetmap.josm.gui.io;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | | import org.junit.jupiter.api.Test; |
8 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 6 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
9 | 7 | |
10 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 8 | import org.junit.jupiter.api.Test; |
11 | 9 | |
12 | 10 | /** |
13 | 11 | * Unit tests of {@link BasicUploadSettingsPanel} class. |
14 | 12 | */ |
| 13 | @BasicPreferences |
15 | 14 | class BasicUploadSettingsPanelTest { |
16 | | |
17 | | /** |
18 | | * Setup tests |
19 | | */ |
20 | | @RegisterExtension |
21 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
22 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
23 | | |
24 | 15 | /** |
25 | 16 | * Test of {@link BasicUploadSettingsPanel#BasicUploadSettingsPanel}. |
26 | 17 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/io/ChangesetCellRendererTest.java b/test/unit/org/openstreetmap/josm/gui/io/ChangesetCellRendererTest.java
index ce41c374e..8469abfda 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
5 | 5 | |
6 | 6 | import javax.swing.JList; |
7 | 7 | |
8 | | import org.junit.jupiter.api.extension.RegisterExtension; |
9 | 8 | import org.junit.jupiter.api.Test; |
10 | 9 | import org.openstreetmap.josm.data.osm.Changeset; |
11 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
12 | | |
13 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 10 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
14 | 11 | |
15 | 12 | import java.time.Instant; |
16 | 13 | |
17 | 14 | /** |
18 | 15 | * Unit tests of {@link ChangesetCellRenderer} class. |
19 | 16 | */ |
| 17 | @BasicPreferences |
20 | 18 | class ChangesetCellRendererTest { |
21 | | /** |
22 | | * Setup test. |
23 | | */ |
24 | | @RegisterExtension |
25 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
26 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
27 | | |
28 | 19 | /** |
29 | 20 | * Test of {@link ChangesetCellRenderer} class. |
30 | 21 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/io/ChangesetManagementPanelTest.java b/test/unit/org/openstreetmap/josm/gui/io/ChangesetManagementPanelTest.java
index 2981f2de5..6782cec38 100644
a
|
b
|
package org.openstreetmap.josm.gui.io;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | 6 | import org.junit.jupiter.api.Test; |
8 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
9 | | |
10 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 7 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
11 | 8 | |
12 | 9 | /** |
13 | 10 | * Unit tests of {@link ChangesetManagementPanel} class. |
14 | 11 | */ |
| 12 | @BasicPreferences |
15 | 13 | class ChangesetManagementPanelTest { |
16 | | |
17 | | /** |
18 | | * Setup tests |
19 | | */ |
20 | | @RegisterExtension |
21 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
22 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
23 | | |
24 | 14 | /** |
25 | 15 | * Test of {@link ChangesetManagementPanel#ChangesetManagementPanel}. |
26 | 16 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/io/CredentialDialogTest.java b/test/unit/org/openstreetmap/josm/gui/io/CredentialDialogTest.java
index 7a0803fc8..cb4526a49 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
6 | 6 | import static org.junit.jupiter.api.Assertions.assertFalse; |
7 | 7 | import static org.junit.jupiter.api.Assertions.assertTrue; |
8 | 8 | |
9 | | import org.junit.jupiter.api.extension.RegisterExtension; |
10 | 9 | import org.junit.jupiter.api.Test; |
11 | 10 | import org.openstreetmap.josm.gui.io.CredentialDialog.CredentialPanel; |
12 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
13 | | |
14 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 11 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
15 | 12 | |
16 | 13 | /** |
17 | 14 | * Unit tests of {@link CredentialDialog} class. |
18 | 15 | */ |
| 16 | @BasicPreferences |
19 | 17 | class CredentialDialogTest { |
20 | | |
21 | | /** |
22 | | * Setup tests |
23 | | */ |
24 | | @RegisterExtension |
25 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
26 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
27 | | |
28 | 18 | /** |
29 | 19 | * Test of {@link CredentialDialog.CredentialPanel} class. |
30 | 20 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/io/CustomConfiguratorTest.java b/test/unit/org/openstreetmap/josm/gui/io/CustomConfiguratorTest.java
index f2df27c60..bf9674f0a 100644
a
|
b
|
import java.util.Arrays;
|
13 | 13 | import java.util.Collections; |
14 | 14 | |
15 | 15 | import org.junit.jupiter.api.Test; |
16 | | import org.junit.jupiter.api.extension.RegisterExtension; |
17 | 16 | import org.openstreetmap.josm.TestUtils; |
18 | 17 | import org.openstreetmap.josm.data.Preferences; |
19 | 18 | import org.openstreetmap.josm.data.PreferencesUtils; |
20 | 19 | import org.openstreetmap.josm.spi.preferences.Config; |
21 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 20 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
22 | 21 | import org.openstreetmap.josm.tools.Utils; |
23 | 22 | |
24 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
25 | | |
26 | 23 | /** |
27 | 24 | * Unit tests for class {@link CustomConfigurator}. |
28 | 25 | */ |
| 26 | @BasicPreferences |
29 | 27 | class CustomConfiguratorTest { |
30 | | |
31 | | /** |
32 | | * Setup test. |
33 | | */ |
34 | | @RegisterExtension |
35 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
36 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
37 | | |
38 | 28 | /** |
39 | 29 | * Test method for {@link CustomConfigurator#exportPreferencesKeysToFile}. |
40 | 30 | * @throws IOException if any I/O error occurs |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/io/LayerNameAndFilePathTableCellTest.java b/test/unit/org/openstreetmap/josm/gui/io/LayerNameAndFilePathTableCellTest.java
index 1364dc96b..1b007c018 100644
a
|
b
|
import java.io.File;
|
9 | 9 | |
10 | 10 | import javax.swing.JTable; |
11 | 11 | |
12 | | import org.junit.jupiter.api.extension.RegisterExtension; |
13 | 12 | import org.junit.jupiter.api.Test; |
14 | 13 | import org.openstreetmap.josm.data.osm.DataSet; |
15 | 14 | import org.openstreetmap.josm.gui.layer.AbstractModifiableLayer; |
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.BasicPreferences; |
20 | 17 | |
21 | 18 | /** |
22 | 19 | * Unit tests of {@link LayerNameAndFilePathTableCell} class. |
23 | 20 | */ |
| 21 | @BasicPreferences |
24 | 22 | class LayerNameAndFilePathTableCellTest { |
25 | | /** |
26 | | * Setup test. |
27 | | */ |
28 | | @RegisterExtension |
29 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
30 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
31 | | |
32 | 23 | /** |
33 | 24 | * Test of {@link LayerNameAndFilePathTableCell} class. |
34 | 25 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/io/UploadDialogTest.java b/test/unit/org/openstreetmap/josm/gui/io/UploadDialogTest.java
index b8d6b8dc4..b0ac5aa32 100644
a
|
b
|
import java.util.function.Supplier;
|
17 | 17 | import javax.swing.JOptionPane; |
18 | 18 | |
19 | 19 | import org.junit.jupiter.api.Test; |
20 | | import org.junit.jupiter.api.extension.RegisterExtension; |
21 | 20 | import org.openstreetmap.josm.TestUtils; |
22 | 21 | import org.openstreetmap.josm.data.osm.DataSet; |
23 | 22 | import org.openstreetmap.josm.gui.io.UploadDialog.UploadAction; |
24 | 23 | import org.openstreetmap.josm.io.UploadStrategySpecification; |
25 | 24 | import org.openstreetmap.josm.spi.preferences.Config; |
26 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 25 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
27 | 26 | import org.openstreetmap.josm.testutils.mockers.WindowMocker; |
28 | 27 | |
29 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
30 | | |
31 | 28 | /** |
32 | 29 | * Unit tests of {@link UploadDialog} class. |
33 | 30 | */ |
| 31 | @BasicPreferences |
34 | 32 | class UploadDialogTest { |
35 | | |
36 | | /** |
37 | | * Setup tests |
38 | | */ |
39 | | @RegisterExtension |
40 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
41 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
42 | | |
43 | 33 | private static class MockUploadDialog extends JOptionPane implements IUploadDialog { |
44 | 34 | private final String source; |
45 | 35 | private final String comment; |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/io/UploadParameterSummaryPanelTest.java b/test/unit/org/openstreetmap/josm/gui/io/UploadParameterSummaryPanelTest.java
index 78206f4b3..c3ade6ebf 100644
a
|
b
|
package org.openstreetmap.josm.gui.io;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | 6 | import org.junit.jupiter.api.Test; |
8 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
9 | | |
10 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 7 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
11 | 8 | |
12 | 9 | /** |
13 | 10 | * Unit tests of {@link UploadParameterSummaryPanel} class. |
14 | 11 | */ |
| 12 | @BasicPreferences |
15 | 13 | class UploadParameterSummaryPanelTest { |
16 | | |
17 | | /** |
18 | | * Setup tests |
19 | | */ |
20 | | @RegisterExtension |
21 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
22 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
23 | | |
24 | 14 | /** |
25 | 15 | * Test of {@link UploadParameterSummaryPanel#UploadParameterSummaryPanel}. |
26 | 16 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/io/UploadTextComponentValidatorTest.java b/test/unit/org/openstreetmap/josm/gui/io/UploadTextComponentValidatorTest.java
index 29ad6e03c..16b00c90e 100644
a
|
b
|
import static org.hamcrest.MatcherAssert.assertThat;
|
7 | 7 | import javax.swing.JLabel; |
8 | 8 | import javax.swing.JTextField; |
9 | 9 | |
10 | | import org.junit.jupiter.api.extension.RegisterExtension; |
11 | 10 | import org.junit.jupiter.api.Test; |
12 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
13 | | |
14 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 11 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
15 | 12 | |
| 13 | @BasicPreferences |
16 | 14 | class UploadTextComponentValidatorTest { |
17 | | |
18 | | /** |
19 | | * Setup test. |
20 | | */ |
21 | | @RegisterExtension |
22 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
23 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
24 | | |
25 | 15 | /** |
26 | 16 | * Unit test of {@link UploadTextComponentValidator.UploadCommentValidator} |
27 | 17 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/layer/ImageryLayerTest.java b/test/unit/org/openstreetmap/josm/gui/layer/ImageryLayerTest.java
index fafe82955..d2b9092a1 100644
a
|
b
|
package org.openstreetmap.josm.gui.layer;
|
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 5 | import static org.junit.jupiter.api.Assertions.assertSame; |
6 | 6 | |
7 | | import org.junit.jupiter.api.extension.RegisterExtension; |
8 | 7 | import org.junit.jupiter.api.Test; |
9 | 8 | import org.openstreetmap.josm.gui.layer.imagery.ImageryFilterSettings; |
10 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
11 | | |
12 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 9 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
13 | 10 | |
14 | 11 | /** |
15 | 12 | * Unit tests of {@link ImageryLayer} class. |
16 | 13 | */ |
| 14 | @BasicPreferences |
17 | 15 | class ImageryLayerTest { |
18 | | |
19 | | /** |
20 | | * For creating layers |
21 | | */ |
22 | | @RegisterExtension |
23 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
24 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
25 | | |
26 | 16 | /** |
27 | 17 | * Unit test of {@link ImageryLayer#getFilterSettings()} |
28 | 18 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayerTest.java b/test/unit/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayerTest.java
index 94863932f..65c4ced30 100644
a
|
b
|
import java.util.Collections;
|
11 | 11 | import java.util.List; |
12 | 12 | |
13 | 13 | import org.junit.jupiter.api.Test; |
14 | | import org.junit.jupiter.api.extension.RegisterExtension; |
15 | 14 | import org.openstreetmap.josm.TestUtils; |
16 | 15 | import org.openstreetmap.josm.data.osm.DataSet; |
17 | 16 | import org.openstreetmap.josm.gui.MainApplication; |
… |
… |
import org.openstreetmap.josm.gui.layer.GpxLayer;
|
19 | 18 | import org.openstreetmap.josm.gui.layer.OsmDataLayer; |
20 | 19 | import org.openstreetmap.josm.gui.layer.geoimage.GeoImageLayer.Loader; |
21 | 20 | import org.openstreetmap.josm.io.GpxReader; |
22 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
23 | | |
24 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 21 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
25 | 22 | |
26 | 23 | /** |
27 | 24 | * Unit tests of {@link GeoImageLayer} class. |
28 | 25 | */ |
| 26 | @BasicPreferences |
29 | 27 | class GeoImageLayerTest { |
30 | | /** |
31 | | * We need prefs for this. |
32 | | */ |
33 | | @RegisterExtension |
34 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
35 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
36 | | |
37 | 28 | /** |
38 | 29 | * Unit test of {@link Loader} class. |
39 | 30 | * @throws Exception if any error occurs |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplayTest.java b/test/unit/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplayTest.java
index a66a6b80e..32f2c42e1 100644
a
|
b
|
import java.nio.file.Path;
|
13 | 13 | import java.nio.file.Paths; |
14 | 14 | |
15 | 15 | import org.junit.jupiter.api.Disabled; |
16 | | import org.junit.jupiter.api.extension.RegisterExtension; |
17 | 16 | import org.junit.jupiter.api.Test; |
18 | 17 | import org.openstreetmap.josm.gui.layer.geoimage.ImageDisplay.VisRect; |
19 | 18 | import org.openstreetmap.josm.gui.layer.imagery.ImageryFilterSettings; |
20 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
21 | | |
22 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 19 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
23 | 20 | |
24 | 21 | /** |
25 | 22 | * Unit tests of {@link ImageDisplay} class. |
26 | 23 | */ |
| 24 | @BasicPreferences |
27 | 25 | class ImageDisplayTest { |
28 | | /** |
29 | | * We need prefs for this. |
30 | | */ |
31 | | @RegisterExtension |
32 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
33 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
34 | | |
35 | 26 | /** |
36 | 27 | * Unit test of {@link ImageDisplay#calculateDrawImageRectangle}. |
37 | 28 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/layer/geoimage/ThumbsLoaderTest.java b/test/unit/org/openstreetmap/josm/gui/layer/geoimage/ThumbsLoaderTest.java
index 1576ae3c8..4a9620da4 100644
a
|
b
|
|
1 | 1 | // License: GPL. For details, see LICENSE file. |
2 | 2 | package org.openstreetmap.josm.gui.layer.geoimage; |
3 | 3 | |
4 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
5 | 4 | import org.junit.jupiter.api.Disabled; |
6 | 5 | import org.junit.jupiter.api.Test; |
7 | | import org.junit.jupiter.api.extension.RegisterExtension; |
8 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 6 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
9 | 7 | import org.openstreetmap.josm.tools.StreamUtils; |
10 | 8 | |
11 | 9 | import java.nio.file.DirectoryStream; |
… |
… |
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
21 | 19 | /** |
22 | 20 | * Unit tests of {@link ThumbsLoader} class. |
23 | 21 | */ |
| 22 | @BasicPreferences |
24 | 23 | class ThumbsLoaderTest { |
25 | | /** |
26 | | * Setup test. |
27 | | */ |
28 | | @RegisterExtension |
29 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
30 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
31 | | |
32 | 24 | /** |
33 | 25 | * Performance test for {@link ThumbsLoader} |
34 | 26 | * @throws Exception if any error occurs |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/layer/geoimage/WikimediaCommonsLoaderTest.java b/test/unit/org/openstreetmap/josm/gui/layer/geoimage/WikimediaCommonsLoaderTest.java
index ec436c82d..50336c02e 100644
a
|
b
|
|
2 | 2 | package org.openstreetmap.josm.gui.layer.geoimage; |
3 | 3 | |
4 | 4 | import com.github.tomakehurst.wiremock.WireMockServer; |
5 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
6 | 5 | import org.junit.jupiter.api.Test; |
7 | | import org.junit.jupiter.api.extension.RegisterExtension; |
8 | 6 | import org.openstreetmap.josm.data.Bounds; |
9 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 7 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
10 | 8 | |
11 | 9 | import java.net.URL; |
12 | 10 | import java.util.List; |
… |
… |
import static org.junit.jupiter.api.Assertions.assertEquals;
|
20 | 18 | /** |
21 | 19 | * Unit test of {@link WikimediaCommonsLoader} |
22 | 20 | */ |
| 21 | @BasicPreferences |
23 | 22 | class WikimediaCommonsLoaderTest { |
24 | | |
25 | | /** |
26 | | * Setup test. |
27 | | */ |
28 | | @RegisterExtension |
29 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
30 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
31 | | |
32 | 23 | /** |
33 | 24 | * Unit test of {@link WikimediaCommonsLoader} |
34 | 25 | * |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackActionTest.java b/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackActionTest.java
index 4c5126031..9e81d26af 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertNull;
|
7 | 7 | |
8 | 8 | import java.util.Collections; |
9 | 9 | |
10 | | import org.junit.jupiter.api.extension.RegisterExtension; |
11 | 10 | import org.junit.jupiter.api.Test; |
12 | 11 | import org.openstreetmap.josm.TestUtils; |
13 | 12 | import org.openstreetmap.josm.data.gpx.GpxData; |
… |
… |
import org.openstreetmap.josm.gui.MainApplication;
|
16 | 15 | import org.openstreetmap.josm.gui.PleaseWaitRunnable; |
17 | 16 | import org.openstreetmap.josm.gui.layer.OsmDataLayer; |
18 | 17 | import org.openstreetmap.josm.io.GpxReaderTest; |
19 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 18 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
20 | 19 | import org.openstreetmap.josm.testutils.mockers.HelpAwareOptionPaneMocker; |
21 | 20 | |
22 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
23 | | |
24 | 21 | /** |
25 | 22 | * Unit tests of {@link DownloadAlongTrackAction} class. |
26 | 23 | */ |
| 24 | @BasicPreferences |
27 | 25 | class DownloadAlongTrackActionTest { |
28 | | |
29 | | /** |
30 | | * The test rules for this test |
31 | | */ |
32 | | @RegisterExtension |
33 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
34 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
35 | | |
36 | 26 | private static PleaseWaitRunnable createTask(String file) throws Exception { |
37 | 27 | // click "Download" when presented with the appropriate HelpAwareOptionPane |
38 | 28 | final HelpAwareOptionPaneMocker haMocker = new HelpAwareOptionPaneMocker(Collections.singletonMap( |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionFactoryTest.java b/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionFactoryTest.java
index 31f0bcf68..e87f16ac5 100644
a
|
b
|
package org.openstreetmap.josm.gui.mappaint.mapcss;
|
4 | 4 | import static org.junit.jupiter.api.Assertions.assertThrows; |
5 | 5 | |
6 | 6 | import org.junit.jupiter.api.Test; |
7 | | import org.junit.jupiter.api.extension.RegisterExtension; |
8 | 7 | import org.openstreetmap.josm.gui.mappaint.mapcss.Condition.Context; |
9 | 8 | import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.Op; |
10 | 9 | import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.PseudoClasses; |
11 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 10 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
12 | 11 | |
13 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
14 | 12 | import net.trajano.commons.testing.UtilityClassTestUtil; |
15 | 13 | |
16 | 14 | import java.lang.reflect.Method; |
… |
… |
import java.lang.reflect.Modifier;
|
19 | 17 | /** |
20 | 18 | * Unit tests of {@link ConditionFactory}. |
21 | 19 | */ |
| 20 | @BasicPreferences |
22 | 21 | class ConditionFactoryTest { |
23 | | |
24 | | /** |
25 | | * Setup rule |
26 | | */ |
27 | | @RegisterExtension |
28 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
29 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
30 | | |
31 | 22 | /** |
32 | 23 | * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/14368">#14368</a>. |
33 | 24 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionTest.java b/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionTest.java
index ddcb220f7..08fa59996 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
7 | 7 | |
8 | 8 | import org.junit.jupiter.api.BeforeEach; |
9 | 9 | import org.junit.jupiter.api.Test; |
10 | | import org.junit.jupiter.api.extension.RegisterExtension; |
11 | 10 | import org.openstreetmap.josm.data.osm.OsmPrimitive; |
12 | 11 | import org.openstreetmap.josm.data.osm.OsmUtils; |
13 | 12 | import org.openstreetmap.josm.gui.mappaint.Environment; |
… |
… |
import org.openstreetmap.josm.gui.mappaint.mapcss.Condition.Context;
|
15 | 14 | import org.openstreetmap.josm.gui.mappaint.mapcss.Condition.TagCondition; |
16 | 15 | import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.Op; |
17 | 16 | import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.SimpleKeyValueCondition; |
18 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
19 | | |
20 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 17 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
21 | 18 | |
22 | 19 | /** |
23 | 20 | * This test universally tests all {@link Condition}s. |
24 | 21 | * @author Michael Zangl |
25 | 22 | */ |
| 23 | // We need prefs for nodes |
| 24 | @BasicPreferences |
26 | 25 | class ConditionTest { |
27 | | /** |
28 | | * We need prefs for nodes. |
29 | | */ |
30 | | @RegisterExtension |
31 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
32 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
33 | 26 | private OsmPrimitive node0; |
34 | 27 | private OsmPrimitive node1; |
35 | 28 | private OsmPrimitive node2; |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUITest.java b/test/unit/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUITest.java
index 12171fb63..da21cc936 100644
a
|
b
|
package org.openstreetmap.josm.gui.oauth;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | | import org.junit.jupiter.api.Test; |
8 | 6 | import org.openstreetmap.josm.gui.MainApplication; |
9 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 7 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
10 | 8 | |
11 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 9 | import org.junit.jupiter.api.Test; |
12 | 10 | |
13 | 11 | /** |
14 | 12 | * Unit tests of {@link FullyAutomaticAuthorizationUI} class. |
15 | 13 | */ |
| 14 | @BasicPreferences |
16 | 15 | class FullyAutomaticAuthorizationUITest { |
17 | | |
18 | | /** |
19 | | * Setup tests |
20 | | */ |
21 | | @RegisterExtension |
22 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
23 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
24 | | |
25 | 16 | /** |
26 | 17 | * Unit test of {@link FullyAutomaticAuthorizationUI#FullyAutomaticAuthorizationUI}. |
27 | 18 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/oauth/FullyAutomaticPropertiesPanelTest.java b/test/unit/org/openstreetmap/josm/gui/oauth/FullyAutomaticPropertiesPanelTest.java
index bd2417596..28f348930 100644
a
|
b
|
package org.openstreetmap.josm.gui.oauth;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertTrue; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | 6 | import org.junit.jupiter.api.Test; |
8 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
9 | | |
10 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 7 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
11 | 8 | |
12 | 9 | /** |
13 | 10 | * Unit tests of {@link FullyAutomaticPropertiesPanel} class. |
14 | 11 | */ |
| 12 | @BasicPreferences |
15 | 13 | class FullyAutomaticPropertiesPanelTest { |
16 | | |
17 | | /** |
18 | | * Setup tests |
19 | | */ |
20 | | @RegisterExtension |
21 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
22 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
23 | | |
24 | 14 | /** |
25 | 15 | * Unit test of {@link FullyAutomaticPropertiesPanel#FullyAutomaticPropertiesPanel}. |
26 | 16 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUITest.java b/test/unit/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUITest.java
index 32cd22c48..dc12267d7 100644
a
|
b
|
package org.openstreetmap.josm.gui.oauth;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | 6 | import org.junit.jupiter.api.Test; |
8 | 7 | import org.openstreetmap.josm.gui.MainApplication; |
9 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
10 | | |
11 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 8 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
12 | 9 | |
13 | 10 | /** |
14 | 11 | * Unit tests of {@link ManualAuthorizationUI} class. |
15 | 12 | */ |
| 13 | @BasicPreferences |
16 | 14 | class ManualAuthorizationUITest { |
17 | | |
18 | | /** |
19 | | * Setup tests |
20 | | */ |
21 | | @RegisterExtension |
22 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
23 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
24 | | |
25 | 15 | /** |
26 | 16 | * Unit test of {@link ManualAuthorizationUI#ManualAuthorizationUI}. |
27 | 17 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/oauth/SemiAutomaticAuthorizationUITest.java b/test/unit/org/openstreetmap/josm/gui/oauth/SemiAutomaticAuthorizationUITest.java
index ef0cf8e2e..b72d8cd48 100644
a
|
b
|
package org.openstreetmap.josm.gui.oauth;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | 6 | import org.junit.jupiter.api.Test; |
8 | 7 | import org.openstreetmap.josm.gui.MainApplication; |
9 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
10 | | |
11 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 8 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
12 | 9 | |
13 | 10 | /** |
14 | 11 | * Unit tests of {@link SemiAutomaticAuthorizationUI} class. |
15 | 12 | */ |
| 13 | @BasicPreferences |
16 | 14 | class SemiAutomaticAuthorizationUITest { |
17 | | |
18 | | /** |
19 | | * Setup tests |
20 | | */ |
21 | | @RegisterExtension |
22 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
23 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
24 | | |
25 | 15 | /** |
26 | 16 | * Unit test of {@link SemiAutomaticAuthorizationUI#SemiAutomaticAuthorizationUI}. |
27 | 17 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/preferences/imagery/AddTMSLayerPanelTest.java b/test/unit/org/openstreetmap/josm/gui/preferences/imagery/AddTMSLayerPanelTest.java
index 3a4890986..65bf80c11 100644
a
|
b
|
package org.openstreetmap.josm.gui.preferences.imagery;
|
4 | 4 | import static org.junit.jupiter.api.Assertions.assertEquals; |
5 | 5 | import static org.junit.jupiter.api.Assertions.assertFalse; |
6 | 6 | |
7 | | import org.junit.jupiter.api.extension.RegisterExtension; |
8 | | import org.junit.jupiter.api.Test; |
9 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
10 | 7 | |
11 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 8 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
| 9 | |
| 10 | import org.junit.jupiter.api.Test; |
12 | 11 | |
13 | 12 | /** |
14 | 13 | * Unit tests of {@link AddTMSLayerPanel} class. |
15 | 14 | */ |
| 15 | @BasicPreferences |
16 | 16 | class AddTMSLayerPanelTest { |
17 | | |
18 | | /** |
19 | | * Setup tests |
20 | | */ |
21 | | @RegisterExtension |
22 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
23 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
24 | | |
25 | 17 | /** |
26 | 18 | * Unit test of {@link AddTMSLayerPanel}. |
27 | 19 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanelTest.java b/test/unit/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanelTest.java
index 465d3d5eb..4f97f4f67 100644
a
|
b
|
package org.openstreetmap.josm.gui.preferences.imagery;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertFalse; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | | import org.junit.jupiter.api.Test; |
8 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
9 | 6 | |
10 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 7 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
| 8 | |
| 9 | import org.junit.jupiter.api.Test; |
11 | 10 | |
12 | 11 | /** |
13 | 12 | * Unit tests of {@link AddWMSLayerPanel} class. |
14 | 13 | */ |
| 14 | @BasicPreferences |
15 | 15 | class AddWMSLayerPanelTest { |
16 | | |
17 | | /** |
18 | | * Setup tests |
19 | | */ |
20 | | @RegisterExtension |
21 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
22 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
23 | | |
24 | 16 | /** |
25 | 17 | * Unit test of {@link AddWMSLayerPanel}. |
26 | 18 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/preferences/imagery/AddWMTSLayerPanelTest.java b/test/unit/org/openstreetmap/josm/gui/preferences/imagery/AddWMTSLayerPanelTest.java
index 4beaa26ee..b97153f9f 100644
a
|
b
|
package org.openstreetmap.josm.gui.preferences.imagery;
|
4 | 4 | import static org.junit.jupiter.api.Assertions.assertFalse; |
5 | 5 | import static org.junit.jupiter.api.Assertions.assertThrows; |
6 | 6 | |
7 | | import org.junit.jupiter.api.Test; |
8 | | import org.junit.jupiter.api.extension.RegisterExtension; |
9 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 7 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
10 | 8 | |
11 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 9 | import org.junit.jupiter.api.Test; |
12 | 10 | |
13 | 11 | /** |
14 | 12 | * Unit tests of {@link AddWMTSLayerPanel} class. |
15 | 13 | */ |
| 14 | @BasicPreferences |
16 | 15 | class AddWMTSLayerPanelTest { |
17 | | |
18 | | /** |
19 | | * Setup tests |
20 | | */ |
21 | | @RegisterExtension |
22 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
23 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
24 | | |
25 | 16 | /** |
26 | 17 | * Unit test of {@link AddWMTSLayerPanel}. |
27 | 18 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/preferences/server/ProxyPreferenceTest.java b/test/unit/org/openstreetmap/josm/gui/preferences/server/ProxyPreferenceTest.java
index 41ce88a64..ed4d370e1 100644
a
|
b
|
|
1 | 1 | // License: GPL. For details, see LICENSE file. |
2 | 2 | package org.openstreetmap.josm.gui.preferences.server; |
3 | 3 | |
| 4 | import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; |
4 | 5 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 6 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | 7 | import org.junit.jupiter.api.Test; |
8 | 8 | import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils; |
9 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
10 | | |
11 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 9 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
12 | 10 | |
13 | 11 | /** |
14 | 12 | * Unit tests of {@link ProxyPreference} class. |
15 | 13 | */ |
| 14 | @BasicPreferences |
16 | 15 | class ProxyPreferenceTest { |
17 | | |
18 | | /** |
19 | | * Setup tests |
20 | | */ |
21 | | @RegisterExtension |
22 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
23 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
24 | | |
25 | 16 | /** |
26 | 17 | * Unit test of {@link ProxyPreference#ProxyPreference}. |
27 | 18 | */ |
… |
… |
class ProxyPreferenceTest {
|
35 | 26 | */ |
36 | 27 | @Test |
37 | 28 | void testAddGui() { |
38 | | PreferencesTestUtils.doTestPreferenceSettingAddGui(new ProxyPreference.Factory(), null); |
| 29 | assertDoesNotThrow(() -> PreferencesTestUtils.doTestPreferenceSettingAddGui(new ProxyPreference.Factory(), null)); |
39 | 30 | } |
40 | 31 | } |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/preferences/server/ServerAccessPreferenceTest.java b/test/unit/org/openstreetmap/josm/gui/preferences/server/ServerAccessPreferenceTest.java
index ad6a9c9b1..d4b84fdde 100644
a
|
b
|
|
1 | 1 | // License: GPL. For details, see LICENSE file. |
2 | 2 | package org.openstreetmap.josm.gui.preferences.server; |
3 | 3 | |
| 4 | import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; |
4 | 5 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 6 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | | import org.junit.jupiter.api.Test; |
| 7 | |
8 | 8 | import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils; |
9 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 9 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
10 | 10 | |
11 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 11 | import org.junit.jupiter.api.Test; |
12 | 12 | |
13 | 13 | /** |
14 | 14 | * Unit tests of {@link ServerAccessPreference} class. |
15 | 15 | */ |
| 16 | @BasicPreferences |
16 | 17 | class ServerAccessPreferenceTest { |
17 | | |
18 | | /** |
19 | | * Setup tests |
20 | | */ |
21 | | @RegisterExtension |
22 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
23 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
24 | | |
25 | 18 | /** |
26 | 19 | * Unit test of {@link ServerAccessPreference#ServerAccessPreference}. |
27 | 20 | */ |
… |
… |
class ServerAccessPreferenceTest {
|
35 | 28 | */ |
36 | 29 | @Test |
37 | 30 | void testAddGui() { |
38 | | PreferencesTestUtils.doTestPreferenceSettingAddGui(new ServerAccessPreference.Factory(), null); |
| 31 | assertDoesNotThrow(() -> PreferencesTestUtils.doTestPreferenceSettingAddGui(new ServerAccessPreference.Factory(), null)); |
39 | 32 | } |
40 | 33 | } |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/util/WindowGeometryTest.java b/test/unit/org/openstreetmap/josm/gui/util/WindowGeometryTest.java
index e34f909dd..4845608e8 100644
a
|
b
|
import javax.swing.JLabel;
|
15 | 15 | import javax.swing.JPanel; |
16 | 16 | |
17 | 17 | import org.junit.jupiter.api.Test; |
18 | | import org.junit.jupiter.api.extension.RegisterExtension; |
19 | 18 | import org.openstreetmap.josm.TestUtils; |
20 | 19 | import org.openstreetmap.josm.gui.util.WindowGeometry.WindowGeometryException; |
21 | 20 | import org.openstreetmap.josm.spi.preferences.Config; |
22 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 21 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
23 | 22 | |
24 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
25 | 23 | import nl.jqno.equalsverifier.EqualsVerifier; |
26 | 24 | import nl.jqno.equalsverifier.Warning; |
| 25 | import org.junit.jupiter.params.ParameterizedTest; |
| 26 | import org.junit.jupiter.params.provider.NullSource; |
| 27 | import org.junit.jupiter.params.provider.ValueSource; |
27 | 28 | |
28 | 29 | /** |
29 | 30 | * Unit tests of {@link WindowGeometry} class. |
30 | 31 | */ |
| 32 | @BasicPreferences |
31 | 33 | class WindowGeometryTest { |
32 | | /** |
33 | | * Some of this depends on preferences. |
34 | | */ |
35 | | @RegisterExtension |
36 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
37 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
38 | | |
39 | 34 | /** |
40 | 35 | * Test of {@link WindowGeometry#centerInWindow} method. |
41 | 36 | */ |
… |
… |
class WindowGeometryTest {
|
61 | 56 | /** |
62 | 57 | * Test of {@link WindowGeometry.WindowGeometryException} class. |
63 | 58 | */ |
64 | | @Test |
65 | | void testWindowGeometryException1() { |
66 | | Config.getPref().put("test", null); |
67 | | assertThrows(WindowGeometryException.class, () -> new WindowGeometry("test")); |
68 | | } |
69 | | |
70 | | /** |
71 | | * Test of {@link WindowGeometry.WindowGeometryException} class. |
72 | | */ |
73 | | @Test |
74 | | void testWindowGeometryException2() { |
75 | | Config.getPref().put("test", ""); |
76 | | assertThrows(WindowGeometryException.class, () -> new WindowGeometry("test")); |
77 | | } |
78 | | |
79 | | /** |
80 | | * Test of {@link WindowGeometry.WindowGeometryException} class. |
81 | | */ |
82 | | @Test |
83 | | void testWindowGeometryException3() { |
84 | | Config.getPref().put("test", "x=not_a_number"); |
85 | | assertThrows(WindowGeometryException.class, () -> new WindowGeometry("test")); |
86 | | } |
87 | | |
88 | | /** |
89 | | * Test of {@link WindowGeometry.WindowGeometryException} class. |
90 | | */ |
91 | | @Test |
92 | | void testWindowGeometryException4() { |
93 | | Config.getPref().put("test", "wrong_pattern"); |
| 59 | @ParameterizedTest |
| 60 | @NullSource |
| 61 | @ValueSource(strings = {"", "x=not_a_number", "wrong_pattern"}) |
| 62 | void testWindowGeometryException(String badValue) { |
| 63 | Config.getPref().put("test", badValue); |
94 | 64 | assertThrows(WindowGeometryException.class, () -> new WindowGeometry("test")); |
95 | 65 | } |
96 | 66 | |
… |
… |
class WindowGeometryTest {
|
99 | 69 | * @throws WindowGeometryException never |
100 | 70 | */ |
101 | 71 | @Test |
102 | | void testWindowGeometryException5() throws WindowGeometryException { |
| 72 | void testWindowGeometryExceptionNoThrow() throws WindowGeometryException { |
103 | 73 | Config.getPref().put("test", "x=15,y=55,width=200,height=100"); |
104 | 74 | assertNotNull(new WindowGeometry("test")); |
105 | 75 | } |
-
diff --git a/test/unit/org/openstreetmap/josm/io/CertificateAmendmentTest.java b/test/unit/org/openstreetmap/josm/io/CertificateAmendmentTest.java
index 39643fc6d..0be0f1838 100644
a
|
b
|
|
1 | 1 | // License: GPL. For details, see LICENSE file. |
2 | 2 | package org.openstreetmap.josm.io; |
3 | 3 | |
4 | | import org.junit.jupiter.api.extension.RegisterExtension; |
5 | | import org.junit.jupiter.api.Test; |
6 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 4 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
7 | 5 | |
8 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
9 | 6 | import net.trajano.commons.testing.UtilityClassTestUtil; |
| 7 | import org.junit.jupiter.api.Test; |
10 | 8 | |
11 | 9 | /** |
12 | 10 | * Unit tests of {@link CertificateAmendment} class. |
13 | 11 | */ |
| 12 | @BasicPreferences |
14 | 13 | class CertificateAmendmentTest { |
15 | | |
16 | | /** |
17 | | * Setup rule |
18 | | */ |
19 | | @RegisterExtension |
20 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
21 | | public JOSMTestRules test = new JOSMTestRules(); |
22 | | |
23 | 14 | /** |
24 | 15 | * Tests that {@code CertificateAmendment} satisfies utility class criteria. |
25 | 16 | * @throws ReflectiveOperationException if an error occurs |
-
diff --git a/test/unit/org/openstreetmap/josm/io/ChangesetQueryTest.java b/test/unit/org/openstreetmap/josm/io/ChangesetQueryTest.java
index 661ae0b3f..a07959297 100644
a
|
b
|
|
1 | 1 | // License: GPL. For details, see LICENSE file. |
2 | 2 | package org.openstreetmap.josm.io; |
3 | 3 | |
4 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
5 | 4 | import org.junit.jupiter.api.Test; |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 5 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
8 | 6 | |
9 | 7 | import java.time.Instant; |
10 | 8 | import java.util.Arrays; |
… |
… |
import static org.junit.jupiter.api.Assertions.assertThrows;
|
15 | 13 | /** |
16 | 14 | * Unit tests of {@link ChangesetQuery} |
17 | 15 | */ |
| 16 | @BasicPreferences |
18 | 17 | class ChangesetQueryTest { |
19 | | |
20 | | /** |
21 | | * Setup test. |
22 | | */ |
23 | | @RegisterExtension |
24 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
25 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
26 | | |
27 | 18 | /** |
28 | 19 | * Unit tests of {@link ChangesetQuery#getQueryString()} |
29 | 20 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/io/DiffResultProcessorTest.java b/test/unit/org/openstreetmap/josm/io/DiffResultProcessorTest.java
index df8f52831..457c988ea 100644
a
|
b
|
import java.util.Arrays;
|
9 | 9 | import java.util.Collections; |
10 | 10 | import java.util.Set; |
11 | 11 | |
12 | | import org.junit.jupiter.api.extension.RegisterExtension; |
13 | | import org.junit.jupiter.api.Test; |
14 | 12 | import org.openstreetmap.josm.data.coor.LatLon; |
15 | 13 | import org.openstreetmap.josm.data.osm.Changeset; |
16 | 14 | import org.openstreetmap.josm.data.osm.Node; |
… |
… |
import org.openstreetmap.josm.data.osm.SimplePrimitiveId;
|
21 | 19 | import org.openstreetmap.josm.data.osm.Way; |
22 | 20 | import org.openstreetmap.josm.gui.progress.NullProgressMonitor; |
23 | 21 | import org.openstreetmap.josm.io.DiffResultProcessor.DiffResultEntry; |
24 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 22 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
25 | 23 | import org.openstreetmap.josm.tools.Logging; |
26 | 24 | import org.openstreetmap.josm.tools.XmlParsingException; |
27 | 25 | |
28 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 26 | import org.junit.jupiter.api.Test; |
29 | 27 | |
30 | 28 | /** |
31 | 29 | * Unit tests of {@link DiffResultProcessor} |
32 | 30 | */ |
| 31 | @BasicPreferences |
33 | 32 | class DiffResultProcessorTest { |
34 | | |
35 | | /** |
36 | | * Setup rule |
37 | | */ |
38 | | @RegisterExtension |
39 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
40 | | public JOSMTestRules test = new JOSMTestRules(); |
41 | | |
42 | 33 | private static void shouldFail(String s) { |
43 | 34 | try { |
44 | 35 | new DiffResultProcessor(null).parse(s, NullProgressMonitor.INSTANCE); |
-
diff --git a/test/unit/org/openstreetmap/josm/io/GeoJSONReaderTest.java b/test/unit/org/openstreetmap/josm/io/GeoJSONReaderTest.java
index 1ca48e8e1..2ca530d8e 100644
a
|
b
|
import java.util.List;
|
18 | 18 | import java.util.Optional; |
19 | 19 | import java.util.stream.IntStream; |
20 | 20 | |
21 | | import org.junit.jupiter.api.Test; |
22 | | import org.junit.jupiter.api.extension.RegisterExtension; |
23 | 21 | import org.openstreetmap.josm.TestUtils; |
24 | 22 | import org.openstreetmap.josm.data.coor.LatLon; |
25 | 23 | import org.openstreetmap.josm.data.osm.Node; |
26 | 24 | import org.openstreetmap.josm.data.osm.OsmPrimitive; |
27 | 25 | import org.openstreetmap.josm.data.osm.Relation; |
28 | 26 | import org.openstreetmap.josm.data.osm.Way; |
29 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 27 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
| 28 | |
| 29 | import org.junit.jupiter.api.Test; |
30 | 30 | |
31 | 31 | /** |
32 | 32 | * Unit tests of {@link GeoJSONReader}. |
33 | 33 | */ |
| 34 | @BasicPreferences |
34 | 35 | class GeoJSONReaderTest { |
35 | | |
36 | | /** |
37 | | * Setup test. |
38 | | */ |
39 | | @RegisterExtension |
40 | | public JOSMTestRules rules = new JOSMTestRules(); |
41 | | |
42 | 36 | /** |
43 | 37 | * Test reading a GeoJSON file. |
44 | 38 | * @throws Exception in case of error |
-
diff --git a/test/unit/org/openstreetmap/josm/io/GpxReaderTest.java b/test/unit/org/openstreetmap/josm/io/GpxReaderTest.java
index b146039d1..6ef2eee23 100644
a
|
b
|
|
2 | 2 | package org.openstreetmap.josm.io; |
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertEquals; |
5 | | import static org.junit.jupiter.api.Assertions.assertTrue; |
6 | 5 | import static org.junit.jupiter.api.Assertions.assertThrows; |
| 6 | import static org.junit.jupiter.api.Assertions.assertTrue; |
7 | 7 | |
8 | 8 | import java.io.ByteArrayInputStream; |
9 | 9 | import java.io.File; |
… |
… |
import java.util.ArrayList;
|
14 | 14 | import java.util.HashMap; |
15 | 15 | import java.util.Map; |
16 | 16 | |
17 | | import org.junit.jupiter.api.Test; |
18 | | import org.junit.jupiter.api.extension.RegisterExtension; |
19 | 17 | import org.openstreetmap.josm.TestUtils; |
20 | 18 | import org.openstreetmap.josm.data.Bounds; |
21 | 19 | import org.openstreetmap.josm.data.coor.LatLon; |
22 | 20 | import org.openstreetmap.josm.data.gpx.GpxData; |
23 | 21 | import org.openstreetmap.josm.data.gpx.WayPoint; |
24 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
25 | | import org.xml.sax.SAXException; |
| 22 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
26 | 23 | |
27 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 24 | import org.junit.jupiter.api.Test; |
| 25 | import org.xml.sax.SAXException; |
28 | 26 | |
29 | 27 | /** |
30 | 28 | * Tests the {@link GpxReader}. |
31 | 29 | */ |
| 30 | @BasicPreferences |
32 | 31 | public class GpxReaderTest { |
33 | | |
34 | | /** |
35 | | * Setup rule |
36 | | */ |
37 | | @RegisterExtension |
38 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
39 | | public JOSMTestRules test = new JOSMTestRules(); |
40 | | |
41 | 32 | /** |
42 | 33 | * Parses a GPX file and returns the parsed data |
43 | 34 | * @param filename the GPX file to parse |
-
diff --git a/test/unit/org/openstreetmap/josm/io/GpxWriterTest.java b/test/unit/org/openstreetmap/josm/io/GpxWriterTest.java
index 78d703cd4..16a431d64 100644
a
|
b
|
import java.util.Arrays;
|
14 | 14 | import java.util.HashMap; |
15 | 15 | import java.util.function.Consumer; |
16 | 16 | |
17 | | import org.junit.jupiter.api.Test; |
18 | | import org.junit.jupiter.api.extension.RegisterExtension; |
19 | 17 | import org.openstreetmap.josm.data.coor.LatLon; |
20 | 18 | import org.openstreetmap.josm.data.gpx.GpxConstants; |
21 | 19 | import org.openstreetmap.josm.data.gpx.GpxData; |
… |
… |
import org.openstreetmap.josm.data.gpx.GpxExtensionCollection;
|
24 | 22 | import org.openstreetmap.josm.data.gpx.GpxTrack; |
25 | 23 | import org.openstreetmap.josm.data.gpx.GpxTrackSegment; |
26 | 24 | import org.openstreetmap.josm.data.gpx.WayPoint; |
27 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 25 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
28 | 26 | |
29 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 27 | import org.junit.jupiter.api.Test; |
30 | 28 | |
31 | 29 | /** |
32 | 30 | * Tests the {@link GpxWriter}. |
33 | 31 | */ |
| 32 | @BasicPreferences |
34 | 33 | public class GpxWriterTest { |
35 | | |
36 | | /** |
37 | | * Setup rule |
38 | | */ |
39 | | @RegisterExtension |
40 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
41 | | public JOSMTestRules test = new JOSMTestRules(); |
42 | | |
43 | 34 | private static void testSingleWaypoint(Consumer<WayPoint> consumer, String atts) throws IOException { |
44 | 35 | GpxData gpx = new GpxData(); |
45 | 36 | WayPoint waypoint = new WayPoint(LatLon.ZERO); |
-
diff --git a/test/unit/org/openstreetmap/josm/io/MultiFetchOverpassObjectReaderTest.java b/test/unit/org/openstreetmap/josm/io/MultiFetchOverpassObjectReaderTest.java
index c97a61293..57cd6d6c8 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
6 | 6 | import java.util.Arrays; |
7 | 7 | import java.util.List; |
8 | 8 | |
9 | | import org.junit.jupiter.api.extension.RegisterExtension; |
10 | 9 | import org.junit.jupiter.api.Test; |
11 | 10 | import org.openstreetmap.josm.data.osm.Node; |
12 | 11 | import org.openstreetmap.josm.data.osm.OsmPrimitive; |
13 | 12 | import org.openstreetmap.josm.data.osm.Relation; |
14 | 13 | import org.openstreetmap.josm.data.osm.Way; |
15 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
16 | | |
17 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 14 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
18 | 15 | |
19 | 16 | /** |
20 | 17 | * Unit tests of {@link MultiFetchOverpassObjectReader}. |
21 | 18 | */ |
| 19 | @BasicPreferences |
22 | 20 | class MultiFetchOverpassObjectReaderTest { |
23 | | |
24 | | /** |
25 | | * Setup test. |
26 | | */ |
27 | | @RegisterExtension |
28 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
29 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
30 | | |
31 | 21 | /** |
32 | 22 | * Test {@link MultiFetchOverpassObjectReader#buildRequestString} |
33 | 23 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/io/OsmApiExceptionTest.java b/test/unit/org/openstreetmap/josm/io/OsmApiExceptionTest.java
index 38aca1ec6..5b34fd8c3 100644
a
|
b
|
package org.openstreetmap.josm.io;
|
4 | 4 | import static org.junit.jupiter.api.Assertions.assertFalse; |
5 | 5 | import static org.junit.jupiter.api.Assertions.assertTrue; |
6 | 6 | |
7 | | import org.junit.jupiter.api.extension.RegisterExtension; |
8 | 7 | import org.junit.jupiter.api.Test; |
9 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
10 | | |
11 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 8 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
12 | 9 | |
13 | 10 | /** |
14 | 11 | * Unit tests of {@link OsmApiException} class. |
15 | 12 | */ |
| 13 | @BasicPreferences |
16 | 14 | class OsmApiExceptionTest { |
17 | | |
18 | | /** |
19 | | * Setup tests |
20 | | */ |
21 | | @RegisterExtension |
22 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
23 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
24 | | |
25 | 15 | /** |
26 | 16 | * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/17328">Bug #17328</a>. |
27 | 17 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/io/OsmChangeBuilderTest.java b/test/unit/org/openstreetmap/josm/io/OsmChangeBuilderTest.java
index 759566ced..04a220246 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.fail;
|
6 | 6 | |
7 | 7 | import java.util.Arrays; |
8 | 8 | |
9 | | import org.junit.jupiter.api.extension.RegisterExtension; |
10 | | import org.junit.jupiter.api.Test; |
11 | 9 | import org.openstreetmap.josm.data.coor.LatLon; |
12 | 10 | import org.openstreetmap.josm.data.osm.Changeset; |
13 | 11 | import org.openstreetmap.josm.data.osm.Node; |
14 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 12 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
15 | 13 | import org.openstreetmap.josm.tools.Logging; |
16 | 14 | |
17 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 15 | import org.junit.jupiter.api.Test; |
18 | 16 | |
19 | 17 | /** |
20 | 18 | * Unit tests of {@link OsmChangeBuilder} |
21 | 19 | */ |
| 20 | @BasicPreferences |
22 | 21 | class OsmChangeBuilderTest { |
23 | | |
24 | | /** |
25 | | * Setup rule |
26 | | */ |
27 | | @RegisterExtension |
28 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
29 | | public JOSMTestRules test = new JOSMTestRules(); |
30 | | |
31 | 22 | private static void shouldFail(Runnable r) { |
32 | 23 | try { |
33 | 24 | r.run(); |
-
diff --git a/test/unit/org/openstreetmap/josm/io/OsmChangeReaderTest.java b/test/unit/org/openstreetmap/josm/io/OsmChangeReaderTest.java
index 9430bc78d..7f67bdac9 100644
a
|
b
|
import java.nio.charset.StandardCharsets;
|
9 | 9 | import java.util.Collection; |
10 | 10 | import java.util.Iterator; |
11 | 11 | |
12 | | import org.junit.jupiter.api.extension.RegisterExtension; |
13 | | import org.junit.jupiter.api.Test; |
14 | 12 | import org.openstreetmap.josm.data.coor.LatLon; |
15 | 13 | import org.openstreetmap.josm.data.notes.Note; |
16 | 14 | import org.openstreetmap.josm.data.osm.DataSet; |
17 | 15 | import org.openstreetmap.josm.data.osm.NoteData; |
18 | 16 | import org.openstreetmap.josm.gui.progress.NullProgressMonitor; |
19 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 17 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
20 | 18 | import org.openstreetmap.josm.tools.Pair; |
21 | 19 | |
22 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 20 | import org.junit.jupiter.api.Test; |
23 | 21 | |
24 | 22 | /** |
25 | 23 | * Unit tests of {@link OsmChangeReader}. |
26 | 24 | */ |
| 25 | @BasicPreferences |
27 | 26 | class OsmChangeReaderTest { |
28 | | |
29 | | /** |
30 | | * Setup rule |
31 | | */ |
32 | | @RegisterExtension |
33 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
34 | | public JOSMTestRules test = new JOSMTestRules(); |
35 | | |
36 | 27 | /** |
37 | 28 | * Parse osmChange. |
38 | 29 | * @param osm OSM data in osmChange format, without header/footer |
-
diff --git a/test/unit/org/openstreetmap/josm/io/OsmChangesetContentParserTest.java b/test/unit/org/openstreetmap/josm/io/OsmChangesetContentParserTest.java
index 8cc4da587..053d21bbf 100644
a
|
b
|
import java.io.InputStream;
|
11 | 11 | import java.nio.charset.StandardCharsets; |
12 | 12 | import java.util.Arrays; |
13 | 13 | |
14 | | import org.junit.jupiter.api.extension.RegisterExtension; |
15 | | import org.junit.jupiter.api.Test; |
16 | 14 | import org.openstreetmap.josm.data.osm.ChangesetDataSet; |
17 | 15 | import org.openstreetmap.josm.data.osm.ChangesetDataSet.ChangesetModificationType; |
18 | 16 | import org.openstreetmap.josm.data.osm.OsmPrimitiveType; |
… |
… |
import org.openstreetmap.josm.data.osm.history.HistoryOsmPrimitive;
|
21 | 19 | import org.openstreetmap.josm.data.osm.history.HistoryRelation; |
22 | 20 | import org.openstreetmap.josm.data.osm.history.HistoryWay; |
23 | 21 | import org.openstreetmap.josm.gui.progress.NullProgressMonitor; |
24 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 22 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
25 | 23 | import org.openstreetmap.josm.tools.Logging; |
26 | 24 | import org.openstreetmap.josm.tools.XmlParsingException; |
27 | 25 | |
28 | 26 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 27 | import org.junit.jupiter.api.Test; |
29 | 28 | |
30 | 29 | /** |
31 | 30 | * Unit tests of {@link OsmChangesetContentParser}. |
32 | 31 | */ |
| 32 | @BasicPreferences |
33 | 33 | class OsmChangesetContentParserTest { |
34 | | |
35 | | /** |
36 | | * Setup rule |
37 | | */ |
38 | | @RegisterExtension |
39 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
40 | | public JOSMTestRules test = new JOSMTestRules(); |
41 | | |
42 | 34 | private static void shouldFail(Runnable r) { |
43 | 35 | try { |
44 | 36 | r.run(); |
-
diff --git a/test/unit/org/openstreetmap/josm/io/OsmChangesetParserTest.java b/test/unit/org/openstreetmap/josm/io/OsmChangesetParserTest.java
index 35e95d005..360eb5b60 100644
a
|
b
|
import java.io.ByteArrayInputStream;
|
8 | 8 | import java.nio.charset.StandardCharsets; |
9 | 9 | import java.util.List; |
10 | 10 | |
11 | | import org.junit.jupiter.api.extension.RegisterExtension; |
12 | 11 | import org.junit.jupiter.api.Test; |
13 | 12 | import org.openstreetmap.josm.data.osm.Changeset; |
14 | 13 | import org.openstreetmap.josm.gui.progress.NullProgressMonitor; |
15 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
16 | | |
17 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 14 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
18 | 15 | |
19 | 16 | /** |
20 | 17 | * Unit tests of {@link OsmChangesetParser} class. |
21 | 18 | */ |
| 19 | @BasicPreferences |
22 | 20 | class OsmChangesetParserTest { |
23 | 21 | |
24 | 22 | private static final String BEGIN = |
… |
… |
class OsmChangesetParserTest {
|
54 | 52 | "</changeset>" + |
55 | 53 | "</osm>"; |
56 | 54 | |
57 | | /** |
58 | | * Setup test. |
59 | | */ |
60 | | @RegisterExtension |
61 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
62 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
63 | | |
64 | 55 | private static List<Changeset> parse(String cs) throws IllegalDataException { |
65 | 56 | return OsmChangesetParser.parse(new ByteArrayInputStream(cs.getBytes(StandardCharsets.UTF_8)), NullProgressMonitor.INSTANCE); |
66 | 57 | } |
-
diff --git a/test/unit/org/openstreetmap/josm/io/OsmJsonReaderTest.java b/test/unit/org/openstreetmap/josm/io/OsmJsonReaderTest.java
index 4ee432546..fe84f0a2c 100644
a
|
b
|
import java.nio.charset.StandardCharsets;
|
11 | 11 | import java.time.Instant; |
12 | 12 | import java.util.Iterator; |
13 | 13 | |
14 | | import org.junit.jupiter.api.Test; |
15 | | import org.junit.jupiter.api.extension.RegisterExtension; |
16 | 14 | import org.openstreetmap.josm.data.coor.LatLon; |
17 | 15 | import org.openstreetmap.josm.data.osm.DataSet; |
18 | 16 | import org.openstreetmap.josm.data.osm.Node; |
… |
… |
import org.openstreetmap.josm.data.osm.Relation;
|
20 | 18 | import org.openstreetmap.josm.data.osm.RelationMember; |
21 | 19 | import org.openstreetmap.josm.data.osm.Way; |
22 | 20 | import org.openstreetmap.josm.gui.progress.NullProgressMonitor; |
23 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 21 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
24 | 22 | |
25 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 23 | import org.junit.jupiter.api.Test; |
26 | 24 | |
27 | 25 | /** |
28 | 26 | * Unit tests of {@link OsmReader} class. |
29 | 27 | */ |
| 28 | @BasicPreferences |
30 | 29 | class OsmJsonReaderTest { |
31 | | |
32 | | /** |
33 | | * Setup rule |
34 | | */ |
35 | | @RegisterExtension |
36 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
37 | | public JOSMTestRules test = new JOSMTestRules(); |
38 | | |
39 | 30 | /** |
40 | 31 | * Parse JSON. |
41 | 32 | * @param osm OSM data in JSON format, without header/footer |
-
diff --git a/test/unit/org/openstreetmap/josm/io/OsmReaderTest.java b/test/unit/org/openstreetmap/josm/io/OsmReaderTest.java
index 2be8c2217..5c52e2708 100644
a
|
b
|
import java.nio.file.Files;
|
17 | 17 | import java.nio.file.Paths; |
18 | 18 | import java.util.Arrays; |
19 | 19 | |
20 | | import org.junit.jupiter.api.extension.RegisterExtension; |
21 | | import org.junit.jupiter.api.Test; |
22 | 20 | import org.openstreetmap.josm.TestUtils; |
23 | 21 | import org.openstreetmap.josm.data.osm.DataSet; |
24 | 22 | import org.openstreetmap.josm.data.osm.Node; |
… |
… |
import org.openstreetmap.josm.data.osm.Way;
|
26 | 24 | import org.openstreetmap.josm.gui.progress.NullProgressMonitor; |
27 | 25 | import org.openstreetmap.josm.gui.progress.ProgressMonitor; |
28 | 26 | import org.openstreetmap.josm.io.OsmReader.Options; |
29 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 27 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
30 | 28 | |
31 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 29 | import org.junit.jupiter.api.Test; |
32 | 30 | |
33 | 31 | /** |
34 | 32 | * Unit tests of {@link OsmReader} class. |
35 | 33 | */ |
| 34 | @BasicPreferences |
36 | 35 | class OsmReaderTest { |
37 | | |
38 | | /** |
39 | | * Setup rule |
40 | | */ |
41 | | @RegisterExtension |
42 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
43 | | public JOSMTestRules test = new JOSMTestRules(); |
44 | | |
45 | 36 | private static Options[][] options() { |
46 | 37 | return new Options[][]{ |
47 | 38 | new Options[]{}, |
-
diff --git a/test/unit/org/openstreetmap/josm/io/OsmWriterTest.java b/test/unit/org/openstreetmap/josm/io/OsmWriterTest.java
index 3394722a1..6aeacad27 100644
a
|
b
|
import java.util.Arrays;
|
16 | 16 | import java.util.Collections; |
17 | 17 | import java.util.List; |
18 | 18 | |
19 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
20 | | import org.junit.jupiter.api.Test; |
21 | | import org.junit.jupiter.api.extension.RegisterExtension; |
22 | 19 | import org.openstreetmap.josm.data.coor.LatLon; |
23 | 20 | import org.openstreetmap.josm.data.osm.Changeset; |
24 | 21 | import org.openstreetmap.josm.data.osm.DataSet; |
… |
… |
import org.openstreetmap.josm.data.osm.Node;
|
28 | 25 | import org.openstreetmap.josm.data.osm.NodeData; |
29 | 26 | import org.openstreetmap.josm.data.osm.UploadPolicy; |
30 | 27 | import org.openstreetmap.josm.data.osm.User; |
31 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 28 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
| 29 | |
| 30 | import org.junit.jupiter.api.Test; |
32 | 31 | |
33 | 32 | /** |
34 | 33 | * Unit tests of {@link OsmWriter} class. |
35 | 34 | */ |
| 35 | @BasicPreferences |
36 | 36 | class OsmWriterTest { |
37 | | |
38 | | /** |
39 | | * Setup rule |
40 | | */ |
41 | | @RegisterExtension |
42 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
43 | | public JOSMTestRules test = new JOSMTestRules(); |
44 | | |
45 | 37 | /** |
46 | 38 | * Unit test of {@link OsmWriter#byIdComparator}. |
47 | 39 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/io/ParseWithChangesetReaderTest.java b/test/unit/org/openstreetmap/josm/io/ParseWithChangesetReaderTest.java
index 79080dca8..7d2f88671 100644
a
|
b
|
import java.io.IOException;
|
10 | 10 | import java.io.InputStream; |
11 | 11 | import java.nio.charset.StandardCharsets; |
12 | 12 | |
13 | | import org.junit.jupiter.api.extension.RegisterExtension; |
14 | | import org.junit.jupiter.api.Test; |
15 | 13 | import org.openstreetmap.josm.data.osm.DataSet; |
16 | 14 | import org.openstreetmap.josm.data.osm.Node; |
17 | 15 | import org.openstreetmap.josm.data.osm.OsmPrimitive; |
18 | 16 | import org.openstreetmap.josm.data.osm.OsmPrimitiveType; |
19 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 17 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
20 | 18 | import org.openstreetmap.josm.tools.Logging; |
21 | 19 | |
22 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 20 | import org.junit.jupiter.api.Test; |
23 | 21 | |
24 | 22 | /** |
25 | 23 | * Additional unit tests for {@link OsmReader}. |
26 | 24 | */ |
| 25 | @BasicPreferences |
27 | 26 | class ParseWithChangesetReaderTest { |
28 | | |
29 | | /** |
30 | | * Setup rule |
31 | | */ |
32 | | @RegisterExtension |
33 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
34 | | public JOSMTestRules test = new JOSMTestRules(); |
35 | | |
36 | 27 | private static DataSet getDataSet(String doc) throws IOException, IllegalDataException { |
37 | 28 | try (InputStream is = new ByteArrayInputStream(doc.getBytes(StandardCharsets.UTF_8))) { |
38 | 29 | return OsmReader.parseDataSet(is, null); |
-
diff --git a/test/unit/org/openstreetmap/josm/io/auth/CredentialsAgentExceptionTest.java b/test/unit/org/openstreetmap/josm/io/auth/CredentialsAgentExceptionTest.java
index 4f30e019b..c97176a91 100644
a
|
b
|
package org.openstreetmap.josm.io.auth;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertEquals; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | 6 | import org.junit.jupiter.api.Test; |
8 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
9 | | |
10 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
11 | 7 | |
12 | 8 | /** |
13 | 9 | * Unit tests of {@link CredentialsAgentException} class. |
14 | 10 | */ |
15 | 11 | class CredentialsAgentExceptionTest { |
16 | | |
17 | | /** |
18 | | * Setup test |
19 | | */ |
20 | | @RegisterExtension |
21 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
22 | | public JOSMTestRules test = new JOSMTestRules(); |
23 | | |
24 | 12 | /** |
25 | 13 | * Unit test of {@code CredentialsAgentException#CredentialsAgentException} |
26 | 14 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/io/remotecontrol/AddTagsDialogTest.java b/test/unit/org/openstreetmap/josm/io/remotecontrol/AddTagsDialogTest.java
index 2a0d76fe2..eada4d281 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
5 | 5 | |
6 | 6 | import java.util.Map; |
7 | 7 | |
8 | | import org.junit.jupiter.api.extension.RegisterExtension; |
9 | 8 | import org.junit.jupiter.api.Test; |
10 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
11 | | |
12 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 9 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
13 | 10 | |
14 | 11 | /** |
15 | 12 | * Unit tests for class {@link AddTagsDialog}. |
16 | 13 | */ |
| 14 | @BasicPreferences |
17 | 15 | class AddTagsDialogTest { |
18 | | /** |
19 | | * Setup test. |
20 | | */ |
21 | | @RegisterExtension |
22 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
23 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
24 | | |
25 | 16 | /** |
26 | 17 | * Unit test of {@link AddTagsDialog#parseUrlTagsToKeyValues} |
27 | 18 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/AddWayHandlerTest.java b/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/AddWayHandlerTest.java
index 23fbc0d63..3175efbb6 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
|
5 | 5 | import static org.junit.jupiter.api.Assertions.assertEquals; |
6 | 6 | import static org.junit.jupiter.api.Assertions.assertThrows; |
7 | 7 | |
8 | | import org.junit.jupiter.api.extension.RegisterExtension; |
9 | | import org.junit.jupiter.api.Test; |
10 | 8 | import org.openstreetmap.josm.data.osm.DataSet; |
11 | 9 | import org.openstreetmap.josm.gui.MainApplication; |
12 | 10 | import org.openstreetmap.josm.gui.layer.OsmDataLayer; |
13 | 11 | import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException; |
14 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 12 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
15 | 13 | |
16 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 14 | import org.junit.jupiter.api.Test; |
17 | 15 | |
18 | 16 | /** |
19 | 17 | * Unit tests of {@link AddWayHandler} class. |
20 | 18 | */ |
| 19 | @BasicPreferences |
21 | 20 | class AddWayHandlerTest { |
22 | | /** |
23 | | * Setup test. |
24 | | */ |
25 | | @RegisterExtension |
26 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
27 | | public JOSMTestRules test = new JOSMTestRules(); |
28 | | |
29 | 21 | private static AddWayHandler newHandler(String url) throws RequestHandlerBadRequestException { |
30 | 22 | AddWayHandler req = new AddWayHandler(); |
31 | 23 | if (url != null) |
-
diff --git a/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandlerTest.java b/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandlerTest.java
index 3d13b0940..8b34f2130 100644
a
|
b
|
package org.openstreetmap.josm.io.remotecontrol.handler;
|
3 | 3 | |
4 | 4 | import static org.hamcrest.CoreMatchers.hasItem; |
5 | 5 | import static org.hamcrest.MatcherAssert.assertThat; |
6 | | import static org.junit.jupiter.api.Assertions.assertEquals; |
7 | 6 | import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; |
| 7 | import static org.junit.jupiter.api.Assertions.assertEquals; |
8 | 8 | import static org.junit.jupiter.api.Assertions.assertThrows; |
9 | 9 | |
10 | 10 | import java.util.Arrays; |
11 | 11 | import java.util.List; |
12 | 12 | |
13 | | import org.junit.jupiter.api.extension.RegisterExtension; |
14 | | import org.junit.jupiter.api.Test; |
15 | 13 | import org.openstreetmap.josm.data.imagery.ImageryInfo; |
16 | 14 | import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException; |
17 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 15 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
18 | 16 | |
19 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 17 | import org.junit.jupiter.api.Test; |
20 | 18 | |
21 | 19 | /** |
22 | 20 | * Unit tests of {@link ImageryHandler} class. |
23 | 21 | */ |
| 22 | @BasicPreferences |
24 | 23 | class ImageryHandlerTest { |
25 | | /** |
26 | | * Setup test. |
27 | | */ |
28 | | @RegisterExtension |
29 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
30 | | public JOSMTestRules test = new JOSMTestRules(); |
31 | | |
32 | 24 | private static ImageryHandler newHandler(String url) throws RequestHandlerBadRequestException { |
33 | 25 | ImageryHandler req = new ImageryHandler(); |
34 | 26 | if (url != null) |
-
diff --git a/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandlerTest.java b/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandlerTest.java
index ed31a8ba6..aa5a98772 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
|
5 | 5 | import static org.junit.jupiter.api.Assertions.assertEquals; |
6 | 6 | import static org.junit.jupiter.api.Assertions.assertThrows; |
7 | 7 | |
8 | | import org.junit.jupiter.api.extension.RegisterExtension; |
9 | | import org.junit.jupiter.api.Test; |
10 | 8 | import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException; |
11 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 9 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
12 | 10 | |
13 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 11 | import org.junit.jupiter.api.Test; |
14 | 12 | |
15 | 13 | /** |
16 | 14 | * Unit tests of {@link LoadAndZoomHandler} class. |
17 | 15 | */ |
18 | 16 | class LoadAndZoomHandlerTest { |
19 | | /** |
20 | | * Setup test. |
21 | | */ |
22 | | @RegisterExtension |
23 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
24 | | public JOSMTestRules test = new JOSMTestRules(); |
25 | | |
26 | 17 | private static LoadAndZoomHandler newHandler(String url) throws RequestHandlerBadRequestException { |
27 | 18 | LoadAndZoomHandler req = new LoadAndZoomHandler(); |
28 | 19 | if (url != null) |
… |
… |
class LoadAndZoomHandlerTest {
|
65 | 56 | * @throws Exception if any error occurs |
66 | 57 | */ |
67 | 58 | @Test |
| 59 | @BasicPreferences |
68 | 60 | void testNominalRequest() throws Exception { |
69 | 61 | assertDoesNotThrow(() -> newHandler("https://localhost?bottom=0&top=0&left=1&right=1").handle()); |
70 | 62 | } |
-
diff --git a/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/LoadObjectHandlerTest.java b/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/LoadObjectHandlerTest.java
index 9bd6dd06d..1beeeaaca 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
|
8 | 8 | import static org.junit.jupiter.api.Assertions.assertEquals; |
9 | 9 | import static org.junit.jupiter.api.Assertions.assertThrows; |
10 | 10 | |
11 | | import org.junit.jupiter.api.Test; |
12 | | import org.junit.jupiter.api.extension.RegisterExtension; |
13 | 11 | import org.openstreetmap.josm.TestUtils; |
14 | 12 | import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException; |
15 | 13 | import org.openstreetmap.josm.spi.preferences.Config; |
16 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 14 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
17 | 15 | |
18 | 16 | import com.github.tomakehurst.wiremock.WireMockServer; |
19 | | |
20 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 17 | import org.junit.jupiter.api.Test; |
21 | 18 | |
22 | 19 | /** |
23 | 20 | * Unit tests of {@link LoadObjectHandler} class. |
24 | 21 | */ |
25 | 22 | class LoadObjectHandlerTest { |
26 | | /** |
27 | | * Setup test. |
28 | | */ |
29 | | @RegisterExtension |
30 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
31 | | public JOSMTestRules test = new JOSMTestRules(); |
32 | | |
33 | 23 | private static LoadObjectHandler newHandler(String url) throws RequestHandlerBadRequestException { |
34 | 24 | LoadObjectHandler req = new LoadObjectHandler(); |
35 | 25 | if (url != null) |
… |
… |
class LoadObjectHandlerTest {
|
68 | 58 | * Unit test for nominal request - local data file. |
69 | 59 | */ |
70 | 60 | @Test |
| 61 | @BasicPreferences |
71 | 62 | void testNominalRequest() { |
72 | 63 | WireMockServer wiremock = TestUtils.getWireMockServer(); |
73 | 64 | wiremock.addStubMapping(get(urlEqualTo("/capabilities")).willReturn(aResponse().withStatusMessage("OK") |
-
diff --git a/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandlerTest.java b/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandlerTest.java
index 798fb5458..b61c974d2 100644
a
|
b
|
import java.util.Collections;
|
8 | 8 | import java.util.HashMap; |
9 | 9 | import java.util.Map; |
10 | 10 | |
11 | | import org.junit.jupiter.api.Test; |
12 | | import org.junit.jupiter.api.extension.RegisterExtension; |
13 | 11 | import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault; |
14 | 12 | import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException; |
15 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
16 | 13 | |
17 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 14 | import org.junit.jupiter.api.Test; |
18 | 15 | |
19 | 16 | /** |
20 | 17 | * Unit tests of {@link RequestHandler} class. |
21 | 18 | */ |
22 | 19 | class RequestHandlerTest { |
23 | | |
24 | | /** |
25 | | * Setup test. |
26 | | */ |
27 | | @RegisterExtension |
28 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
29 | | public JOSMTestRules test = new JOSMTestRules(); |
30 | | |
31 | 20 | Map<String, String> getRequestParameter(String url) throws RequestHandlerBadRequestException { |
32 | 21 | final RequestHandler req = new RequestHandler() { |
33 | 22 | @Override |
-
diff --git a/test/unit/org/openstreetmap/josm/plugins/PluginDownloadExceptionTest.java b/test/unit/org/openstreetmap/josm/plugins/PluginDownloadExceptionTest.java
index 31e9f74ef..1077bd919 100644
a
|
b
|
package org.openstreetmap.josm.plugins;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertEquals; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | 6 | import org.junit.jupiter.api.Test; |
8 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
9 | | |
10 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
11 | 7 | |
12 | 8 | /** |
13 | 9 | * Unit tests of {@link PluginDownloadException} class. |
14 | 10 | */ |
15 | 11 | class PluginDownloadExceptionTest { |
16 | | |
17 | | /** |
18 | | * Setup test. |
19 | | */ |
20 | | @RegisterExtension |
21 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
22 | | public JOSMTestRules test = new JOSMTestRules(); |
23 | | |
24 | 12 | /** |
25 | 13 | * Unit test of {@link PluginDownloadException#PluginDownloadException}. |
26 | 14 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/plugins/PluginExceptionTest.java b/test/unit/org/openstreetmap/josm/plugins/PluginExceptionTest.java
index ee401b377..586215cd1 100644
a
|
b
|
package org.openstreetmap.josm.plugins;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertEquals; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | 6 | import org.junit.jupiter.api.Test; |
8 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
9 | | |
10 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
11 | 7 | |
12 | 8 | /** |
13 | 9 | * Unit tests of {@link PluginException} class. |
14 | 10 | */ |
15 | 11 | class PluginExceptionTest { |
16 | | |
17 | | /** |
18 | | * Setup test. |
19 | | */ |
20 | | @RegisterExtension |
21 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
22 | | public JOSMTestRules test = new JOSMTestRules(); |
23 | | |
24 | 12 | /** |
25 | 13 | * Unit test of {@link PluginException#PluginException}. |
26 | 14 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTest.java b/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTest.java
index 3af77231d..aeefa9180 100644
a
|
b
|
import java.util.stream.Stream;
|
16 | 16 | import javax.swing.JOptionPane; |
17 | 17 | import javax.swing.JScrollPane; |
18 | 18 | |
19 | | import org.junit.jupiter.api.extension.RegisterExtension; |
20 | | import org.junit.jupiter.api.Test; |
21 | 19 | import org.openstreetmap.josm.TestUtils; |
22 | 20 | import org.openstreetmap.josm.gui.MainApplication; |
23 | 21 | import org.openstreetmap.josm.gui.preferences.plugin.PluginPreferenceTest; |
24 | 22 | import org.openstreetmap.josm.gui.widgets.JosmTextArea; |
25 | 23 | import org.openstreetmap.josm.plugins.PluginHandler.DeprecatedPlugin; |
26 | 24 | import org.openstreetmap.josm.plugins.PluginHandler.PluginInformationAction; |
27 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 25 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
28 | 26 | import org.openstreetmap.josm.testutils.mockers.HelpAwareOptionPaneMocker; |
29 | 27 | import org.openstreetmap.josm.testutils.mockers.JOptionPaneSimpleMocker; |
30 | 28 | |
31 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
32 | 29 | import nl.jqno.equalsverifier.EqualsVerifier; |
| 30 | import org.junit.jupiter.api.Test; |
33 | 31 | |
34 | 32 | /** |
35 | 33 | * Unit tests of {@link PluginHandler} class. |
36 | 34 | */ |
| 35 | @BasicPreferences |
37 | 36 | class PluginHandlerTest { |
38 | | |
39 | | /** |
40 | | * Setup test. |
41 | | */ |
42 | | @RegisterExtension |
43 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
44 | | public JOSMTestRules test = new JOSMTestRules(); |
45 | | |
46 | 37 | /** |
47 | 38 | * Unit test of methods {@link DeprecatedPlugin#equals} and {@link DeprecatedPlugin#hashCode}. |
48 | 39 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/plugins/PluginListParseExceptionTest.java b/test/unit/org/openstreetmap/josm/plugins/PluginListParseExceptionTest.java
index f462626e0..dfa02a960 100644
a
|
b
|
package org.openstreetmap.josm.plugins;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertEquals; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | 6 | import org.junit.jupiter.api.Test; |
8 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
9 | | |
10 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
11 | 7 | |
12 | 8 | /** |
13 | 9 | * Unit tests of {@link PluginListParseException} class. |
14 | 10 | */ |
15 | 11 | class PluginListParseExceptionTest { |
16 | | |
17 | | /** |
18 | | * Setup test. |
19 | | */ |
20 | | @RegisterExtension |
21 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
22 | | public JOSMTestRules test = new JOSMTestRules(); |
23 | | |
24 | 12 | /** |
25 | 13 | * Unit test of {@link PluginListParseException#PluginListParseException}. |
26 | 14 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/spi/preferences/ListListSettingTest.java b/test/unit/org/openstreetmap/josm/spi/preferences/ListListSettingTest.java
index 4932f6086..9c962033b 100644
a
|
b
|
|
1 | 1 | // License: GPL. For details, see LICENSE file. |
2 | 2 | package org.openstreetmap.josm.spi.preferences; |
3 | 3 | |
4 | | import org.junit.jupiter.api.extension.RegisterExtension; |
5 | 4 | import org.junit.jupiter.api.Test; |
6 | 5 | import org.openstreetmap.josm.TestUtils; |
7 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 6 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
8 | 7 | |
9 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
10 | 8 | import nl.jqno.equalsverifier.EqualsVerifier; |
11 | 9 | |
12 | 10 | /** |
13 | 11 | * Test {@link ListListSetting}. |
14 | 12 | */ |
| 13 | // This is a preference test |
| 14 | @BasicPreferences |
15 | 15 | class ListListSettingTest { |
16 | | /** |
17 | | * This is a preference test |
18 | | */ |
19 | | @RegisterExtension |
20 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
21 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
22 | | |
23 | 16 | /** |
24 | 17 | * Unit test of methods {@link ListListSetting#equals} and {@link ListListSetting#hashCode}. |
25 | 18 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/spi/preferences/ListSettingTest.java b/test/unit/org/openstreetmap/josm/spi/preferences/ListSettingTest.java
index f3f831116..3bb276ee4 100644
a
|
b
|
|
1 | 1 | // License: GPL. For details, see LICENSE file. |
2 | 2 | package org.openstreetmap.josm.spi.preferences; |
3 | 3 | |
4 | | import org.junit.jupiter.api.extension.RegisterExtension; |
5 | 4 | import org.junit.jupiter.api.Test; |
6 | 5 | import org.openstreetmap.josm.TestUtils; |
7 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 6 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
8 | 7 | |
9 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
10 | 8 | import nl.jqno.equalsverifier.EqualsVerifier; |
11 | 9 | |
12 | 10 | /** |
13 | 11 | * Test {@link ListSetting}. |
14 | 12 | */ |
| 13 | // This is a preference test |
| 14 | @BasicPreferences |
15 | 15 | class ListSettingTest { |
16 | | /** |
17 | | * This is a preference test |
18 | | */ |
19 | | @RegisterExtension |
20 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
21 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
22 | | |
23 | 16 | /** |
24 | 17 | * Unit test of methods {@link ListSetting#equals} and {@link ListSetting#hashCode}. |
25 | 18 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/spi/preferences/MapListSettingTest.java b/test/unit/org/openstreetmap/josm/spi/preferences/MapListSettingTest.java
index 9e1d6ce0f..1949b84b8 100644
a
|
b
|
|
1 | 1 | // License: GPL. For details, see LICENSE file. |
2 | 2 | package org.openstreetmap.josm.spi.preferences; |
3 | 3 | |
4 | | import org.junit.jupiter.api.extension.RegisterExtension; |
5 | 4 | import org.junit.jupiter.api.Test; |
6 | 5 | import org.openstreetmap.josm.TestUtils; |
7 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 6 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
8 | 7 | |
9 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
10 | 8 | import nl.jqno.equalsverifier.EqualsVerifier; |
11 | 9 | |
12 | 10 | /** |
13 | 11 | * Test {@link MapListSetting}. |
14 | 12 | */ |
| 13 | // This is a preference test |
| 14 | @BasicPreferences |
15 | 15 | class MapListSettingTest { |
16 | | /** |
17 | | * This is a preference test |
18 | | */ |
19 | | @RegisterExtension |
20 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
21 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
22 | | |
23 | 16 | /** |
24 | 17 | * Unit test of methods {@link MapListSetting#equals} and {@link MapListSetting#hashCode}. |
25 | 18 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/spi/preferences/StringSettingTest.java b/test/unit/org/openstreetmap/josm/spi/preferences/StringSettingTest.java
index a4a6f6af4..92fce1ea8 100644
a
|
b
|
|
1 | 1 | // License: GPL. For details, see LICENSE file. |
2 | 2 | package org.openstreetmap.josm.spi.preferences; |
3 | 3 | |
4 | | import org.junit.jupiter.api.extension.RegisterExtension; |
5 | 4 | import org.junit.jupiter.api.Test; |
6 | 5 | import org.openstreetmap.josm.TestUtils; |
7 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 6 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
8 | 7 | |
9 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
10 | 8 | import nl.jqno.equalsverifier.EqualsVerifier; |
11 | 9 | |
12 | 10 | /** |
13 | 11 | * Test {@link StringSetting}. |
14 | 12 | */ |
| 13 | // This is a preference test |
| 14 | @BasicPreferences |
15 | 15 | class StringSettingTest { |
16 | | /** |
17 | | * This is a preference test |
18 | | */ |
19 | | @RegisterExtension |
20 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
21 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
22 | | |
23 | 16 | /** |
24 | 17 | * Unit test of methods {@link StringSetting#equals} and {@link StringSetting#hashCode}. |
25 | 18 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/testutils/annotations/AnnotationUtils.java b/test/unit/org/openstreetmap/josm/testutils/annotations/AnnotationUtils.java
new file mode 100644
index 000000000..b96e6c2f8
-
|
+
|
|
| 1 | // License: GPL. For details, see LICENSE file. |
| 2 | package org.openstreetmap.josm.testutils.annotations; |
| 3 | |
| 4 | import java.lang.annotation.Annotation; |
| 5 | import java.lang.reflect.AnnotatedElement; |
| 6 | import java.lang.reflect.Field; |
| 7 | import java.lang.reflect.Modifier; |
| 8 | import java.util.Collection; |
| 9 | import java.util.Optional; |
| 10 | |
| 11 | import org.junit.jupiter.api.extension.ExtensionContext; |
| 12 | import org.junit.platform.commons.support.AnnotationSupport; |
| 13 | |
| 14 | /** |
| 15 | * Useful methods for annotation extensions |
| 16 | * @author Taylor Smock |
| 17 | * @since xxx |
| 18 | */ |
| 19 | final class AnnotationUtils { |
| 20 | private AnnotationUtils() { |
| 21 | // Utils class |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * Find the first parent annotation |
| 26 | * @param <T> The annotation to find |
| 27 | * @param context The context to search |
| 28 | * @param annotation The annotation to find |
| 29 | * @return See {@link AnnotationSupport#findAnnotation} |
| 30 | */ |
| 31 | public static <T extends Annotation> Optional<T> findFirstParentAnnotation(ExtensionContext context, Class<T> annotation) { |
| 32 | ExtensionContext current = context; |
| 33 | do { |
| 34 | Optional<T> foundAnnotation = AnnotationSupport.findAnnotation(current.getElement(), annotation); |
| 35 | if (foundAnnotation.isPresent()) { |
| 36 | return foundAnnotation; |
| 37 | } |
| 38 | current = current.getParent().orElse(null); |
| 39 | } while (current != null); |
| 40 | return Optional.empty(); |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Reset a static class (all static fields are unset). If they are initialized as part of a static block, please be aware of NPEs. |
| 45 | * @param clazz The class to reset |
| 46 | * @throws ReflectiveOperationException If reflection doesn't work, for whatever reason. |
| 47 | */ |
| 48 | public static void resetStaticClass(Class<?> clazz) throws ReflectiveOperationException { |
| 49 | for (Field field : clazz.getDeclaredFields()) { |
| 50 | if (!field.isAccessible()) { |
| 51 | field.setAccessible(true); |
| 52 | } |
| 53 | // Don't reset fields that are not static |
| 54 | if ((field.getModifiers() & Modifier.STATIC) == 0) { |
| 55 | continue; |
| 56 | } |
| 57 | final boolean isFinal = (field.getModifiers() & Modifier.FINAL) != 0; |
| 58 | if (field.get(null) instanceof Collection && isFinal) { |
| 59 | // Clear all collections (assume they start empty) |
| 60 | try { |
| 61 | ((Collection<?>) field.get(null)).clear(); |
| 62 | } catch (UnsupportedOperationException e) { |
| 63 | // Probably an unmodifiable collection |
| 64 | } |
| 65 | } else if (!isFinal) { |
| 66 | // Only reset static fields, but not final static fields |
| 67 | field.set(null, null); |
| 68 | } |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * Check if the element is annotated with the |
| 74 | * @param annotatedElement The annotated element wrapped in an optional. |
| 75 | * @param annotationClass The annotation class |
| 76 | * @param <T> Annotation class type |
| 77 | * @return {@code true} if the element is present and is annotated with the specified class |
| 78 | */ |
| 79 | public static <T extends Annotation> boolean elementIsAnnotated(Optional<AnnotatedElement> annotatedElement, Class<T> annotationClass) { |
| 80 | return annotatedElement.isPresent() && annotatedElement.get().isAnnotationPresent(annotationClass); |
| 81 | } |
| 82 | } |
-
diff --git a/test/unit/org/openstreetmap/josm/testutils/annotations/BasicPreferences.java b/test/unit/org/openstreetmap/josm/testutils/annotations/BasicPreferences.java
new file mode 100644
index 000000000..3753a3634
-
|
+
|
|
| 1 | // License: GPL. For details, see LICENSE file. |
| 2 | package org.openstreetmap.josm.testutils.annotations; |
| 3 | |
| 4 | import java.lang.annotation.Documented; |
| 5 | import java.lang.annotation.ElementType; |
| 6 | import java.lang.annotation.Retention; |
| 7 | import java.lang.annotation.RetentionPolicy; |
| 8 | import java.lang.annotation.Target; |
| 9 | |
| 10 | import org.openstreetmap.josm.data.Preferences; |
| 11 | import org.openstreetmap.josm.data.preferences.JosmBaseDirectories; |
| 12 | import org.openstreetmap.josm.data.preferences.JosmUrls; |
| 13 | import org.openstreetmap.josm.spi.preferences.Config; |
| 14 | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 15 | |
| 16 | import org.junit.jupiter.api.extension.AfterAllCallback; |
| 17 | import org.junit.jupiter.api.extension.AfterEachCallback; |
| 18 | import org.junit.jupiter.api.extension.BeforeAllCallback; |
| 19 | import org.junit.jupiter.api.extension.BeforeEachCallback; |
| 20 | import org.junit.jupiter.api.extension.ExtendWith; |
| 21 | import org.junit.jupiter.api.extension.ExtensionContext; |
| 22 | import org.junit.jupiter.api.extension.ExtensionContext.Namespace; |
| 23 | |
| 24 | /** |
| 25 | * Allow tests to use JOSM preferences (see {@link JOSMTestRules#preferences()}). |
| 26 | * This is often enough for basic tests. |
| 27 | * |
| 28 | * @author Taylor Smock |
| 29 | * @see FullPreferences |
| 30 | * @since xxx |
| 31 | */ |
| 32 | @Documented |
| 33 | @Retention(RetentionPolicy.RUNTIME) |
| 34 | @Target({ElementType.TYPE, ElementType.METHOD}) |
| 35 | @ExtendWith(BasicPreferences.BasicPreferencesExtension.class) |
| 36 | public @interface BasicPreferences { |
| 37 | |
| 38 | /** |
| 39 | * Initialize basic preferences. This is often more than enough for basic tests. |
| 40 | * @author Taylor Smock |
| 41 | */ |
| 42 | class BasicPreferencesExtension implements AfterAllCallback, AfterEachCallback, BeforeAllCallback, BeforeEachCallback { |
| 43 | @Override |
| 44 | public void afterAll(ExtensionContext context) throws Exception { |
| 45 | AnnotationUtils.resetStaticClass(Config.class); |
| 46 | } |
| 47 | |
| 48 | @Override |
| 49 | public void afterEach(ExtensionContext context) throws Exception { |
| 50 | if (context.getElement().isPresent() && context.getElement().get().isAnnotationPresent(BasicPreferences.class)) { |
| 51 | this.afterAll(context); |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | @Override |
| 56 | public void beforeAll(ExtensionContext context) throws Exception { |
| 57 | Preferences pref = Preferences.main(); |
| 58 | // Disable saving on put, just to avoid overwriting pref files |
| 59 | pref.enableSaveOnPut(false); |
| 60 | Config.setPreferencesInstance(pref); |
| 61 | Config.setBaseDirectoriesProvider(JosmBaseDirectories.getInstance()); |
| 62 | Config.setUrlsProvider(JosmUrls.getInstance()); |
| 63 | // Force an invalid URL just to avoid accidents |
| 64 | Config.getPref().put("osm-server.url", "http://invalid"); |
| 65 | |
| 66 | // Store the pref for other extensions |
| 67 | context.getStore(Namespace.create(BasicPreferencesExtension.class)).put("preferences", pref); |
| 68 | } |
| 69 | |
| 70 | @Override |
| 71 | public void beforeEach(ExtensionContext context) throws Exception { |
| 72 | if (AnnotationUtils.elementIsAnnotated(context.getElement(), BasicPreferences.class) || Config.getPref() == null) { |
| 73 | this.beforeAll(context); |
| 74 | } |
| 75 | } |
| 76 | } |
| 77 | } |
-
diff --git a/test/unit/org/openstreetmap/josm/testutils/annotations/FullPreferences.java b/test/unit/org/openstreetmap/josm/testutils/annotations/FullPreferences.java
new file mode 100644
index 000000000..a692c118b
-
|
+
|
|
| 1 | // License: GPL. For details, see LICENSE file. |
| 2 | package org.openstreetmap.josm.testutils.annotations; |
| 3 | |
| 4 | import java.lang.annotation.Documented; |
| 5 | import java.lang.annotation.ElementType; |
| 6 | import java.lang.annotation.Retention; |
| 7 | import java.lang.annotation.RetentionPolicy; |
| 8 | import java.lang.annotation.Target; |
| 9 | import java.util.Map; |
| 10 | |
| 11 | import org.openstreetmap.josm.TestUtils; |
| 12 | import org.openstreetmap.josm.data.Preferences; |
| 13 | import org.openstreetmap.josm.spi.preferences.Config; |
| 14 | import org.openstreetmap.josm.spi.preferences.Setting; |
| 15 | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 16 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences.BasicPreferencesExtension; |
| 17 | |
| 18 | import org.junit.jupiter.api.extension.BeforeAllCallback; |
| 19 | import org.junit.jupiter.api.extension.BeforeEachCallback; |
| 20 | import org.junit.jupiter.api.extension.ExtendWith; |
| 21 | import org.junit.jupiter.api.extension.ExtensionContext; |
| 22 | import org.junit.jupiter.api.extension.ExtensionContext.Namespace; |
| 23 | |
| 24 | /** |
| 25 | * Allow tests to use JOSM preferences with default values (see {@link JOSMTestRules#preferences()}) |
| 26 | * @author Taylor Smock |
| 27 | * @see BasicPreferences (often enough for simple tests). |
| 28 | * @since xxx |
| 29 | */ |
| 30 | @Documented |
| 31 | @Retention(RetentionPolicy.RUNTIME) |
| 32 | @Target({ElementType.TYPE, ElementType.METHOD}) |
| 33 | @JosmHome |
| 34 | @BasicPreferences |
| 35 | @ExtendWith(FullPreferences.UsePreferencesExtension.class) |
| 36 | public @interface FullPreferences { |
| 37 | /** |
| 38 | * Initialize preferences. |
| 39 | */ |
| 40 | class UsePreferencesExtension implements BeforeAllCallback, BeforeEachCallback { |
| 41 | @Override |
| 42 | public void beforeAll(ExtensionContext context) throws Exception { |
| 43 | Preferences pref = context.getStore(Namespace.create(BasicPreferencesExtension.class)).get("preferences", Preferences.class); |
| 44 | @SuppressWarnings("unchecked") |
| 45 | final Map<String, Setting<?>> defaultsMap = (Map<String, Setting<?>>) TestUtils.getPrivateField(pref, "defaultsMap"); |
| 46 | defaultsMap.clear(); |
| 47 | pref.resetToInitialState(); |
| 48 | pref.enableSaveOnPut(false); |
| 49 | // No pref init -> that would only create the preferences file. |
| 50 | // We force the use of a wrong API server, just in case anyone attempts an upload |
| 51 | Config.getPref().put("osm-server.url", "http://invalid"); |
| 52 | } |
| 53 | |
| 54 | @Override |
| 55 | public void beforeEach(ExtensionContext context) throws Exception { |
| 56 | if (AnnotationUtils.elementIsAnnotated(context.getElement(), FullPreferences.class)) { |
| 57 | this.beforeAll(context); |
| 58 | } |
| 59 | } |
| 60 | } |
| 61 | } |
-
diff --git a/test/unit/org/openstreetmap/josm/tools/CheckParameterUtilTest.java b/test/unit/org/openstreetmap/josm/tools/CheckParameterUtilTest.java
index 66e0ff435..0c274bd70 100644
a
|
b
|
|
1 | 1 | // License: GPL. For details, see LICENSE file. |
2 | 2 | package org.openstreetmap.josm.tools; |
3 | 3 | |
4 | | import org.junit.jupiter.api.extension.RegisterExtension; |
5 | | import org.junit.jupiter.api.Test; |
6 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
7 | | |
8 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
9 | 4 | import net.trajano.commons.testing.UtilityClassTestUtil; |
| 5 | import org.junit.jupiter.api.Test; |
10 | 6 | |
11 | 7 | /** |
12 | 8 | * Unit tests of {@link CheckParameterUtil} class. |
13 | 9 | */ |
14 | 10 | class CheckParameterUtilTest { |
15 | | |
16 | | /** |
17 | | * Setup rule. |
18 | | */ |
19 | | @RegisterExtension |
20 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
21 | | public JOSMTestRules test = new JOSMTestRules(); |
22 | | |
23 | 11 | /** |
24 | 12 | * Tests that {@code CheckParameterUtil} satisfies utility class criteria. |
25 | 13 | * @throws ReflectiveOperationException if an error occurs |
-
diff --git a/test/unit/org/openstreetmap/josm/tools/FontsManagerTest.java b/test/unit/org/openstreetmap/josm/tools/FontsManagerTest.java
index f236899f9..f0a5ce6f3 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.fail;
|
6 | 6 | import java.awt.Font; |
7 | 7 | import java.awt.GraphicsEnvironment; |
8 | 8 | |
9 | | import org.junit.jupiter.api.extension.RegisterExtension; |
10 | | import org.junit.jupiter.api.Test; |
11 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
12 | | |
13 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
14 | 9 | import net.trajano.commons.testing.UtilityClassTestUtil; |
| 10 | import org.junit.jupiter.api.Test; |
15 | 11 | |
16 | 12 | /** |
17 | 13 | * Unit tests of {@link FontsManager} class. |
18 | 14 | */ |
19 | 15 | class FontsManagerTest { |
20 | | |
21 | | /** |
22 | | * Setup test. |
23 | | */ |
24 | | @RegisterExtension |
25 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
26 | | public JOSMTestRules test = new JOSMTestRules(); |
27 | | |
28 | 16 | /** |
29 | 17 | * Test method for {@code FontsManager#initialize} |
30 | 18 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/tools/ImageResizeModeTest.java b/test/unit/org/openstreetmap/josm/tools/ImageResizeModeTest.java
index 204b34527..d67c04033 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
7 | 7 | |
8 | 8 | import java.awt.Dimension; |
9 | 9 | |
10 | | import org.junit.jupiter.api.extension.RegisterExtension; |
11 | 10 | import org.junit.jupiter.api.Test; |
12 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
13 | | |
14 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 11 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
15 | 12 | |
16 | 13 | /** |
17 | 14 | * Unit tests of {@link ImageResizeMode} class. |
18 | 15 | */ |
| 16 | @BasicPreferences |
19 | 17 | class ImageResizeModeTest { |
20 | | |
21 | | /** |
22 | | * Setup test. |
23 | | */ |
24 | | @RegisterExtension |
25 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
26 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
27 | | |
28 | 18 | final Dimension image = new Dimension(64, 48); |
29 | 19 | final Dimension smallImage = new Dimension(14, 10); |
30 | 20 | |
-
diff --git a/test/unit/org/openstreetmap/josm/tools/KeyboardUtilsTest.java b/test/unit/org/openstreetmap/josm/tools/KeyboardUtilsTest.java
index 5ba4a29fd..31dac556d 100644
a
|
b
|
import java.util.Locale;
|
12 | 12 | import java.util.Map; |
13 | 13 | import java.util.Map.Entry; |
14 | 14 | |
15 | | import org.junit.jupiter.api.extension.RegisterExtension; |
16 | 15 | import org.junit.jupiter.api.Test; |
17 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
18 | | |
19 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
20 | 16 | |
21 | 17 | /** |
22 | 18 | * Unit tests of {@link KeyboardUtils} class. |
23 | 19 | */ |
24 | 20 | class KeyboardUtilsTest { |
25 | | /** |
26 | | * Initializes test. |
27 | | */ |
28 | | @RegisterExtension |
29 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
30 | | public JOSMTestRules rules = new JOSMTestRules(); |
31 | | |
32 | 21 | /** |
33 | 22 | * Checks that definition of extended characters is correct |
34 | 23 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/tools/ListenableWeakReferenceTest.java b/test/unit/org/openstreetmap/josm/tools/ListenableWeakReferenceTest.java
index d144ab266..8e8580713 100644
a
|
b
|
import static org.junit.jupiter.api.Assertions.assertNull;
|
7 | 7 | import static org.junit.jupiter.api.Assertions.assertSame; |
8 | 8 | import static org.junit.jupiter.api.Assertions.assertTrue; |
9 | 9 | |
10 | | import org.junit.jupiter.api.extension.RegisterExtension; |
11 | 10 | import org.junit.jupiter.api.Test; |
12 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
13 | | |
14 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
15 | 11 | |
16 | 12 | /** |
17 | 13 | * Tests for {@link ListenableWeakReference} |
… |
… |
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
19 | 15 | * @since 12181 |
20 | 16 | */ |
21 | 17 | class ListenableWeakReferenceTest { |
22 | | /** |
23 | | * Default test rules. |
24 | | */ |
25 | | @RegisterExtension |
26 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
27 | | public JOSMTestRules test = new JOSMTestRules(); |
28 | 18 | private Object object; |
29 | 19 | private boolean called; |
30 | 20 | |
-
diff --git a/test/unit/org/openstreetmap/josm/tools/OptionParserTest.java b/test/unit/org/openstreetmap/josm/tools/OptionParserTest.java
index f027d64df..26101cc67 100644
a
|
b
|
package org.openstreetmap.josm.tools;
|
3 | 3 | |
4 | 4 | import static org.junit.jupiter.api.Assertions.assertEquals; |
5 | 5 | import static org.junit.jupiter.api.Assertions.assertFalse; |
6 | | import static org.junit.jupiter.api.Assertions.assertTrue; |
7 | 6 | import static org.junit.jupiter.api.Assertions.assertThrows; |
| 7 | import static org.junit.jupiter.api.Assertions.assertTrue; |
8 | 8 | |
9 | 9 | import java.util.ArrayList; |
10 | 10 | import java.util.Arrays; |
… |
… |
import java.util.List;
|
12 | 12 | import java.util.concurrent.atomic.AtomicBoolean; |
13 | 13 | import java.util.concurrent.atomic.AtomicReference; |
14 | 14 | |
15 | | import org.junit.jupiter.api.extension.RegisterExtension; |
16 | | import org.junit.jupiter.api.Test; |
17 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| 15 | import org.openstreetmap.josm.testutils.annotations.I18n; |
18 | 16 | import org.openstreetmap.josm.tools.OptionParser.OptionCount; |
19 | 17 | import org.openstreetmap.josm.tools.OptionParser.OptionParseException; |
20 | 18 | |
21 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 19 | import org.junit.jupiter.api.Test; |
22 | 20 | |
23 | 21 | /** |
24 | 22 | * Test for {@link OptionParser} |
25 | 23 | * @author Michael Zangl |
26 | 24 | */ |
| 25 | @I18n |
27 | 26 | class OptionParserTest { |
28 | | /** |
29 | | * Setup test. |
30 | | */ |
31 | | @RegisterExtension |
32 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
33 | | public JOSMTestRules test = new JOSMTestRules().i18n(); |
34 | | |
35 | 27 | // A reason for moving to jupiter... |
36 | 28 | @Test |
37 | 29 | void testEmptyParserRejectsLongopt() { |
-
diff --git a/test/unit/org/openstreetmap/josm/tools/OsmUrlToBoundsTest.java b/test/unit/org/openstreetmap/josm/tools/OsmUrlToBoundsTest.java
index b10f15c5f..d5814771a 100644
a
|
b
|
|
1 | 1 | // License: GPL. For details, see LICENSE file. |
2 | 2 | package org.openstreetmap.josm.tools; |
3 | 3 | |
4 | | import org.junit.Assert; |
5 | | import org.junit.jupiter.api.extension.RegisterExtension; |
6 | | import org.junit.jupiter.api.Test; |
7 | 4 | import org.openstreetmap.josm.data.Bounds; |
8 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
9 | 5 | |
10 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 6 | import org.junit.Assert; |
| 7 | import org.junit.jupiter.api.Test; |
11 | 8 | |
12 | 9 | /** |
13 | 10 | * Unit tests of {@link OsmUrlToBounds} class. |
14 | 11 | */ |
15 | 12 | class OsmUrlToBoundsTest { |
16 | | |
17 | | /** |
18 | | * Setup test. |
19 | | */ |
20 | | @RegisterExtension |
21 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
22 | | public JOSMTestRules test = new JOSMTestRules(); |
23 | | |
24 | 13 | /** |
25 | 14 | * Test for {@link OsmUrlToBounds#positionToBounds}. |
26 | 15 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/tools/StreamUtilsTest.java b/test/unit/org/openstreetmap/josm/tools/StreamUtilsTest.java
index 671282b96..3451f16c9 100644
a
|
b
|
|
1 | 1 | // License: GPL. For details, see LICENSE file. |
2 | 2 | package org.openstreetmap.josm.tools; |
3 | 3 | |
4 | | import org.junit.jupiter.api.extension.RegisterExtension; |
5 | | import org.junit.jupiter.api.Test; |
6 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
7 | | |
8 | 4 | import static org.junit.jupiter.api.Assertions.assertEquals; |
9 | 5 | |
10 | 6 | import java.util.Arrays; |
11 | 7 | import java.util.stream.Collectors; |
12 | 8 | |
13 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
14 | 9 | import net.trajano.commons.testing.UtilityClassTestUtil; |
| 10 | import org.junit.jupiter.api.Test; |
15 | 11 | |
16 | 12 | /** |
17 | 13 | * Unit tests of {@link StreamUtils} class. |
18 | 14 | */ |
19 | 15 | class StreamUtilsTest { |
20 | | |
21 | | /** |
22 | | * Setup rule. |
23 | | */ |
24 | | @RegisterExtension |
25 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
26 | | public JOSMTestRules test = new JOSMTestRules(); |
27 | | |
28 | 16 | /** |
29 | 17 | * Tests that {@code StreamUtils} satisfies utility class criteria. |
30 | 18 | * @throws ReflectiveOperationException if an error occurs |
-
diff --git a/test/unit/org/openstreetmap/josm/tools/Tag2LinkTest.java b/test/unit/org/openstreetmap/josm/tools/Tag2LinkTest.java
index 125a0908f..6a30f0961 100644
a
|
b
|
import java.util.Arrays;
|
6 | 6 | import java.util.List; |
7 | 7 | |
8 | 8 | import org.junit.Assert; |
9 | | import org.junit.jupiter.api.extension.RegisterExtension; |
10 | 9 | import org.junit.jupiter.api.Test; |
11 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
12 | | |
13 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 10 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
14 | 11 | |
15 | 12 | /** |
16 | 13 | * Test {@link Tag2Link} |
17 | 14 | */ |
| 15 | @BasicPreferences |
18 | 16 | class Tag2LinkTest { |
19 | 17 | |
20 | 18 | List<String> links = new ArrayList<>(); |
… |
… |
class Tag2LinkTest {
|
27 | 25 | Assert.assertEquals(Arrays.asList(expected), links); |
28 | 26 | } |
29 | 27 | |
30 | | /** |
31 | | * Setup test. |
32 | | */ |
33 | | @RegisterExtension |
34 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
35 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
36 | | |
37 | 28 | /** |
38 | 29 | * Unit test of function {@link Tag2Link#initialize()}. |
39 | 30 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/tools/TextTagParserTest.java b/test/unit/org/openstreetmap/josm/tools/TextTagParserTest.java
index 631f9a8cf..69dec1c47 100644
a
|
b
|
import java.util.HashMap;
|
10 | 10 | import java.util.List; |
11 | 11 | import java.util.Map; |
12 | 12 | |
13 | | import org.junit.jupiter.api.extension.RegisterExtension; |
14 | 13 | import org.junit.jupiter.api.Test; |
15 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
16 | | |
17 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 14 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
18 | 15 | |
19 | 16 | /** |
20 | 17 | * Unit tests of {@link TextTagParser} class. |
21 | 18 | */ |
| 19 | // Some of this depends on preferences |
| 20 | @BasicPreferences |
22 | 21 | class TextTagParserTest { |
23 | | /** |
24 | | * Some of this depends on preferences. |
25 | | */ |
26 | | @RegisterExtension |
27 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
28 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
29 | | |
30 | 22 | /** |
31 | 23 | * Test of {@link TextTagParser#unescape} method. |
32 | 24 | */ |
-
diff --git a/test/unit/org/openstreetmap/josm/tools/UtilsTest.java b/test/unit/org/openstreetmap/josm/tools/UtilsTest.java
index 195aa2506..4260bdbc3 100644
a
|
b
|
import java.util.Map;
|
21 | 21 | import java.util.TreeMap; |
22 | 22 | import java.util.regex.Pattern; |
23 | 23 | |
24 | | import org.junit.jupiter.api.Test; |
25 | | import org.junit.jupiter.api.extension.RegisterExtension; |
26 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
27 | | |
28 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
29 | 24 | import net.trajano.commons.testing.UtilityClassTestUtil; |
| 25 | import org.junit.jupiter.api.Test; |
30 | 26 | |
31 | 27 | /** |
32 | 28 | * Unit tests of {@link Utils} class. |
33 | 29 | */ |
34 | 30 | class UtilsTest { |
35 | | /** |
36 | | * Use default, basic test rules. |
37 | | */ |
38 | | @RegisterExtension |
39 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
40 | | public JOSMTestRules rules = new JOSMTestRules(); |
41 | | |
42 | 31 | /** |
43 | 32 | * Tests that {@code Utils} satisfies utility class criteria. |
44 | 33 | * @throws ReflectiveOperationException if an error occurs |
-
diff --git a/test/unit/org/openstreetmap/josm/tools/XmlUtilsTest.java b/test/unit/org/openstreetmap/josm/tools/XmlUtilsTest.java
index c126bb511..734072f0a 100644
a
|
b
|
|
1 | 1 | // License: GPL. For details, see LICENSE file. |
2 | 2 | package org.openstreetmap.josm.tools; |
3 | 3 | |
4 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
5 | | import org.junit.jupiter.api.extension.RegisterExtension; |
6 | | import org.junit.jupiter.api.Test; |
7 | | import org.openstreetmap.josm.TestUtils; |
8 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
9 | | import org.xml.sax.InputSource; |
10 | | import org.xml.sax.SAXException; |
11 | | import org.xml.sax.helpers.DefaultHandler; |
| 4 | import static org.junit.jupiter.api.Assertions.assertEquals; |
| 5 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
| 6 | import static org.junit.jupiter.api.Assertions.fail; |
| 7 | |
| 8 | import java.io.FileInputStream; |
| 9 | import java.io.IOException; |
| 10 | import java.io.StringWriter; |
12 | 11 | |
13 | 12 | import javax.xml.parsers.ParserConfigurationException; |
14 | 13 | import javax.xml.transform.Transformer; |
15 | 14 | import javax.xml.transform.TransformerException; |
16 | 15 | import javax.xml.transform.stream.StreamResult; |
17 | 16 | import javax.xml.transform.stream.StreamSource; |
18 | | import java.io.FileInputStream; |
19 | | import java.io.IOException; |
20 | | import java.io.StringWriter; |
21 | 17 | |
22 | | import static org.junit.jupiter.api.Assertions.assertEquals; |
23 | | import static org.junit.jupiter.api.Assertions.assertNotNull; |
24 | | import static org.junit.jupiter.api.Assertions.fail; |
| 18 | import org.openstreetmap.josm.TestUtils; |
| 19 | |
| 20 | import org.junit.jupiter.api.Test; |
| 21 | import org.xml.sax.InputSource; |
| 22 | import org.xml.sax.SAXException; |
| 23 | import org.xml.sax.helpers.DefaultHandler; |
25 | 24 | |
26 | 25 | /** |
27 | 26 | * Unit tests of {@link XmlUtils} class. |
28 | 27 | */ |
29 | 28 | class XmlUtilsTest { |
30 | | |
31 | | /** |
32 | | * Use default, basic test rules. |
33 | | */ |
34 | | @RegisterExtension |
35 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
36 | | public JOSMTestRules rules = new JOSMTestRules(); |
37 | | |
38 | 29 | private static final String EXPECTED = "External Entity: Failed to read external document 'passwd', " + |
39 | 30 | "because 'file' access is not allowed due to restriction set by the accessExternalDTD property."; |
40 | 31 | |
-
diff --git a/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportExceptionHandlerTest.java b/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportExceptionHandlerTest.java
index 11fdc6443..ecc5c4069 100644
a
|
b
|
package org.openstreetmap.josm.tools.bugreport;
|
3 | 3 | |
4 | 4 | import java.util.concurrent.CountDownLatch; |
5 | 5 | |
6 | | import org.junit.jupiter.api.extension.RegisterExtension; |
7 | 6 | import org.junit.jupiter.api.Test; |
8 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
9 | | |
10 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
11 | 7 | |
12 | 8 | /** |
13 | 9 | * Unit tests of {@link BugReportExceptionHandler} class. |
14 | 10 | */ |
15 | 11 | class BugReportExceptionHandlerTest { |
16 | | /** |
17 | | * No dependencies |
18 | | */ |
19 | | @RegisterExtension |
20 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
21 | | public JOSMTestRules test = new JOSMTestRules(); |
22 | | |
23 | 12 | /** |
24 | 13 | * Unit test for {@link BugReportExceptionHandler#handleException} method. |
25 | 14 | * @throws InterruptedException if the current thread is interrupted while waiting |
-
diff --git a/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportTest.java b/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportTest.java
index adb3fecf9..fa183ba88 100644
a
|
b
|
import java.io.IOException;
|
9 | 9 | import java.io.PrintWriter; |
10 | 10 | import java.io.StringWriter; |
11 | 11 | |
12 | | import org.junit.jupiter.api.extension.RegisterExtension; |
13 | 12 | import org.junit.jupiter.api.Test; |
14 | 13 | import org.openstreetmap.josm.actions.ShowStatusReportAction; |
15 | | import org.openstreetmap.josm.testutils.JOSMTestRules; |
16 | | |
17 | | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
| 14 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
18 | 15 | |
19 | 16 | /** |
20 | 17 | * Tests the bug report class. |
21 | 18 | * @author Michael Zangl |
22 | 19 | */ |
| 20 | // Preferences for the report text |
| 21 | @BasicPreferences |
23 | 22 | class BugReportTest { |
24 | | /** |
25 | | * Preferences for the report text |
26 | | */ |
27 | | @RegisterExtension |
28 | | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
29 | | public JOSMTestRules test = new JOSMTestRules().preferences(); |
30 | | |
31 | 23 | /** |
32 | 24 | * Test {@link BugReport#getReportText} |
33 | 25 | */ |