Changeset 18853 in josm for trunk/test
- Timestamp:
- 2023-10-04T00:03:40+02:00 (14 months ago)
- Location:
- trunk/test
- Files:
-
- 187 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/functional/org/openstreetmap/josm/gui/GettingStartedTest.java
r17275 r18853 6 6 import java.io.IOException; 7 7 8 import org.junit.jupiter.api.Disabled; 8 9 import org.junit.jupiter.api.Test; 9 import org.junit.jupiter.api.BeforeAll;10 import org.junit.jupiter.api.Disabled;11 import org.openstreetmap.josm.JOSMFixture;12 10 13 11 /** … … 15 13 */ 16 14 class GettingStartedTest { 17 18 /**19 * Setup test.20 */21 @BeforeAll22 public static void init() {23 JOSMFixture.createFunctionalTestFixture().init();24 }25 26 15 /** 27 16 * Tests that image links are replaced. -
trunk/test/functional/org/openstreetmap/josm/gui/history/HistoryBrowserTestFT.java
r17275 r18853 6 6 import javax.swing.JFrame; 7 7 8 import org.junit.jupiter.api.BeforeAll;9 8 import org.openstreetmap.josm.JOSMFixture; 10 9 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; … … 18 17 19 18 class HistoryBrowserTestFT extends JFrame { 20 21 @BeforeAll22 public static void init() {23 JOSMFixture.createFunctionalTestFixture().init();24 }25 19 26 20 private HistoryBrowser browser; … … 57 51 58 52 public static void main(String[] args) { 59 HistoryBrowserTestFT.init();53 JOSMFixture.createFunctionalTestFixture().init(); 60 54 new HistoryBrowserTestFT().setVisible(true); 61 55 } -
trunk/test/functional/org/openstreetmap/josm/tools/ImageProviderTest.java
r17275 r18853 25 25 import javax.swing.ImageIcon; 26 26 27 import org.junit.jupiter.api.BeforeAll;28 27 import org.junit.jupiter.api.BeforeEach; 29 28 import org.junit.jupiter.api.Test; 30 import org.junit.jupiter.api.extension.RegisterExtension;31 29 import org.junit.jupiter.params.ParameterizedTest; 32 30 import org.junit.jupiter.params.provider.ValueSource; 33 import org.openstreetmap.josm.JOSMFixture;34 31 import org.openstreetmap.josm.TestUtils; 35 32 import org.openstreetmap.josm.data.coor.LatLon; … … 38 35 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets; 39 36 import org.openstreetmap.josm.gui.tagging.presets.items.Key; 40 import org.openstreetmap.josm.testutils.JOSMTestRules;41 37 import org.xml.sax.SAXException; 42 38 43 39 import com.kitfox.svg.SVGConst; 44 45 40 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 46 41 … … 49 44 */ 50 45 class ImageProviderTest { 51 52 /**53 * Setup test.54 */55 @RegisterExtension56 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")57 public JOSMTestRules test = new JOSMTestRules();58 59 46 private static final class LogHandler14319 extends Handler { 60 47 boolean failed; … … 74 61 public void close() throws SecurityException { 75 62 } 76 }77 78 /**79 * Setup test.80 */81 @BeforeAll82 public static void setUp() {83 JOSMFixture.createUnitTestFixture().init();84 63 } 85 64 -
trunk/test/functional/org/openstreetmap/josm/tools/ImageProviderTestIT.java
r17275 r18853 5 5 6 6 import org.junit.jupiter.api.Test; 7 import org.junit.jupiter.api.extension.RegisterExtension;8 import org.openstreetmap.josm.testutils.JOSMTestRules;9 10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;11 7 12 8 /** … … 14 10 */ 15 11 class ImageProviderTestIT { 16 17 /**18 * Setup test.19 */20 @RegisterExtension21 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")22 public JOSMTestRules test = new JOSMTestRules();23 24 12 /** 25 13 * Test fetching an image using {@code wiki://} protocol. -
trunk/test/functional/org/openstreetmap/josm/tools/ImageProviderTestManual.java
r17275 r18853 11 11 import javax.swing.JPanel; 12 12 13 import org.junit.jupiter.api.Disabled; 13 14 import org.junit.jupiter.api.Test; 14 import org.junit.jupiter.api.Disabled;15 import org.junit.jupiter.api.extension.RegisterExtension;16 import org.openstreetmap.josm.testutils.JOSMTestRules;17 18 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;19 15 20 16 /** … … 22 18 */ 23 19 class ImageProviderTestManual { 24 25 /**26 * Setup test.27 */28 @RegisterExtension29 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")30 public JOSMTestRules test = new JOSMTestRules();31 32 20 /** 33 21 * Test getting a cursor 34 22 * @throws InterruptedException in case of thread interruption 35 23 */ 36 @Disabled("manual execution only, as the look of the cursor cannot be checked automat edly")24 @Disabled("manual execution only, as the look of the cursor cannot be checked automatically") 37 25 @Test 38 26 void testGetCursor() throws InterruptedException { -
trunk/test/performance/org/openstreetmap/josm/io/OsmReaderPerformanceTest.java
r18691 r18853 12 12 import java.util.concurrent.TimeUnit; 13 13 14 import org.junit.jupiter.api.BeforeAll;15 14 import org.junit.jupiter.api.Test; 16 15 import org.junit.jupiter.api.Timeout; 17 import org.openstreetmap.josm.JOSMFixture;18 16 import org.openstreetmap.josm.PerformanceTestUtils; 19 17 import org.openstreetmap.josm.PerformanceTestUtils.PerformanceTestTimer; … … 30 28 class OsmReaderPerformanceTest { 31 29 private static final int TIMES = 4; 32 33 /**34 * Prepare the test.35 */36 @BeforeAll37 public static void createJOSMFixture() {38 JOSMFixture.createPerformanceTestFixture().init(true);39 }40 30 41 31 /** -
trunk/test/performance/org/openstreetmap/josm/io/OsmWriterPerformanceTest.java
r18690 r18853 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.io; 3 4 import org.junit.jupiter.api.BeforeAll;5 import org.junit.jupiter.api.BeforeEach;6 import org.junit.jupiter.api.Test;7 import org.junit.jupiter.api.Timeout;8 import org.openstreetmap.josm.JOSMFixture;9 import org.openstreetmap.josm.PerformanceTestUtils;10 import org.openstreetmap.josm.PerformanceTestUtils.PerformanceTestTimer;11 import org.openstreetmap.josm.data.osm.DataSet;12 3 13 4 import java.io.PrintWriter; 14 5 import java.io.StringWriter; 15 6 import java.util.concurrent.TimeUnit; 7 8 import org.junit.jupiter.api.BeforeEach; 9 import org.junit.jupiter.api.Test; 10 import org.junit.jupiter.api.Timeout; 11 import org.openstreetmap.josm.PerformanceTestUtils; 12 import org.openstreetmap.josm.PerformanceTestUtils.PerformanceTestTimer; 13 import org.openstreetmap.josm.data.osm.DataSet; 16 14 17 15 /** … … 24 22 private static final int TIMES = 4; 25 23 private DataSet neubrandenburgDataSet; 26 27 /**28 * Prepare the test.29 */30 @BeforeAll31 public static void createJOSMFixture() {32 JOSMFixture.createPerformanceTestFixture().init(true);33 }34 24 35 25 /** -
trunk/test/unit/org/openstreetmap/josm/actions/CombineWayActionTest.java
r17275 r18853 15 15 import java.util.Set; 16 16 17 import org.junit.jupiter.api.extension.RegisterExtension;18 17 import org.junit.jupiter.api.Test; 19 18 import org.openstreetmap.josm.TestUtils; … … 24 23 import org.openstreetmap.josm.io.IllegalDataException; 25 24 import org.openstreetmap.josm.io.OsmReader; 26 import org.openstreetmap.josm.testutils.JOSMTestRules;27 25 28 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;29 26 import nl.jqno.equalsverifier.EqualsVerifier; 30 27 … … 33 30 */ 34 31 class CombineWayActionTest { 35 36 /**37 * Setup test.38 */39 @RegisterExtension40 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")41 public JOSMTestRules test = new JOSMTestRules();42 43 32 /** 44 33 * Non-regression test for bug #11957. -
trunk/test/unit/org/openstreetmap/josm/actions/corrector/ReverseWayNoTagCorrectorTest.java
r17275 r18853 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 7 import org.openstreetmap.josm.data.osm.Tag; 9 8 import org.openstreetmap.josm.data.osm.Tagged; 10 9 import org.openstreetmap.josm.data.osm.Way; 11 import org.openstreetmap.josm.testutils.JOSMTestRules;12 13 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;14 10 15 11 /** … … 17 13 */ 18 14 class ReverseWayNoTagCorrectorTest { 19 20 /**21 * Setup test.22 */23 @RegisterExtension24 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")25 public JOSMTestRules test = new JOSMTestRules();26 27 15 /** 28 16 * Tests the {@link ReverseWayNoTagCorrector#getDirectionalTags} function -
trunk/test/unit/org/openstreetmap/josm/actions/corrector/ReverseWayTagCorrectorTest.java
r18690 r18853 12 12 13 13 import org.junit.jupiter.api.Test; 14 import org.junit.jupiter.api.extension.RegisterExtension;15 14 import org.openstreetmap.josm.data.correction.TagCorrection; 16 15 import org.openstreetmap.josm.data.osm.Node; … … 19 18 import org.openstreetmap.josm.data.osm.Tag; 20 19 import org.openstreetmap.josm.data.osm.Way; 21 import org.openstreetmap.josm.testutils.JOSMTestRules;22 20 23 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;24 21 import net.trajano.commons.testing.UtilityClassTestUtil; 25 22 … … 28 25 */ 29 26 class ReverseWayTagCorrectorTest { 30 31 /**32 * Setup test.33 */34 @RegisterExtension35 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")36 public JOSMTestRules test = new JOSMTestRules();37 38 27 /** 39 28 * Tests that {@code ReverseWayTagCorrector.TagSwitcher} satisfies utility class criteria. -
trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/ChangesetContentDownloadTaskTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.actions.downloadtasks; 3 3 4 import static org.junit.jupiter.api.Assertions.assert NotNull;4 import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; 5 5 import static org.junit.jupiter.api.Assertions.assertThrows; 6 6 7 7 import java.awt.Component; 8 8 import java.util.Arrays; 9 import java.util.List; 9 10 10 11 import org.junit.jupiter.api.Test; 11 import org.junit.jupiter.api.extension.RegisterExtension;12 import org.openstreetmap.josm.testutils.JOSMTestRules;13 14 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;15 12 16 13 /** … … 18 15 */ 19 16 class ChangesetContentDownloadTaskTest { 20 21 /**22 * Setup test.23 */24 @RegisterExtension25 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")26 public JOSMTestRules test = new JOSMTestRules();27 28 17 /** 29 18 * Unit test of {@code ChangesetContentDownloadTask#ChangesetContentDownloadTask}. … … 34 23 // empty component 35 24 }; 36 assert NotNull(new ChangesetContentDownloadTask(parent, 1));37 assert NotNull(new ChangesetContentDownloadTask(parent, Arrays.asList(1, 2)));38 assert NotNull(new ChangesetContentDownloadTask(parent, null));25 assertDoesNotThrow(() -> new ChangesetContentDownloadTask(parent, 1)); 26 assertDoesNotThrow(() -> new ChangesetContentDownloadTask(parent, Arrays.asList(1, 2))); 27 assertDoesNotThrow(() -> new ChangesetContentDownloadTask(parent, null)); 39 28 } 40 29 … … 60 49 @Test 61 50 void testChangesetContentDownloadTaskNullParent2() { 62 assertThrows(IllegalArgumentException.class, () -> new ChangesetContentDownloadTask(Arrays.asList(1, 2))); 51 final List<Integer> toDownload = Arrays.asList(1, 2); 52 assertThrows(IllegalArgumentException.class, () -> new ChangesetContentDownloadTask(toDownload)); 63 53 } 64 54 } -
trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/ChangesetHeaderDownloadTaskTest.java
r17275 r18853 6 6 7 7 import java.awt.Component; 8 import java.util.Collection; 8 9 import java.util.Collections; 9 10 10 11 import org.junit.jupiter.api.Test; 11 import org.junit.jupiter.api.extension.RegisterExtension;12 12 import org.openstreetmap.josm.data.osm.Changeset; 13 import org.openstreetmap.josm.testutils.JOSMTestRules;14 15 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;16 13 17 14 /** … … 19 16 */ 20 17 class ChangesetHeaderDownloadTaskTest { 21 22 /**23 * Setup test.24 */25 @RegisterExtension26 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")27 public JOSMTestRules test = new JOSMTestRules();28 29 18 /** 30 19 * Unit test of {@code ChangesetHeaderDownloadTask#buildTaskForChangesets}. … … 36 25 }; 37 26 assertNotNull(ChangesetHeaderDownloadTask.buildTaskForChangesets(parent, Collections.singleton(new Changeset(1)))); 38 assertNotNull(ChangesetHeaderDownloadTask.buildTaskForChangesets(parent, Collections. <Changeset>singleton(null)));27 assertNotNull(ChangesetHeaderDownloadTask.buildTaskForChangesets(parent, Collections.singleton(null))); 39 28 assertNotNull(ChangesetHeaderDownloadTask.buildTaskForChangesets(parent, null)); 40 29 } … … 45 34 @Test 46 35 void testBuildTaskForChangesetsNullParent() { 36 final Collection<Changeset> changesets = Collections.singleton(new Changeset(1)); 47 37 assertThrows(NullPointerException.class, 48 () -> ChangesetHeaderDownloadTask.buildTaskForChangesets( Collections.singleton(new Changeset(1))));38 () -> ChangesetHeaderDownloadTask.buildTaskForChangesets(changesets)); 49 39 } 50 40 } -
trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/ChangesetQueryTaskTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.actions.downloadtasks; 3 3 4 import static org.junit.jupiter.api.Assertions.assert NotNull;4 import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; 5 5 import static org.junit.jupiter.api.Assertions.assertThrows; 6 6 … … 8 8 9 9 import org.junit.jupiter.api.Test; 10 import org.junit.jupiter.api.extension.RegisterExtension;11 10 import org.openstreetmap.josm.io.ChangesetQuery; 12 import org.openstreetmap.josm.testutils.JOSMTestRules;13 14 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;15 11 16 12 /** … … 18 14 */ 19 15 class ChangesetQueryTaskTest { 20 21 /**22 * Setup test.23 */24 @RegisterExtension25 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")26 public JOSMTestRules test = new JOSMTestRules();27 28 16 /** 29 17 * Unit test of {@code ChangesetQueryTask#ChangesetQueryTask}. … … 34 22 // empty component 35 23 }; 36 assert NotNull(new ChangesetQueryTask(parent, new ChangesetQuery()));24 assertDoesNotThrow(() -> new ChangesetQueryTask(parent, new ChangesetQuery())); 37 25 } 38 26 … … 42 30 @Test 43 31 void testChangesetQueryTaskNullParent() { 44 assertThrows(IllegalArgumentException.class, () -> new ChangesetQueryTask(new ChangesetQuery())); 32 final ChangesetQuery query = new ChangesetQuery(); 33 assertThrows(IllegalArgumentException.class, () -> new ChangesetQueryTask(query)); 45 34 } 46 35 } -
trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/DownloadReferrersTaskTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.actions.downloadtasks; 3 3 4 import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; 4 5 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; 6 import static org.junit.jupiter.api.Assertions.assertThrows; 7 7 8 8 import org.junit.jupiter.api.Test; 9 import org.junit.jupiter.api.extension.RegisterExtension;10 9 import org.openstreetmap.josm.data.coor.LatLon; 11 10 import org.openstreetmap.josm.data.osm.DataSet; … … 13 12 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 14 13 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 15 import org.openstreetmap.josm.testutils.JOSMTestRules;16 17 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;18 14 19 15 /** … … 21 17 */ 22 18 class DownloadReferrersTaskTest { 23 24 /**25 * Setup test.26 */27 @RegisterExtension28 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")29 public JOSMTestRules test = new JOSMTestRules();30 31 19 /** 32 20 * Unit test of {@code DownloadReferrersTask#DownloadReferrersTask}. … … 42 30 ds.addPrimitive(n2); 43 31 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 44 assertNotNull(new DownloadReferrersTask(layer, null)); 45 assertNotNull(new DownloadReferrersTask(layer, ds.allPrimitives())); 46 try { 47 new DownloadReferrersTask(layer, n1.getPrimitiveId(), null); 48 fail(); 49 } catch (IllegalArgumentException e) { 50 assertEquals("Cannot download referrers for new primitives (ID -1)", e.getMessage()); 51 } 52 assertNotNull(new DownloadReferrersTask(layer, n2.getPrimitiveId(), null)); 32 assertDoesNotThrow(() -> new DownloadReferrersTask(layer, null)); 33 assertDoesNotThrow(() -> new DownloadReferrersTask(layer, ds.allPrimitives())); 34 IllegalArgumentException iae = assertThrows(IllegalArgumentException.class, 35 () -> new DownloadReferrersTask(layer, n1, null)); 36 assertEquals("Cannot download referrers for new primitives (ID -1)", iae.getMessage()); 37 assertDoesNotThrow(() -> new DownloadReferrersTask(layer, n2.getPrimitiveId(), null)); 53 38 } 54 39 } -
trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskListTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.actions.downloadtasks; 3 3 4 import static org.junit.jupiter.api.Assertions.assertNull; 4 5 import static org.junit.jupiter.api.Assertions.assertTrue; 5 import static org.junit.jupiter.api.Assertions.assertNull;6 6 7 7 import java.awt.geom.Area; … … 9 9 10 10 import org.junit.jupiter.api.Test; 11 import org.junit.jupiter.api.extension.RegisterExtension;12 11 import org.openstreetmap.josm.data.Bounds; 13 12 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 14 import org.openstreetmap.josm.testutils.JOSMTestRules;15 16 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;17 13 18 14 /** … … 20 16 */ 21 17 class DownloadTaskListTest { 22 23 /**24 * Setup test.25 */26 @RegisterExtension27 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")28 public JOSMTestRules test = new JOSMTestRules();29 30 18 /** 31 19 * Unit test of {@code DownloadTaskList#DownloadTaskList}. … … 50 38 assertTrue(list.getDownloadedPrimitives().isEmpty()); 51 39 assertNull(list.download(false, 52 Collections. <Area>singletonList(new Area(new Bounds(0, 0, true).asRect())), false, false, NullProgressMonitor.INSTANCE).get());40 Collections.singletonList(new Area(new Bounds(0, 0, true).asRect())), false, false, NullProgressMonitor.INSTANCE).get()); 53 41 assertTrue(list.getDownloadedPrimitives().isEmpty()); 54 42 } -
trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/PostDownloadHandlerTest.java
r17275 r18853 14 14 15 15 import org.junit.jupiter.api.Test; 16 import org.junit.jupiter.api.extension.RegisterExtension;17 16 import org.openstreetmap.josm.data.Bounds; 18 17 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 19 import org.openstreetmap.josm.testutils.JOSMTestRules;20 18 import org.openstreetmap.josm.tools.Logging; 21 22 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;23 19 24 20 /** … … 26 22 */ 27 23 class PostDownloadHandlerTest { 28 29 /**30 * Setup test.31 */32 @RegisterExtension33 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")34 public JOSMTestRules test = new JOSMTestRules();35 36 24 private static DownloadTask newTask(final List<Object> errorObjects) { 37 25 return new DownloadTask() { -
trunk/test/unit/org/openstreetmap/josm/command/TransformNodesCommandTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.command; 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; … … 9 8 import org.openstreetmap.josm.data.osm.User; 10 9 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 11 import org.openstreetmap.josm.testutils.JOSMTestRules;12 10 13 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;14 11 import nl.jqno.equalsverifier.EqualsVerifier; 15 12 import nl.jqno.equalsverifier.Warning; … … 19 16 */ 20 17 class TransformNodesCommandTest { 21 22 /**23 * Setup test.24 */25 @RegisterExtension26 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")27 public JOSMTestRules test = new JOSMTestRules();28 29 18 /** 30 19 * Unit test of methods {@link TransformNodesCommand#equals} and {@link TransformNodesCommand#hashCode}. -
trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java
r17275 r18853 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.TestUtils; 12 11 import org.openstreetmap.josm.command.CommandTest.CommandTestData; … … 17 16 import org.openstreetmap.josm.data.osm.Way; 18 17 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 19 import org.openstreetmap.josm.testutils.JOSMTestRules;20 18 21 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;22 19 import nl.jqno.equalsverifier.EqualsVerifier; 23 20 import nl.jqno.equalsverifier.Warning; … … 27 24 */ 28 25 class ConflictAddCommandTest { 29 30 /**31 * Setup test.32 */33 @RegisterExtension34 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")35 public JOSMTestRules test = new JOSMTestRules();36 26 private CommandTestData testData; 37 27 -
trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictResolveCommandTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.command.conflict; 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; … … 10 9 import org.openstreetmap.josm.data.osm.User; 11 10 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 12 import org.openstreetmap.josm.testutils.JOSMTestRules;13 11 14 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;15 12 import nl.jqno.equalsverifier.EqualsVerifier; 16 13 import nl.jqno.equalsverifier.Warning; … … 20 17 */ 21 18 class ConflictResolveCommandTest { 22 23 /**24 * Setup test.25 */26 @RegisterExtension27 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")28 public JOSMTestRules test = new JOSMTestRules();29 30 19 /** 31 20 * Unit test of methods {@link ConflictResolveCommand#equals} and {@link ConflictResolveCommand#hashCode}. -
trunk/test/unit/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommandTest.java
r17275 r18853 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.TestUtils; 12 11 import org.openstreetmap.josm.command.CommandTest.CommandTestData; … … 19 18 import org.openstreetmap.josm.gui.conflict.pair.MergeDecisionType; 20 19 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 21 import org.openstreetmap.josm.testutils.JOSMTestRules;22 20 23 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;24 21 import nl.jqno.equalsverifier.EqualsVerifier; 25 22 import nl.jqno.equalsverifier.Warning; … … 31 28 32 29 private CommandTestData testData; 33 34 /**35 * Setup test.36 */37 @RegisterExtension38 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")39 public JOSMTestRules test = new JOSMTestRules();40 30 41 31 /** -
trunk/test/unit/org/openstreetmap/josm/command/conflict/DeletedStateConflictResolveCommandTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.command.conflict; 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; … … 11 10 import org.openstreetmap.josm.data.osm.Way; 12 11 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 13 import org.openstreetmap.josm.testutils.JOSMTestRules;14 12 15 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;16 13 import nl.jqno.equalsverifier.EqualsVerifier; 17 14 import nl.jqno.equalsverifier.Warning; … … 21 18 */ 22 19 class DeletedStateConflictResolveCommandTest { 23 24 /**25 * Setup test.26 */27 @RegisterExtension28 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")29 public JOSMTestRules test = new JOSMTestRules();30 31 20 /** 32 21 * Unit test of methods {@link DeletedStateConflictResolveCommand#equals} and {@link DeletedStateConflictResolveCommand#hashCode}. -
trunk/test/unit/org/openstreetmap/josm/command/conflict/ModifiedConflictResolveCommandTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.command.conflict; 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; … … 11 10 import org.openstreetmap.josm.data.osm.Way; 12 11 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 13 import org.openstreetmap.josm.testutils.JOSMTestRules;14 12 15 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;16 13 import nl.jqno.equalsverifier.EqualsVerifier; 17 14 import nl.jqno.equalsverifier.Warning; … … 21 18 */ 22 19 class ModifiedConflictResolveCommandTest { 23 24 /**25 * Setup test.26 */27 @RegisterExtension28 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")29 public JOSMTestRules test = new JOSMTestRules();30 31 20 /** 32 21 * Unit test of methods {@link ModifiedConflictResolveCommand#equals} and {@link ModifiedConflictResolveCommand#hashCode}. -
trunk/test/unit/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommandTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.command.conflict; 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; … … 11 10 import org.openstreetmap.josm.data.osm.User; 12 11 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 13 import org.openstreetmap.josm.testutils.JOSMTestRules;14 12 15 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;16 13 import nl.jqno.equalsverifier.EqualsVerifier; 17 14 import nl.jqno.equalsverifier.Warning; … … 21 18 */ 22 19 class RelationMemberConflictResolverCommandTest { 23 24 /**25 * Setup test.26 */27 @RegisterExtension28 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")29 public JOSMTestRules test = new JOSMTestRules();30 31 20 /** 32 21 * Unit test of methods {@link RelationMemberConflictResolverCommand#equals} and {@link RelationMemberConflictResolverCommand#hashCode}. -
trunk/test/unit/org/openstreetmap/josm/command/conflict/TagConflictResolveCommandTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.command.conflict; 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; … … 11 10 import org.openstreetmap.josm.data.osm.Way; 12 11 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 13 import org.openstreetmap.josm.testutils.JOSMTestRules;14 12 15 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;16 13 import nl.jqno.equalsverifier.EqualsVerifier; 17 14 import nl.jqno.equalsverifier.Warning; … … 21 18 */ 22 19 class TagConflictResolveCommandTest { 23 24 /**25 * Setup test.26 */27 @RegisterExtension28 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")29 public JOSMTestRules test = new JOSMTestRules();30 31 20 /** 32 21 * Unit test of methods {@link TagConflictResolveCommand#equals} and {@link TagConflictResolveCommand#hashCode}. -
trunk/test/unit/org/openstreetmap/josm/command/conflict/VersionConflictResolveCommandTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.command.conflict; 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; … … 11 10 import org.openstreetmap.josm.data.osm.Way; 12 11 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 13 import org.openstreetmap.josm.testutils.JOSMTestRules;14 12 15 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;16 13 import nl.jqno.equalsverifier.EqualsVerifier; 17 14 import nl.jqno.equalsverifier.Warning; … … 21 18 */ 22 19 class VersionConflictResolveCommandTest { 23 24 /**25 * Setup test.26 */27 @RegisterExtension28 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")29 public JOSMTestRules test = new JOSMTestRules();30 31 20 /** 32 21 * Unit test of methods {@link VersionConflictResolveCommand#equals} and {@link VersionConflictResolveCommand#hashCode}. -
trunk/test/unit/org/openstreetmap/josm/command/conflict/WayNodesConflictResolverCommandTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.command.conflict; 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; … … 11 10 import org.openstreetmap.josm.data.osm.Way; 12 11 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 13 import org.openstreetmap.josm.testutils.JOSMTestRules;14 12 15 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;16 13 import nl.jqno.equalsverifier.EqualsVerifier; 17 14 import nl.jqno.equalsverifier.Warning; … … 21 18 */ 22 19 class WayNodesConflictResolverCommandTest { 23 24 /**25 * Setup test.26 */27 @RegisterExtension28 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")29 public JOSMTestRules test = new JOSMTestRules();30 31 20 /** 32 21 * Unit test of methods {@link WayNodesConflictResolverCommand#equals} and {@link WayNodesConflictResolverCommand#hashCode}. -
trunk/test/unit/org/openstreetmap/josm/data/APIDataSetTest.java
r17275 r18853 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.assertThrows; 6 7 import static org.junit.jupiter.api.Assertions.assertTrue; 7 import static org.junit.jupiter.api.Assertions.fail;8 8 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.conflict.ConflictCollection; … … 19 18 import org.openstreetmap.josm.data.osm.RelationMember; 20 19 import org.openstreetmap.josm.data.osm.Way; 21 import org.openstreetmap.josm.testutils.JOSMTestRules;22 23 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;24 20 25 21 /** … … 27 23 */ 28 24 class APIDataSetTest { 29 30 /**31 * Setup test.32 */33 @RegisterExtension34 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")35 public JOSMTestRules test = new JOSMTestRules();36 37 25 @Test 38 26 void testOneNewRelationOnly() throws CyclicUploadDependencyException { … … 250 238 APIDataSet apiDataSet = new APIDataSet(); 251 239 apiDataSet.init(ds); 252 try { 253 apiDataSet.adjustRelationUploadOrder(); 254 fail("expected cyclic upload dependency exception not thrown"); 255 } catch (CyclicUploadDependencyException e) { 256 System.out.println(e); 257 } 240 assertThrows(CyclicUploadDependencyException.class, apiDataSet::adjustRelationUploadOrder); 258 241 } 259 242 } -
trunk/test/unit/org/openstreetmap/josm/data/VersionTest.java
r17275 r18853 8 8 import java.nio.charset.StandardCharsets; 9 9 10 import org.junit.jupiter.api.BeforeAll;11 10 import org.junit.jupiter.api.Test; 12 import org.openstreetmap.josm.JOSMFixture;13 11 14 12 /** … … 16 14 */ 17 15 class VersionTest { 18 19 /**20 * Setup test.21 */22 @BeforeAll23 public static void setUpBeforeClass() {24 JOSMFixture.createUnitTestFixture().init();25 }26 27 16 /** 28 17 * Unit test of {@link Version#getAgentString} -
trunk/test/unit/org/openstreetmap/josm/data/coor/CachedLatLonTest.java
r17275 r18853 4 4 import java.text.DecimalFormat; 5 5 6 import org.junit.jupiter.api.extension.RegisterExtension;7 6 import org.junit.jupiter.api.Test; 8 7 import org.openstreetmap.josm.TestUtils; 9 import org.openstreetmap.josm.testutils.JOSMTestRules;10 8 11 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;12 9 import nl.jqno.equalsverifier.EqualsVerifier; 13 10 import nl.jqno.equalsverifier.Warning; … … 17 14 */ 18 15 class CachedLatLonTest { 19 20 /**21 * Setup test.22 */23 @RegisterExtension24 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")25 public JOSMTestRules test = new JOSMTestRules();26 27 16 /** 28 17 * Unit test of methods {@link CachedLatLon#equals} and {@link CachedLatLon#hashCode}. -
trunk/test/unit/org/openstreetmap/josm/data/correction/TagCorrectionTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.data.correction; 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;8 6 9 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;10 7 import nl.jqno.equalsverifier.EqualsVerifier; 11 8 … … 14 11 */ 15 12 class TagCorrectionTest { 16 17 /**18 * Setup test.19 */20 @RegisterExtension21 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")22 public JOSMTestRules test = new JOSMTestRules();23 24 13 /** 25 14 * Unit test of methods {@link TagCorrection#equals} and {@link TagCorrection#hashCode}. -
trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxExtensionCollectionTest.java
r17984 r18853 9 9 import org.junit.jupiter.api.BeforeEach; 10 10 import org.junit.jupiter.api.Test; 11 import org.junit.jupiter.api.extension.RegisterExtension;12 import org.openstreetmap.josm.testutils.JOSMTestRules;13 11 import org.openstreetmap.josm.tools.Logging; 14 12 import org.xml.sax.helpers.AttributesImpl; 15 16 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;17 13 18 14 /** … … 20 16 */ 21 17 class GpxExtensionCollectionTest { 22 23 /**24 * Setup test.25 */26 @RegisterExtension27 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")28 public JOSMTestRules test = new JOSMTestRules();29 30 18 @BeforeEach 31 19 void before() { -
trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxExtensionTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.data.gpx; 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; … … 8 7 import org.openstreetmap.josm.io.GpxReaderTest; 9 8 import org.openstreetmap.josm.io.GpxWriterTest; 10 import org.openstreetmap.josm.testutils.JOSMTestRules;11 9 12 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;13 10 import nl.jqno.equalsverifier.EqualsVerifier; 14 11 import nl.jqno.equalsverifier.Warning; … … 18 15 */ 19 16 class GpxExtensionTest { 20 21 /**22 * Setup test.23 */24 @RegisterExtension25 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")26 public JOSMTestRules test = new JOSMTestRules();27 28 17 /** 29 18 * Unit test of methods {@link GpxExtension#equals} and {@link GpxExtension#hashCode}. -
trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxImageCorrelationTest.java
r18690 r18853 18 18 import org.junit.jupiter.api.TestInstance.Lifecycle; 19 19 import org.junit.jupiter.api.TestMethodOrder; 20 import org.junit.jupiter.api.extension.RegisterExtension;21 20 import org.openstreetmap.josm.TestUtils; 22 21 import org.openstreetmap.josm.data.coor.CachedLatLon; … … 25 24 import org.openstreetmap.josm.spi.preferences.Config; 26 25 import org.openstreetmap.josm.spi.preferences.IPreferences; 27 import org.openstreetmap.josm.testutils. JOSMTestRules;26 import org.openstreetmap.josm.testutils.annotations.Timezone; 28 27 import org.openstreetmap.josm.tools.date.DateUtils; 29 import org.openstreetmap.josm.tools.date.DateUtilsTest;30 28 import org.xml.sax.SAXException; 31 32 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;33 29 34 30 /** 35 31 * Unit tests of {@link GpxImageCorrelation} class. 36 32 */ 33 @TestInstance(Lifecycle.PER_CLASS) 37 34 @TestMethodOrder(MethodName.class) 38 @T estInstance(Lifecycle.PER_CLASS)35 @Timezone 39 36 class GpxImageCorrelationTest { 40 41 /**42 * Setup test.43 */44 @RegisterExtension45 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")46 public JOSMTestRules test = new JOSMTestRules();47 48 37 GpxData gpx; 49 38 GpxImageEntry ib, i0, i1, i2, i3, i4, i5, i6, i7; … … 59 48 public void setUp() throws IOException, SAXException { 60 49 s = Config.getPref(); 61 DateUtilsTest.setTimeZone(DateUtils.UTC);62 50 63 51 gpx = GpxReaderTest.parseGpxData(TestUtils.getTestDataRoot() + "tracks/tracks.gpx"); … … 109 97 /** 110 98 * Tests matching of images to a GPX track. 111 * 99 * <p> 112 100 * TEST #1: default settings 113 101 * tag images within 2 minutes to tracks/segments, interpolate between segments only … … 157 145 /** 158 146 * Tests matching of images to a GPX track. 159 * 147 * <p> 160 148 * TEST #2: Disable all interpolation and tagging close to tracks. Only i1-i4 are tagged 161 149 */ … … 181 169 /** 182 170 * Tests matching of images to a GPX track. 183 * 171 * <p> 184 172 * TEST #3: Disable all interpolation and allow tagging within 1 minute of a track. i0-i5 are tagged. 185 173 * i6 will not be tagged, because it's 68 seconds away from the next waypoint in either direction … … 210 198 /** 211 199 * Tests matching of images to a GPX track. 212 * 200 * <p> 213 201 * TEST #4: Force tagging (parameter forceTags=true, no change of configuration). All images will be tagged 214 202 * i5-i6 will now be interpolated, therefore it will have an elevation and different coordinates than in tests above … … 236 224 /** 237 225 * Tests matching of images to a GPX track. 238 * 226 * <p> 239 227 * TEST #5: Force tagging (parameter forceTags=false, but configuration changed). 240 228 * Results same as #4 … … 273 261 /** 274 262 * Tests matching of images to a GPX track. 275 * 263 * <p> 276 264 * TEST #6: Disable tagging but allow interpolation when tracks are less than 500m apart. i0-i4 are tagged. 277 265 * i5-i6 will not be tagged, because the tracks are 897m apart. … … 293 281 /** 294 282 * Tests matching of images to a GPX track. 295 * 283 * <p> 296 284 * TEST #7: Disable tagging but allow interpolation when tracks are less than 1000m apart. i0-i6 are tagged. 297 285 * i5-i6 will be tagged, because the tracks are 897m apart. … … 312 300 /** 313 301 * Tests matching of images to a GPX track. 314 * 302 * <p> 315 303 * TEST #8: Disable tagging but allow interpolation when tracks are less than 2 min apart. i0-i4 are tagged. 316 304 * i5-i6 will not be tagged, because the tracks are 2.5min apart. … … 331 319 /** 332 320 * Tests matching of images to a GPX track. 333 * 321 * <p> 334 322 * TEST #9: Disable tagging but allow interpolation when tracks are less than 3 min apart. i0-i6 are tagged. 335 323 * i5-i6 will be tagged, because the tracks are 2.5min apart. -
trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxImageEntryTest.java
r17275 r18853 4 4 import java.io.File; 5 5 6 import org.junit.jupiter.api.extension.RegisterExtension;7 6 import org.junit.jupiter.api.Test; 8 7 import org.openstreetmap.josm.TestUtils; 9 import org.openstreetmap.josm.testutils.JOSMTestRules;10 8 11 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;12 9 import nl.jqno.equalsverifier.EqualsVerifier; 13 10 import nl.jqno.equalsverifier.Warning; … … 17 14 */ 18 15 class GpxImageEntryTest { 19 20 /**21 * Setup test.22 */23 @RegisterExtension24 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")25 public JOSMTestRules test = new JOSMTestRules();26 27 16 /** 28 17 * Unit test of methods {@link GpxImageEntry#equals} and {@link GpxImageEntry#hashCode}. -
trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxOffsetTest.java
r17275 r18853 6 6 import java.text.ParseException; 7 7 8 import org.junit.jupiter.api.BeforeAll;9 8 import org.junit.jupiter.api.Test; 10 import org.junit.jupiter.api.extension.RegisterExtension; 11 import org.openstreetmap.josm.testutils.JOSMTestRules; 12 import org.openstreetmap.josm.tools.date.DateUtils; 13 import org.openstreetmap.josm.tools.date.DateUtilsTest; 14 15 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 9 import org.openstreetmap.josm.testutils.annotations.Timezone; 16 10 17 11 /** 18 12 * Unit tests of {@link GpxTimeOffset} class. 19 13 */ 14 @Timezone 20 15 class GpxOffsetTest { 21 22 /**23 * Setup test.24 */25 @RegisterExtension26 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")27 public JOSMTestRules test = new JOSMTestRules();28 29 /**30 * Setup test.31 */32 @BeforeAll33 public static void setUp() {34 DateUtilsTest.setTimeZone(DateUtils.UTC);35 }36 37 16 /** 38 17 * Unit test of {@link GpxTimeOffset#formatOffset}. -
trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxRouteTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.data.gpx; 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 6 import org.openstreetmap.josm.data.coor.LatLon; 8 import org.openstreetmap.josm.testutils.JOSMTestRules;9 7 10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;11 8 import nl.jqno.equalsverifier.EqualsVerifier; 12 9 import nl.jqno.equalsverifier.Warning; … … 16 13 */ 17 14 class GpxRouteTest { 18 19 /**20 * Setup test.21 */22 @RegisterExtension23 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")24 public JOSMTestRules test = new JOSMTestRules();25 26 15 /** 27 16 * Unit test of methods {@link GpxRoute#equals} and {@link GpxRoute#hashCode}. -
trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxTimezoneTest.java
r17275 r18853 6 6 import java.text.ParseException; 7 7 8 import org.junit.jupiter.api.BeforeAll;9 8 import org.junit.jupiter.api.Test; 10 import org.junit.jupiter.api.extension.RegisterExtension; 11 import org.openstreetmap.josm.testutils.JOSMTestRules; 12 import org.openstreetmap.josm.tools.date.DateUtils; 13 import org.openstreetmap.josm.tools.date.DateUtilsTest; 14 15 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 9 import org.openstreetmap.josm.testutils.annotations.Timezone; 16 10 17 11 /** 18 12 * Unit tests of {@link GpxTimezone} class. 19 13 */ 14 @Timezone 20 15 class GpxTimezoneTest { 21 22 /**23 * Setup test.24 */25 @RegisterExtension26 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")27 public JOSMTestRules test = new JOSMTestRules();28 29 /**30 * Setup test.31 */32 @BeforeAll33 public static void setUp() {34 DateUtilsTest.setTimeZone(DateUtils.UTC);35 }36 37 16 /** 38 17 * Unit test of {@link GpxTimezone#formatTimezone}. -
trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxTrackSegmentTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.data.gpx; 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 6 import org.openstreetmap.josm.data.coor.LatLon; 8 import org.openstreetmap.josm.testutils.JOSMTestRules;9 7 10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;11 8 import nl.jqno.equalsverifier.EqualsVerifier; 12 9 import nl.jqno.equalsverifier.Warning; … … 16 13 */ 17 14 class GpxTrackSegmentTest { 18 19 /**20 * Setup test.21 */22 @RegisterExtension23 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")24 public JOSMTestRules test = new JOSMTestRules();25 26 15 /** 27 16 * Unit test of methods {@link GpxTrackSegment#equals} and {@link GpxTrackSegment#hashCode}. -
trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxTrackTest.java
r18287 r18853 10 10 11 11 import org.junit.jupiter.api.Test; 12 import org.junit.jupiter.api.extension.RegisterExtension;13 12 import org.openstreetmap.josm.TestUtils; 14 import org.openstreetmap.josm.testutils.JOSMTestRules;15 13 import org.openstreetmap.josm.tools.ListenerList; 16 14 17 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;18 15 import nl.jqno.equalsverifier.EqualsVerifier; 19 16 import nl.jqno.equalsverifier.Warning; … … 23 20 */ 24 21 class GpxTrackTest { 25 26 /**27 * Setup test.28 */29 @RegisterExtension30 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")31 public JOSMTestRules test = new JOSMTestRules();32 33 22 /** 34 23 * Tests whether the track can read and write colors. -
trunk/test/unit/org/openstreetmap/josm/data/gpx/WayPointTest.java
r17715 r18853 2 2 package org.openstreetmap.josm.data.gpx; 3 3 4 import org.junit.jupiter.api.extension.RegisterExtension; 4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 import static org.junit.jupiter.api.Assertions.assertNotEquals; 6 7 import java.time.Instant; 8 5 9 import org.junit.jupiter.api.Test; 6 10 import org.openstreetmap.josm.TestUtils; 7 11 import org.openstreetmap.josm.data.coor.LatLon; 8 import org.openstreetmap.josm.testutils.JOSMTestRules;9 12 10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;11 13 import nl.jqno.equalsverifier.EqualsVerifier; 12 14 import nl.jqno.equalsverifier.Warning; 13 14 import java.time.Instant;15 16 import static org.junit.jupiter.api.Assertions.assertEquals;17 import static org.junit.jupiter.api.Assertions.assertNotEquals;18 15 19 16 /** … … 21 18 */ 22 19 class WayPointTest { 23 24 /**25 * Setup test.26 */27 @RegisterExtension28 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")29 public JOSMTestRules test = new JOSMTestRules();30 31 20 /** 32 21 * Unit test of methods {@link WayPoint#equals} and {@link WayPoint#hashCode}. -
trunk/test/unit/org/openstreetmap/josm/data/gpx/WithAttributesTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.data.gpx; 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;8 6 9 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;10 7 import nl.jqno.equalsverifier.EqualsVerifier; 11 8 import nl.jqno.equalsverifier.Warning; … … 15 12 */ 16 13 class WithAttributesTest { 17 18 /**19 * Setup test.20 */21 @RegisterExtension22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")23 public JOSMTestRules test = new JOSMTestRules();24 25 14 /** 26 15 * Unit test of methods {@link WithAttributes#equals} and {@link WithAttributes#hashCode}. -
trunk/test/unit/org/openstreetmap/josm/data/imagery/GetCapabilitiesParseHelperTest.java
r17275 r18853 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 7 10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;11 8 import net.trajano.commons.testing.UtilityClassTestUtil; 12 9 … … 15 12 */ 16 13 class GetCapabilitiesParseHelperTest { 17 18 /**19 * Setup tests20 */21 @RegisterExtension22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")23 public JOSMTestRules test = new JOSMTestRules();24 25 14 /** 26 15 * Tests that {@code GetCapabilitiesParseHelper} satisfies utility class criteria. -
trunk/test/unit/org/openstreetmap/josm/data/imagery/ImageryInfoTest.java
r17275 r18853 11 11 12 12 import org.junit.jupiter.api.Test; 13 import org.junit.jupiter.api.extension.RegisterExtension;14 13 import org.openstreetmap.josm.data.StructUtils; 15 import org.openstreetmap.josm.testutils.JOSMTestRules;16 14 import org.openstreetmap.josm.tools.MultiMap; 17 18 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;19 15 20 16 /** … … 24 20 */ 25 21 class ImageryInfoTest { 26 27 /**28 * Setup tests29 */30 @RegisterExtension31 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")32 public JOSMTestRules test = new JOSMTestRules();33 34 22 /** 35 23 * Test if extended URL is returned properly -
trunk/test/unit/org/openstreetmap/josm/data/imagery/vectortile/mapbox/MVTTileTest.java
r17862 r18853 9 9 import java.util.stream.Stream; 10 10 11 import org.awaitility.Awaitility; 12 import org.awaitility.Durations; 13 import org.junit.jupiter.api.BeforeEach; 14 import org.junit.jupiter.params.ParameterizedTest; 15 import org.junit.jupiter.params.provider.Arguments; 16 import org.junit.jupiter.params.provider.MethodSource; 11 17 import org.openstreetmap.gui.jmapviewer.Tile; 12 18 import org.openstreetmap.gui.jmapviewer.interfaces.TileJob; … … 15 21 import org.openstreetmap.josm.data.imagery.ImageryInfo; 16 22 import org.openstreetmap.josm.data.imagery.TileJobOptions; 17 import org.openstreetmap.josm.testutils.JOSMTestRules;18 19 import org.awaitility.Awaitility;20 import org.awaitility.Durations;21 import org.junit.jupiter.api.BeforeEach;22 import org.junit.jupiter.api.extension.RegisterExtension;23 import org.junit.jupiter.params.ParameterizedTest;24 import org.junit.jupiter.params.provider.Arguments;25 import org.junit.jupiter.params.provider.MethodSource;26 23 27 24 /** 28 25 * Test class for {@link MVTTile} 29 26 */ 30 publicclass MVTTileTest {27 class MVTTileTest { 31 28 private MapboxVectorTileSource tileSource; 32 29 private MapboxVectorCachedTileLoader loader; 33 @RegisterExtension34 JOSMTestRules rule = new JOSMTestRules();35 30 @BeforeEach 36 31 void setup() { -
trunk/test/unit/org/openstreetmap/josm/data/notes/NoteCommentTest.java
r17712 r18853 8 8 import java.time.Instant; 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 /** … … 18 14 */ 19 15 class NoteCommentTest { 20 21 /**22 * Setup test.23 */24 @RegisterExtension25 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")26 public JOSMTestRules test = new JOSMTestRules();27 28 16 /** 29 17 * Unit test of {@link NoteComment} class. -
trunk/test/unit/org/openstreetmap/josm/data/notes/NoteTest.java
r17837 r18853 8 8 import java.util.List; 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.coor.LatLon; 14 13 import org.openstreetmap.josm.io.NoteReader; 15 import org.openstreetmap.josm.testutils.JOSMTestRules;16 14 17 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;18 15 import nl.jqno.equalsverifier.EqualsVerifier; 19 16 import nl.jqno.equalsverifier.Warning; … … 23 20 */ 24 21 class NoteTest { 25 26 /**27 * Setup test.28 */29 @RegisterExtension30 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")31 public JOSMTestRules test = new JOSMTestRules();32 33 22 /** 34 23 * Unit test of {@link Note#toString} method. -
trunk/test/unit/org/openstreetmap/josm/data/oauth/OAuthParametersTest.java
r17275 r18853 6 6 import static org.junit.jupiter.api.Assertions.assertNotNull; 7 7 8 import org.junit.jupiter.api.extension.RegisterExtension;9 8 import org.junit.jupiter.api.Test; 10 9 import org.openstreetmap.josm.TestUtils; 11 10 import org.openstreetmap.josm.spi.preferences.Config; 12 import org.openstreetmap.josm.testutils.JOSMTestRules;13 11 import org.openstreetmap.josm.tools.Logging; 14 12 … … 20 18 */ 21 19 class OAuthParametersTest { 22 23 /**24 * Setup test.25 */26 @RegisterExtension27 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")28 public JOSMTestRules test = new JOSMTestRules();29 30 20 /** 31 21 * Unit test of method {@link OAuthParameters#createDefault}. -
trunk/test/unit/org/openstreetmap/josm/data/osm/AbstractPrimitiveTest.java
r17275 r18853 7 7 import java.util.Collections; 8 8 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;14 10 15 11 /** … … 17 13 */ 18 14 class AbstractPrimitiveTest { 19 20 /**21 * Setup test.22 */23 @RegisterExtension24 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")25 public JOSMTestRules test = new JOSMTestRules();26 27 15 /** 28 16 * Unit test of {@link AbstractPrimitive#isUndeleted} method. -
trunk/test/unit/org/openstreetmap/josm/data/osm/BBoxTest.java
r17752 r18853 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.TestUtils; 12 11 import org.openstreetmap.josm.data.coor.LatLon; 13 import org.openstreetmap.josm.testutils.JOSMTestRules;14 12 15 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;16 13 import nl.jqno.equalsverifier.EqualsVerifier; 17 14 import nl.jqno.equalsverifier.Warning; … … 21 18 */ 22 19 class BBoxTest { 23 24 /**25 * Setup test.26 */27 @RegisterExtension28 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")29 public JOSMTestRules test = new JOSMTestRules();30 31 20 /** 32 21 * Unit test of methods {@link BBox#equals} and {@link BBox#hashCode}. -
trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetCacheTest.java
r18283 r18853 16 16 import org.junit.jupiter.api.BeforeEach; 17 17 import org.junit.jupiter.api.Test; 18 import org.junit.jupiter.api.extension.RegisterExtension;19 18 import org.openstreetmap.josm.data.UserIdentityManager; 20 import org.openstreetmap.josm.testutils.JOSMTestRules;21 19 import org.openstreetmap.josm.testutils.annotations.BasicPreferences; 22 20 import org.openstreetmap.josm.tools.Logging; 23 24 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;25 21 26 22 /** … … 29 25 @BasicPreferences 30 26 class ChangesetCacheTest { 31 32 /**33 * Setup test.34 */35 @RegisterExtension36 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")37 public JOSMTestRules test = new JOSMTestRules();38 39 27 private static final ChangesetCache cache = ChangesetCache.getInstance(); 40 28 … … 49 37 } 50 38 51 abstract class TestListener implements ChangesetCacheListener {39 abstract static class TestListener implements ChangesetCacheListener { 52 40 53 41 protected final CountDownLatch latch = new CountDownLatch(1); … … 72 60 73 61 /** 74 * Unit test of {@link ChangesetCache# ChangesetCache}62 * Unit test of {@link ChangesetCache#getInstance()} 75 63 */ 76 64 @Test -
trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetDataSetTest.java
r17838 r18853 10 10 import java.util.Iterator; 11 11 12 import org.junit.jupiter.api.extension.RegisterExtension;13 12 import org.junit.jupiter.api.Test; 14 13 import org.openstreetmap.josm.TestUtils; … … 17 16 import org.openstreetmap.josm.data.osm.ChangesetDataSet.ChangesetModificationType; 18 17 import org.openstreetmap.josm.data.osm.history.HistoryNode; 19 import org.openstreetmap.josm.testutils.JOSMTestRules;20 18 import org.openstreetmap.josm.tools.Logging; 21 22 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;23 19 24 20 /** … … 26 22 */ 27 23 class ChangesetDataSetTest { 28 29 /**30 * Setup test.31 */32 @RegisterExtension33 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")34 public JOSMTestRules test = new JOSMTestRules();35 36 24 /** 37 25 * Unit test of method {@link ChangesetDataSet#iterator}. -
trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetDiscussionCommentTest.java
r17720 r18853 6 6 import java.time.Instant; 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;13 9 14 10 /** … … 16 12 */ 17 13 class ChangesetDiscussionCommentTest { 18 19 /**20 * Setup test.21 */22 @RegisterExtension23 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")24 public JOSMTestRules test = new JOSMTestRules();25 26 14 /** 27 15 * Unit test of {@link ChangesetDiscussionComment} constructor. -
trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetTest.java
r18690 r18853 17 17 import java.util.stream.IntStream; 18 18 19 import org.junit.jupiter.api.extension.RegisterExtension;20 19 import org.junit.jupiter.api.Test; 21 20 import org.openstreetmap.josm.data.Bounds; 22 21 import org.openstreetmap.josm.data.coor.LatLon; 23 import org.openstreetmap.josm.testutils.JOSMTestRules;24 22 import org.openstreetmap.josm.tools.Logging; 25 23 … … 30 28 */ 31 29 class ChangesetTest { 32 33 /**34 * Setup test.35 */36 @RegisterExtension37 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")38 public JOSMTestRules test = new JOSMTestRules();39 40 30 /** 41 31 * Unit test of method {@link Changeset#setKeys}. -
trunk/test/unit/org/openstreetmap/josm/data/osm/DataIntegrityProblemExceptionTest.java
r17275 r18853 5 5 import static org.junit.jupiter.api.Assertions.assertNull; 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;12 8 13 9 /** … … 15 11 */ 16 12 class DataIntegrityProblemExceptionTest { 17 18 /**19 * Setup test.20 */21 @RegisterExtension22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")23 public JOSMTestRules test = new JOSMTestRules();24 25 13 /** 26 14 * Unit test of {@link DataIntegrityProblemException} constructor. -
trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetMergerTest.java
r18690 r18853 18 18 import org.junit.jupiter.api.BeforeEach; 19 19 import org.junit.jupiter.api.Test; 20 import org.junit.jupiter.api.extension.RegisterExtension;21 20 import org.openstreetmap.josm.data.coor.LatLon; 22 21 import org.openstreetmap.josm.data.projection.ProjectionRegistry; 23 22 import org.openstreetmap.josm.data.projection.Projections; 24 23 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 25 import org.openstreetmap.josm.testutils.JOSMTestRules;26 27 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;28 24 29 25 /** … … 31 27 */ 32 28 class DataSetMergerTest { 33 34 /**35 * Setup test.36 */37 @RegisterExtension38 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")39 public JOSMTestRules test = new JOSMTestRules();40 41 29 private DataSet my; 42 30 private DataSet their; … … 76 64 /** 77 65 * two identical nodes, even in id and version. No conflict expected. 78 * 66 * <p> 79 67 * Can happen if data is loaded in two layers and then merged from one layer 80 68 * on the other. … … 150 138 * Node with same id, my is modified, their has a higher version 151 139 * => results in a conflict 152 * 140 * <p> 153 141 * Use case: node which is modified locally and updated by another mapper on 154 142 * the server … … 184 172 * node with same id, my is deleted, their has a higher version 185 173 * => results in a conflict 186 * 174 * <p> 187 175 * Use case: node which is deleted locally and updated by another mapper on 188 176 * the server … … 243 231 /** 244 232 * My and their node are new but semantically equal. My node is deleted. 245 * 233 * <p> 246 234 * => Ignore my node, no conflict 247 235 */ … … 266 254 /** 267 255 * My and their node are new but semantically equal. Both are deleted. 268 * 256 * <p> 269 257 * => take mine 270 258 */ … … 291 279 * their node has no assigned id (id == 0) and is semantically equal to one of my 292 280 * nodes with id == 0 293 * 281 * <p> 294 282 * => merge it onto my node. 295 283 */ … … 331 319 /** 332 320 * my node is incomplete, their node is complete 333 * 321 * <p> 334 322 * => merge it onto my node. My node becomes complete 335 323 */ … … 361 349 * their way has a higher version and different tags. the nodes are the same. My 362 350 * way is not modified. Merge is possible. No conflict. 363 * 351 * <p> 364 352 * => merge it onto my way. 365 353 */ … … 433 421 * their way has a higher version and different tags. And it has more nodes. Two 434 422 * of the existing nodes are modified. 435 * 423 * <p> 436 424 * => merge it onto my way, no conflict 437 425 */ … … 494 482 495 483 assertSame(merged.getNode(0), n1); 496 assertNotSame(merged.getNode(1), n5); // must be clone of the original node in their484 assertNotSame(merged.getNode(1), n5); // must be a clone of the original node in their 497 485 assertSame(merged.getNode(2), n2); 498 486 … … 502 490 /** 503 491 * their way has a higher version and different nodes. My way is modified. 504 * 492 * <p> 505 493 * => merge onto my way not possible, create a conflict 506 494 */ … … 566 554 /** 567 555 * their way is not visible anymore. 568 * 556 * <p> 569 557 * => conflict 570 558 */ … … 719 707 * My dataset includes a deleted node. 720 708 * Their dataset includes a way with three nodes, the first one being my node. 721 * 709 * <p> 722 710 * => the merged way should include all three nodes. Deleted node should have deleted=false and 723 711 * special conflict with isDeleted should exist … … 773 761 * My dataset includes a deleted node. 774 762 * Their dataset includes a relation with three nodes, the first one being my node. 775 * 763 * <p> 776 764 * => the merged relation should include all three nodes. There should be conflict for deleted 777 765 * node with isMyDeleted set … … 823 811 /** 824 812 * Merge an incomplete way with two incomplete nodes into an empty dataset. 825 * 813 * <p> 826 814 * Use case: a way loaded with a multiget, i.e. GET /api/0.6/ways?ids=123456 827 815 */ … … 865 853 /** 866 854 * Merge an incomplete way with two incomplete nodes into a dataset where the way already exists as complete way. 867 * 868 * Use case: a way loaded with a multiget, i.e. GET /api/0.6/ways?ids=123456 after a "Update selection " of this way855 * <p> 856 * Use case: a way loaded with a multiget, i.e. GET /api/0.6/ways?ids=123456 after an "Update selection " of this way 869 857 */ 870 858 @Test … … 928 916 // -- source dataset 929 917 930 // a ncomplete node918 // a complete node 931 919 Node n1 = new Node(1, 1); 932 920 n1.setCoor(new LatLon(1, 1)); … … 992 980 993 981 // --- target dataset 994 // a ncomplete node982 // a complete node 995 983 Node n1b = new Node(1, 2); 996 984 n1b.setCoor(new LatLon(1, 1)); … … 1098 1086 1099 1087 /** 1100 * Dependency loop in relations, ,both deleted in source1088 * Dependency loop in relations, both deleted in source 1101 1089 * => make sure that DataIntegrityProblemException is thrown. 1102 1090 */ -
trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetTest.java
r18690 r18853 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.Bounds; … … 21 20 import org.openstreetmap.josm.data.osm.event.DataSourceAddedEvent; 22 21 import org.openstreetmap.josm.data.osm.event.DataSourceRemovedEvent; 23 import org.openstreetmap.josm.testutils.JOSMTestRules;24 25 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;26 22 27 23 /** … … 29 25 */ 30 26 class DataSetTest { 31 32 /**33 * Setup test.34 */35 @RegisterExtension36 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")37 public JOSMTestRules test = new JOSMTestRules();38 39 27 /** 40 28 * Unit test of method {@link DataSet#searchRelations}. -
trunk/test/unit/org/openstreetmap/josm/data/osm/FilterTest.java
r18690 r18853 16 16 import java.util.List; 17 17 18 import org.junit.jupiter.api.extension.RegisterExtension;19 18 import org.junit.jupiter.api.Test; 20 19 import org.openstreetmap.josm.TestUtils; … … 25 24 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 26 25 import org.openstreetmap.josm.io.OsmReader; 27 import org.openstreetmap.josm.testutils.JOSMTestRules; 28 29 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 26 30 27 import nl.jqno.equalsverifier.EqualsVerifier; 31 28 import nl.jqno.equalsverifier.Warning; … … 35 32 */ 36 33 class FilterTest { 37 38 /**39 * Setup test.40 */41 @RegisterExtension42 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")43 public JOSMTestRules test = new JOSMTestRules();44 45 34 @Test 46 35 void testBasic() throws SearchParseError { -
trunk/test/unit/org/openstreetmap/josm/data/osm/NodeGraphTest.java
r17275 r18853 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 import org.openstreetmap.josm.testutils.JOSMTestRules;14 15 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;16 12 17 13 /** … … 19 15 */ 20 16 class NodeGraphTest { 21 22 /**23 * Setup test.24 */25 @RegisterExtension26 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")27 public JOSMTestRules test = new JOSMTestRules();28 29 17 /** 30 18 * Unit test of {@link NodeGraph#buildNodePairs} and {@link NodeGraph#eliminateDuplicateNodePairs} -
trunk/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveKeyHandlingTest.java
r18690 r18853 7 7 import static org.junit.jupiter.api.Assertions.assertTrue; 8 8 9 import org.junit.jupiter.api.extension.RegisterExtension; 9 import java.util.Collections; 10 import java.util.HashSet; 11 10 12 import org.junit.jupiter.api.Test; 11 13 import org.openstreetmap.josm.data.coor.LatLon; 12 import org.openstreetmap.josm.testutils.JOSMTestRules;13 14 14 15 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 15 16 import java.util.Collections;17 import java.util.HashSet;18 16 19 17 /** … … 22 20 */ 23 21 class OsmPrimitiveKeyHandlingTest { 24 25 /**26 * Setup test.27 */28 @RegisterExtension29 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")30 public JOSMTestRules test = new JOSMTestRules();31 32 22 /** 33 23 * test query and get methods on a node withouth keys -
trunk/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveTest.java
r18690 r18853 10 10 import org.junit.jupiter.api.BeforeAll; 11 11 import org.junit.jupiter.api.Test; 12 import org.junit.jupiter.api.extension.RegisterExtension;13 12 import org.openstreetmap.josm.data.coor.LatLon; 14 13 import org.openstreetmap.josm.data.projection.ProjectionRegistry; 15 14 import org.openstreetmap.josm.data.projection.Projections; 16 import org.openstreetmap.josm.testutils.JOSMTestRules;17 18 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;19 15 20 16 /** … … 22 18 */ 23 19 class OsmPrimitiveTest { 24 25 /**26 * Setup test.27 */28 @RegisterExtension29 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")30 public JOSMTestRules test = new JOSMTestRules();31 32 20 private void compareReferrers(OsmPrimitive actual, OsmPrimitive... expected) { 33 21 assertEquals(new HashSet<>(Arrays.asList(expected)), new HashSet<>(actual.getReferrers())); -
trunk/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveTypeTest.java
r18690 r18853 6 6 import static org.junit.jupiter.api.Assertions.assertNull; 7 7 import static org.junit.jupiter.api.Assertions.assertSame; 8 import static org.junit.jupiter.api.Assertions.assertThrows; 8 9 import static org.junit.jupiter.api.Assertions.assertTrue; 9 import static org.junit.jupiter.api.Assertions.assertThrows;10 10 11 11 import java.util.Collection; 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 import org.openstreetmap.josm.testutils.JOSMTestRules;17 18 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;19 15 20 16 /** … … 22 18 */ 23 19 class OsmPrimitiveTypeTest { 24 25 /**26 * Setup test.27 */28 @RegisterExtension29 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")30 public JOSMTestRules test = new JOSMTestRules();31 32 20 /** 33 21 * Unit test of {@link OsmPrimitiveType} enum. -
trunk/test/unit/org/openstreetmap/josm/data/osm/OsmUtilsTest.java
r18690 r18853 6 6 import static org.junit.jupiter.api.Assertions.assertInstanceOf; 7 7 import static org.junit.jupiter.api.Assertions.assertNull; 8 import static org.junit.jupiter.api.Assertions.assertThrows; 8 9 import static org.junit.jupiter.api.Assertions.assertTrue; 9 import static org.junit.jupiter.api.Assertions.assertThrows;10 10 11 11 import java.util.Arrays; … … 13 13 14 14 import org.junit.jupiter.api.Test; 15 import org.junit.jupiter.api.extension.RegisterExtension;16 import org.openstreetmap.josm.testutils.JOSMTestRules;17 18 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;19 15 20 16 /** … … 22 18 */ 23 19 class OsmUtilsTest { 24 25 /**26 * Setup test.27 */28 @RegisterExtension29 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")30 public JOSMTestRules test = new JOSMTestRules();31 32 20 /** 33 21 * Unit test of {@link OsmUtils#createPrimitive} -
trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java
r18690 r18853 19 19 import java.util.Random; 20 20 21 import org.junit.jupiter.api.extension.RegisterExtension;22 21 import org.junit.jupiter.api.Test; 23 22 import org.openstreetmap.josm.data.coor.LatLon; … … 26 25 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 27 26 import org.openstreetmap.josm.io.OsmReader; 28 import org.openstreetmap.josm.testutils.JOSMTestRules;29 30 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;31 27 32 28 /** … … 34 30 */ 35 31 class QuadBucketsTest { 36 37 /**38 * Setup test.39 */40 @RegisterExtension41 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")42 public JOSMTestRules test = new JOSMTestRules();43 44 32 @SuppressWarnings("unchecked") 45 33 private void removeAllTest(DataSet ds) throws ReflectiveOperationException { -
trunk/test/unit/org/openstreetmap/josm/data/osm/RelationTest.java
r18690 r18853 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.assertThrows; 6 7 import static org.junit.jupiter.api.Assertions.assertTrue; 7 import static org.junit.jupiter.api.Assertions.assertThrows;8 8 9 9 import org.junit.jupiter.api.Test; 10 import org.junit.jupiter.api.extension.RegisterExtension;11 10 import org.openstreetmap.josm.data.coor.LatLon; 12 import org.openstreetmap.josm.testutils.JOSMTestRules;13 14 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;15 11 16 12 class RelationTest { 17 18 /**19 * Setup test.20 */21 @RegisterExtension22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")23 public JOSMTestRules test = new JOSMTestRules();24 25 13 @Test 26 14 void testCreateNewRelation() { -
trunk/test/unit/org/openstreetmap/josm/data/osm/StorageTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.data.osm; 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;8 6 9 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;10 7 import nl.jqno.equalsverifier.EqualsVerifier; 11 8 import nl.jqno.equalsverifier.Warning; … … 15 12 */ 16 13 class StorageTest { 17 18 /**19 * Setup test.20 */21 @RegisterExtension22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")23 public JOSMTestRules test = new JOSMTestRules();24 25 14 /** 26 15 * Unit test of methods {@link Storage#equals} and {@link Storage#hashCode}. -
trunk/test/unit/org/openstreetmap/josm/data/osm/UserTest.java
r17275 r18853 6 6 import static org.junit.jupiter.api.Assertions.assertTrue; 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;13 9 14 10 /** … … 16 12 */ 17 13 class UserTest { 18 19 /**20 * Setup test21 */22 @RegisterExtension23 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")24 public JOSMTestRules test = new JOSMTestRules();25 26 14 /** 27 15 * Test method for {@link User#createOsmUser}. -
trunk/test/unit/org/openstreetmap/josm/data/osm/WaySegmentTest.java
r18690 r18853 7 7 import java.util.Arrays; 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.coor.LatLon; 12 import org.openstreetmap.josm.testutils.JOSMTestRules;13 14 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;15 11 16 12 /** … … 18 14 */ 19 15 class WaySegmentTest { 20 21 /**22 * Setup test.23 */24 @RegisterExtension25 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")26 public JOSMTestRules test = new JOSMTestRules();27 28 16 @Test 29 17 void testForNodePair() { -
trunk/test/unit/org/openstreetmap/josm/data/osm/WayTest.java
r18553 r18853 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.assertThrows; 6 7 import static org.junit.jupiter.api.Assertions.assertTrue; 7 import static org.junit.jupiter.api.Assertions.assertThrows;8 8 9 9 import java.util.Arrays; … … 11 11 import java.util.HashSet; 12 12 13 import org.junit.jupiter.api.BeforeAll;14 13 import org.junit.jupiter.api.Test; 15 import org.openstreetmap.josm.JOSMFixture;16 14 import org.openstreetmap.josm.data.coor.LatLon; 17 15 … … 21 19 */ 22 20 class WayTest { 23 24 /**25 * Setup test.26 */27 @BeforeAll28 public static void setUpBeforeClass() {29 JOSMFixture.createUnitTestFixture().init();30 }31 32 21 /** 33 22 * Test BBox calculation with Way -
trunk/test/unit/org/openstreetmap/josm/data/osm/event/ChangesetIdChangedEventTest.java
r17275 r18853 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 /** … … 14 10 */ 15 11 class ChangesetIdChangedEventTest { 16 17 /**18 * Setup test.19 */20 @RegisterExtension21 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")22 public JOSMTestRules test = new JOSMTestRules();23 24 12 /** 25 13 * Unit test of {@link ChangesetIdChangedEvent#toString}. -
trunk/test/unit/org/openstreetmap/josm/data/osm/event/DataChangedEventTest.java
r17275 r18853 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 /** … … 14 10 */ 15 11 class DataChangedEventTest { 16 17 /**18 * Setup test.19 */20 @RegisterExtension21 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")22 public JOSMTestRules test = new JOSMTestRules();23 24 12 /** 25 13 * Unit test of {@link DataChangedEvent#toString}. -
trunk/test/unit/org/openstreetmap/josm/data/osm/event/NodeMovedEventTest.java
r17275 r18853 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 /** … … 14 10 */ 15 11 class NodeMovedEventTest { 16 17 /**18 * Setup test.19 */20 @RegisterExtension21 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")22 public JOSMTestRules test = new JOSMTestRules();23 24 12 /** 25 13 * Unit test of {@link NodeMovedEvent#toString}. -
trunk/test/unit/org/openstreetmap/josm/data/osm/event/PrimitiveFlagsChangedEventTest.java
r17275 r18853 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 /** … … 14 10 */ 15 11 class PrimitiveFlagsChangedEventTest { 16 17 /**18 * Setup test.19 */20 @RegisterExtension21 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")22 public JOSMTestRules test = new JOSMTestRules();23 24 12 /** 25 13 * Unit test of {@link PrimitiveFlagsChangedEvent#toString}. -
trunk/test/unit/org/openstreetmap/josm/data/osm/event/PrimitivesAddedEventTest.java
r17275 r18853 6 6 import java.util.Collections; 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;13 9 14 10 /** … … 16 12 */ 17 13 class PrimitivesAddedEventTest { 18 19 /**20 * Setup test.21 */22 @RegisterExtension23 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")24 public JOSMTestRules test = new JOSMTestRules();25 26 14 /** 27 15 * Unit test of {@link PrimitivesAddedEvent#toString}. -
trunk/test/unit/org/openstreetmap/josm/data/osm/event/PrimitivesRemovedEventTest.java
r17275 r18853 6 6 import java.util.Collections; 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;13 9 14 10 /** … … 16 12 */ 17 13 class PrimitivesRemovedEventTest { 18 19 /**20 * Setup test.21 */22 @RegisterExtension23 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")24 public JOSMTestRules test = new JOSMTestRules();25 26 14 /** 27 15 * Unit test of {@link PrimitivesRemovedEvent#toString}. -
trunk/test/unit/org/openstreetmap/josm/data/osm/event/RelationMembersChangedEventTest.java
r17275 r18853 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 /** … … 14 10 */ 15 11 class RelationMembersChangedEventTest { 16 17 /**18 * Setup test.19 */20 @RegisterExtension21 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")22 public JOSMTestRules test = new JOSMTestRules();23 24 12 /** 25 13 * Unit test of {@link RelationMembersChangedEvent#toString}. -
trunk/test/unit/org/openstreetmap/josm/data/osm/event/TagsChangedEventTest.java
r17275 r18853 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 /** … … 14 10 */ 15 11 class TagsChangedEventTest { 16 17 /**18 * Setup test.19 */20 @RegisterExtension21 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")22 public JOSMTestRules test = new JOSMTestRules();23 24 12 /** 25 13 * Unit test of {@link TagsChangedEvent#toString}. -
trunk/test/unit/org/openstreetmap/josm/data/osm/event/WayNodesChangedEventTest.java
r17275 r18853 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 /** … … 14 10 */ 15 11 class WayNodesChangedEventTest { 16 17 /**18 * Setup test.19 */20 @RegisterExtension21 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")22 public JOSMTestRules test = new JOSMTestRules();23 24 12 /** 25 13 * Unit test of {@link WayNodesChangedEvent#toString}. -
trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryNodeTest.java
r17838 r18853 9 9 import java.util.Map; 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.coor.LatLon; … … 16 15 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 17 16 import org.openstreetmap.josm.data.osm.User; 18 import org.openstreetmap.josm.testutils.JOSMTestRules;19 20 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;21 17 22 18 /** … … 24 20 */ 25 21 class HistoryNodeTest { 26 27 /**28 * Setup test.29 */30 @RegisterExtension31 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")32 public JOSMTestRules test = new JOSMTestRules();33 34 22 private static HistoryNode create(Instant d) { 35 23 return new HistoryNode( -
trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryRelationTest.java
r17838 r18853 9 9 import java.util.Map; 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.DefaultNameFormatter; … … 15 14 import org.openstreetmap.josm.data.osm.RelationMemberData; 16 15 import org.openstreetmap.josm.data.osm.User; 17 import org.openstreetmap.josm.testutils.JOSMTestRules;18 19 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;20 16 21 17 /** … … 23 19 */ 24 20 class HistoryRelationTest { 25 26 /**27 * Setup test.28 */29 @RegisterExtension30 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")31 public JOSMTestRules test = new JOSMTestRules();32 33 21 private static HistoryRelation create(Instant d) { 34 22 return new HistoryRelation( -
trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryWayTest.java
r18690 r18853 11 11 import java.util.Map; 12 12 13 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;14 13 import org.junit.jupiter.api.Test; 15 import org.junit.jupiter.api.extension.RegisterExtension;16 14 import org.openstreetmap.josm.data.osm.DefaultNameFormatter; 17 15 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 18 16 import org.openstreetmap.josm.data.osm.User; 19 import org.openstreetmap.josm.testutils.JOSMTestRules;20 17 21 18 /** … … 23 20 */ 24 21 class HistoryWayTest { 25 26 /**27 * Setup test.28 */29 @RegisterExtension30 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")31 public JOSMTestRules test = new JOSMTestRules();32 33 22 private static HistoryWay create(Instant d) { 34 23 return new HistoryWay( -
trunk/test/unit/org/openstreetmap/josm/data/osm/search/PushbackTokenizerTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.data.osm.search; 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 6 import org.openstreetmap.josm.data.osm.search.PushbackTokenizer.Token; 8 import org.openstreetmap.josm.testutils.JOSMTestRules;9 10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;11 7 12 8 /** … … 14 10 */ 15 11 class PushbackTokenizerTest { 16 17 /**18 * Setup rules.19 */20 @RegisterExtension21 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")22 public JOSMTestRules test = new JOSMTestRules();23 24 12 /** 25 13 * Unit test of {@link Token} enum. -
trunk/test/unit/org/openstreetmap/josm/data/osm/search/SearchModeTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.data.osm.search; 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;8 9 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;10 6 11 7 /** … … 13 9 */ 14 10 class SearchModeTest { 15 16 /**17 * Setup rules.18 */19 @RegisterExtension20 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")21 public JOSMTestRules test = new JOSMTestRules();22 23 11 /** 24 12 * Unit test of {@link SearchMode} enum. -
trunk/test/unit/org/openstreetmap/josm/data/osm/visitor/MergeSourceBuildingVisitorTest.java
r17275 r18853 9 9 import java.util.Collection; 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.coor.LatLon; … … 19 18 import org.openstreetmap.josm.data.osm.RelationMember; 20 19 import org.openstreetmap.josm.data.osm.Way; 21 import org.openstreetmap.josm.testutils.JOSMTestRules;22 23 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;24 20 25 21 /** … … 35 31 .findFirst().orElse(null); 36 32 } 37 38 /**39 * Setup test.40 */41 @RegisterExtension42 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")43 public JOSMTestRules test = new JOSMTestRules();44 33 45 34 @Test -
trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java
r18690 r18853 20 20 21 21 import org.junit.jupiter.api.Assumptions; 22 import org.junit.jupiter.api.BeforeAll;23 22 import org.junit.jupiter.api.Test; 24 23 import org.openstreetmap.josm.JOSMFixture; … … 32 31 /** 33 32 * This test is used to monitor changes in projection code. 34 * 33 * <p> 35 34 * It keeps a record of test data in the file nodist/data/projection/projection-regression-test-data. 36 35 * This record is generated from the current Projection classes available in JOSM. It needs to 37 36 * be updated, whenever a projection is added / removed or an algorithm is changed, such that 38 37 * the computed values are numerically different. There is no error threshold, every change is reported. 39 * 38 * <p> 40 39 * So when this test fails, first check if the change is intended. Then update the regression 41 40 * test data, by running the main method of this class and commit the new data file. … … 58 57 */ 59 58 public static void main(String[] args) throws IOException { 60 setUp();59 JOSMFixture.createUnitTestFixture().init(); 61 60 62 61 Map<String, Projection> supportedCodesMap = Projections.getAllProjectionCodes().stream() … … 136 135 137 136 /** 138 * Setup test.139 */140 @BeforeAll141 public static void setUp() {142 JOSMFixture.createUnitTestFixture().init();143 }144 145 /**146 137 * Non-regression unit test. 147 138 * @throws IOException if any I/O error occurs -
trunk/test/unit/org/openstreetmap/josm/data/projection/proj/LonLatTest.java
r17275 r18853 4 4 import static org.junit.jupiter.api.Assertions.assertFalse; 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 /** … … 14 10 */ 15 11 class LonLatTest { 16 /**17 * Setup rule.18 */19 @RegisterExtension20 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")21 public JOSMTestRules test = new JOSMTestRules();22 23 12 /** 24 13 * Test {@link LonLat#lonIsLinearToEast} -
trunk/test/unit/org/openstreetmap/josm/data/projection/proj/MercatorTest.java
r17275 r18853 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;11 7 12 8 /** … … 14 10 */ 15 11 class MercatorTest { 16 /**17 * Setup rule.18 */19 @RegisterExtension20 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")21 public JOSMTestRules test = new JOSMTestRules();22 23 12 /** 24 13 * Test {@link Mercator#lonIsLinearToEast} -
trunk/test/unit/org/openstreetmap/josm/data/tagging/ac/AutoCompletionPriorityTest.java
r17275 r18853 12 12 import java.util.TreeSet; 13 13 14 import org.junit.jupiter.api.extension.RegisterExtension;15 14 import org.junit.jupiter.api.Test; 16 15 import org.openstreetmap.josm.TestUtils; 17 import org.openstreetmap.josm.testutils.JOSMTestRules;18 16 19 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;20 17 import nl.jqno.equalsverifier.EqualsVerifier; 21 18 … … 24 21 */ 25 22 class AutoCompletionPriorityTest { 26 27 /**28 * Setup test.29 */30 @RegisterExtension31 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")32 public JOSMTestRules test = new JOSMTestRules();33 34 23 /** 35 24 * Test getters. -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/AddressesTest.java
r17275 r18853 11 11 import java.util.List; 12 12 13 import org.junit.jupiter.api.extension.RegisterExtension;14 13 import org.junit.jupiter.api.Test; 15 14 import org.openstreetmap.josm.TestUtils; … … 20 19 import org.openstreetmap.josm.data.validation.Severity; 21 20 import org.openstreetmap.josm.data.validation.TestError; 22 import org.openstreetmap.josm.testutils.JOSMTestRules;23 24 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;25 21 26 22 /** … … 28 24 */ 29 25 class AddressesTest { 30 31 /**32 * Setup test.33 */34 @RegisterExtension35 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")36 public JOSMTestRules test = new JOSMTestRules();37 38 26 private static Node createAddressNode(String nodeTags, String wayTags, String relationTags) { 39 27 DataSet ds = new DataSet(); -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/CoastlinesTest.java
r17275 r18853 4 4 import java.util.stream.Collectors; 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 /** … … 17 13 private static final Coastlines COASTLINES = new Coastlines(); 18 14 private static final WronglyOrderedWays WRONGLY_ORDERED_WAYS = new WronglyOrderedWays(); 19 20 /**21 * Setup test.22 */23 @RegisterExtension24 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")25 public JOSMTestRules test = new JOSMTestRules();26 15 27 16 /** -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/ConnectivityRelationsTest.java
r18690 r18853 6 6 import org.junit.jupiter.api.BeforeEach; 7 7 import org.junit.jupiter.api.Test; 8 import org.junit.jupiter.api.extension.RegisterExtension;9 8 import org.openstreetmap.josm.TestUtils; 10 9 import org.openstreetmap.josm.data.coor.LatLon; … … 12 11 import org.openstreetmap.josm.data.osm.Relation; 13 12 import org.openstreetmap.josm.data.osm.RelationMember; 14 import org.openstreetmap.josm.testutils.JOSMTestRules;15 16 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;17 13 18 14 /** … … 24 20 private ConnectivityRelations check; 25 21 private static final String CONNECTIVITY = "connectivity"; 26 27 /**28 * Setup test.29 */30 @RegisterExtension31 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")32 public JOSMTestRules rule = new JOSMTestRules();33 22 34 23 @BeforeEach -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/DirectionNodesTest.java
r18801 r18853 3 3 4 4 import org.junit.jupiter.api.Test; 5 import org.junit.jupiter.api.extension.RegisterExtension;6 5 import org.openstreetmap.josm.data.osm.DataSet; 7 import org.openstreetmap.josm.testutils.JOSMTestRules;8 9 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;10 6 11 7 /** … … 13 9 */ 14 10 class DirectionNodesTest { 15 16 /**17 * Setup test.18 */19 @RegisterExtension20 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")21 public JOSMTestRules test = new JOSMTestRules();22 23 11 /** 24 12 * Test all error cases manually created in direction-nodes.osm. -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/DuplicateNodeTest.java
r17665 r18853 9 9 import org.junit.jupiter.api.Disabled; 10 10 import org.junit.jupiter.api.Test; 11 import org.junit.jupiter.api.extension.RegisterExtension;12 11 import org.openstreetmap.josm.command.Command; 13 12 import org.openstreetmap.josm.data.coor.LatLon; … … 18 17 import org.openstreetmap.josm.data.validation.TestError; 19 18 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 20 import org.openstreetmap.josm.testutils.JOSMTestRules;21 22 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;23 19 24 20 /** … … 26 22 */ 27 23 class DuplicateNodeTest { 28 29 /**30 * Setup test by initializing JOSM preferences and projection.31 */32 @RegisterExtension33 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")34 public JOSMTestRules test = new JOSMTestRules();35 36 24 private static final DuplicateNode TEST = new DuplicateNode(); 37 25 … … 180 168 /** 181 169 * Test of "Duplicate node" validation test - server precision. 182 * 170 * <p> 183 171 * Non-regression test for ticket #18074. 184 172 */ -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/DuplicateWayTest.java
r17275 r18853 9 9 import java.nio.file.Paths; 10 10 11 import org.junit.jupiter.api.extension.RegisterExtension;12 11 import org.junit.jupiter.api.Test; 13 12 import org.openstreetmap.josm.TestUtils; … … 19 18 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 20 19 import org.openstreetmap.josm.io.OsmReader; 21 import org.openstreetmap.josm.testutils.JOSMTestRules;22 23 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;24 20 25 21 /** … … 27 23 */ 28 24 class DuplicateWayTest { 29 30 /**31 * Setup test by initializing JOSM preferences and projection.32 */33 @RegisterExtension34 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")35 public JOSMTestRules test = new JOSMTestRules();36 37 25 private static final DuplicateWay TEST = new DuplicateWay(); 38 26 -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/HighwaysTest.java
r17275 r18853 10 10 import java.util.Collection; 11 11 12 import org.junit.jupiter.api.BeforeEach;13 12 import org.junit.jupiter.api.Test; 14 import org.openstreetmap.josm.JOSMFixture;15 13 import org.openstreetmap.josm.TestUtils; 16 14 import org.openstreetmap.josm.data.coor.LatLon; … … 20 18 import org.openstreetmap.josm.data.validation.TestError; 21 19 import org.openstreetmap.josm.io.OsmReader; 20 import org.openstreetmap.josm.testutils.annotations.Projection; 22 21 23 22 /** 24 23 * Unit test of {@link HighwaysTest}. 25 24 */ 25 @Projection 26 26 class HighwaysTest { 27 28 /**29 * Setup test.30 */31 @BeforeEach32 public void setUp() {33 JOSMFixture.createUnitTestFixture().init();34 }35 36 27 private static Way createTestSetting(String highway, String highwayLink) { 37 28 DataSet ds = new DataSet(); -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/InternetTagsTest.java
r17275 r18853 10 10 import java.util.List; 11 11 12 import org.junit.jupiter.api.extension.RegisterExtension;13 12 import org.junit.jupiter.api.Test; 14 13 import org.openstreetmap.josm.TestUtils; … … 17 16 import org.openstreetmap.josm.data.validation.routines.EmailValidator; 18 17 import org.openstreetmap.josm.data.validation.routines.UrlValidator; 19 import org.openstreetmap.josm.testutils.JOSMTestRules;20 21 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;22 18 23 19 /** … … 27 23 28 24 private static final InternetTags TEST = new InternetTags(); 29 30 /**31 * Setup test by initializing JOSM preferences and projection.32 */33 @RegisterExtension34 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")35 public JOSMTestRules test = new JOSMTestRules();36 25 37 26 /** -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/LanesTest.java
r17275 r18853 7 7 import org.junit.jupiter.api.BeforeEach; 8 8 import org.junit.jupiter.api.Test; 9 import org.openstreetmap.josm.JOSMFixture;10 9 import org.openstreetmap.josm.data.osm.OsmUtils; 11 10 … … 23 22 @BeforeEach 24 23 public void setUp() throws Exception { 25 JOSMFixture.createUnitTestFixture().init();26 24 lanes.initialize(); 27 25 lanes.startTest(null); -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/LongSegmentTest.java
r17275 r18853 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 7 import org.openstreetmap.josm.data.coor.LatLon; 9 8 import org.openstreetmap.josm.data.osm.Node; 10 9 import org.openstreetmap.josm.data.osm.Way; 11 import org.openstreetmap.josm.testutils.JOSMTestRules;12 13 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;14 10 15 11 /** … … 17 13 */ 18 14 class LongSegmentTest { 19 20 /**21 * Setup test.22 */23 @RegisterExtension24 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")25 public JOSMTestRules test = new JOSMTestRules();26 27 15 private static int test(Way w) throws Exception { 28 16 LongSegment test = new LongSegment(); -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/NameMismatchTest.java
r17275 r18853 6 6 import java.util.List; 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.OsmUtils; 11 10 import org.openstreetmap.josm.data.validation.TestError; 12 import org.openstreetmap.josm.testutils.JOSMTestRules;13 14 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;15 11 16 12 /** … … 18 14 */ 19 15 class NameMismatchTest { 20 21 /**22 * Setup test.23 */24 @RegisterExtension25 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")26 public JOSMTestRules test = new JOSMTestRules();27 28 16 List<TestError> test(String primitive) { 29 17 final NameMismatch test = new NameMismatch(); -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/PublicTransportRouteTestTest.java
r17275 r18853 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.TestUtils; … … 14 13 import org.openstreetmap.josm.data.osm.RelationMember; 15 14 import org.openstreetmap.josm.data.osm.Way; 16 import org.openstreetmap.josm.testutils.JOSMTestRules;17 18 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;19 15 20 16 /** … … 24 20 25 21 final PublicTransportRouteTest test = new PublicTransportRouteTest(); 26 27 /**28 * Setup test.29 */30 @RegisterExtension31 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")32 public JOSMTestRules rules = new JOSMTestRules();33 22 34 23 /** -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/SelfIntersectingWayTest.java
r18801 r18853 11 11 import java.util.stream.IntStream; 12 12 13 import org.junit.jupiter.api.BeforeAll;14 13 import org.junit.jupiter.api.Test; 15 14 import org.junit.jupiter.params.ParameterizedTest; 16 15 import org.junit.jupiter.params.provider.Arguments; 17 16 import org.junit.jupiter.params.provider.MethodSource; 18 import org.openstreetmap.josm.JOSMFixture;19 17 import org.openstreetmap.josm.data.coor.LatLon; 20 18 import org.openstreetmap.josm.data.osm.Node; … … 26 24 */ 27 25 class SelfIntersectingWayTest { 28 29 /**30 * Setup test.31 * @throws Exception if test cannot be initialized32 */33 @BeforeAll34 public static void setUp() throws Exception {35 JOSMFixture.createUnitTestFixture().init();36 }37 26 38 27 private static List<Node> createNodes() { -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/SharpAnglesTest.java
r18619 r18853 13 13 import org.junit.jupiter.params.provider.Arguments; 14 14 import org.junit.jupiter.params.provider.MethodSource; 15 import org.openstreetmap.josm.JOSMFixture;16 15 import org.openstreetmap.josm.TestUtils; 17 16 import org.openstreetmap.josm.data.coor.EastNorth; … … 20 19 import org.openstreetmap.josm.data.osm.Way; 21 20 import org.openstreetmap.josm.testutils.annotations.BasicPreferences; 21 import org.openstreetmap.josm.testutils.annotations.Projection; 22 22 23 23 /** … … 25 25 */ 26 26 @BasicPreferences 27 @Projection 27 28 class SharpAnglesTest { 28 29 private SharpAngles angles; … … 34 35 @BeforeEach 35 36 public void setUp() throws Exception { 36 JOSMFixture.createUnitTestFixture().init();37 37 angles = new SharpAngles(); 38 38 angles.initialize(); -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/SimilarNamedWaysTest.java
r17275 r18853 5 5 import static org.junit.jupiter.api.Assertions.assertFalse; 6 6 7 import org.junit.jupiter.api.BeforeEach;8 7 import org.junit.jupiter.api.Test; 9 import org.openstreetmap.josm.JOSMFixture;10 8 11 9 /** … … 15 13 16 14 private final SimilarNamedWays test = new SimilarNamedWays(); 17 18 /**19 * Setup test20 */21 @BeforeEach22 public void setUp() {23 JOSMFixture.createUnitTestFixture().init();24 }25 15 26 16 private void checkSimilarity(String message, String name1, String name2, boolean expected) { -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/UnconnectedWaysTest.java
r17275 r18853 14 14 import org.junit.jupiter.api.BeforeEach; 15 15 import org.junit.jupiter.api.Test; 16 import org.openstreetmap.josm.JOSMFixture;17 16 import org.openstreetmap.josm.TestUtils; 18 17 import org.openstreetmap.josm.data.osm.DataSet; … … 22 21 import org.openstreetmap.josm.io.IllegalDataException; 23 22 import org.openstreetmap.josm.io.OsmReader; 23 import org.openstreetmap.josm.testutils.annotations.Projection; 24 24 25 25 /** 26 26 * Unit tests of {@code UnconnectedWays} class. 27 27 */ 28 @Projection 28 29 class UnconnectedWaysTest { 29 30 … … 37 38 public void setUp() throws Exception { 38 39 bib = new UnconnectedWays.UnconnectedHighways(); 39 JOSMFixture.createUnitTestFixture().init();40 40 bib.initialize(); 41 41 } -
trunk/test/unit/org/openstreetmap/josm/data/validation/util/ValUtilTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.data.validation.util; 3 3 4 import org.junit.jupiter.api.extension.RegisterExtension;5 4 import org.junit.jupiter.api.Test; 6 import org.openstreetmap.josm.testutils.JOSMTestRules;7 5 8 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;9 6 import net.trajano.commons.testing.UtilityClassTestUtil; 10 7 … … 13 10 */ 14 11 class ValUtilTest { 15 16 /**17 * Setup test.18 */19 @RegisterExtension20 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")21 public JOSMTestRules test = new JOSMTestRules();22 23 12 /** 24 13 * Tests that {@code ValUtil} satisfies utility class criteria. -
trunk/test/unit/org/openstreetmap/josm/gui/ConditionalOptionPaneUtilTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.gui; 3 3 4 import org.junit.jupiter.api.extension.RegisterExtension;5 4 import org.junit.jupiter.api.Test; 6 import org.openstreetmap.josm.testutils.JOSMTestRules;7 5 8 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;9 6 import net.trajano.commons.testing.UtilityClassTestUtil; 10 7 … … 13 10 */ 14 11 class ConditionalOptionPaneUtilTest { 15 16 /**17 * Setup rule18 */19 @RegisterExtension20 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")21 public JOSMTestRules test = new JOSMTestRules();22 23 12 /** 24 13 * Tests that {@code ConditionalOptionPaneUtil} satisfies utility class criteria. -
trunk/test/unit/org/openstreetmap/josm/gui/ExceptionDialogUtilTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.gui; 3 3 4 import org.junit.jupiter.api.extension.RegisterExtension;5 4 import org.junit.jupiter.api.Test; 6 import org.openstreetmap.josm.testutils.JOSMTestRules;7 5 8 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;9 6 import net.trajano.commons.testing.UtilityClassTestUtil; 10 7 … … 13 10 */ 14 11 class ExceptionDialogUtilTest { 15 16 /**17 * Setup rule18 */19 @RegisterExtension20 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")21 public JOSMTestRules test = new JOSMTestRules();22 23 12 /** 24 13 * Tests that {@code ExceptionDialogUtil} satisfies utility class criteria. -
trunk/test/unit/org/openstreetmap/josm/gui/MapStatusTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.gui; 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;8 6 9 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;10 7 import nl.jqno.equalsverifier.EqualsVerifier; 11 8 … … 14 11 */ 15 12 class MapStatusTest { 16 17 /**18 * Setup test.19 */20 @RegisterExtension21 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")22 public JOSMTestRules test = new JOSMTestRules();23 24 13 /** 25 14 * Unit test of methods {@link MapStatus.StatusTextHistory#equals} and {@link MapStatus.StatusTextHistory#hashCode}. -
trunk/test/unit/org/openstreetmap/josm/gui/SystemOfMeasurementTest.java
r17275 r18853 8 8 import java.util.Locale; 9 9 10 import org.junit.jupiter.api.BeforeAll;11 10 import org.junit.jupiter.api.Test; 12 import org.openstreetmap.josm.JOSMFixture;13 11 import org.openstreetmap.josm.data.SystemOfMeasurement; 14 12 … … 17 15 */ 18 16 class SystemOfMeasurementTest { 19 20 /**21 * Setup test.22 */23 @BeforeAll24 public static void setUp() {25 JOSMFixture.createUnitTestFixture().init();26 }27 28 17 /** 29 18 * Test of {@link SystemOfMeasurement#getDistText} method. -
trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolutionUtilTest.java
r18037 r18853 15 15 import java.util.stream.Collectors; 16 16 17 import org.junit.jupiter.api.Nested; 18 import org.junit.jupiter.api.Test; 17 19 import org.openstreetmap.josm.data.osm.Tag; 18 20 import org.openstreetmap.josm.data.osm.TagCollection; … … 20 22 import org.openstreetmap.josm.gui.conflict.tags.TagConflictResolutionUtil.AutomaticChoiceGroup; 21 23 import org.openstreetmap.josm.gui.conflict.tags.TagConflictResolutionUtil.AutomaticCombine; 22 import org.openstreetmap.josm.testutils.JOSMTestRules;23 24 import org.openstreetmap.josm.testutils.annotations.BasicPreferences; 24 25 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;26 import org.junit.jupiter.api.Test;27 import org.junit.jupiter.api.extension.RegisterExtension;28 25 29 26 /** … … 102 99 * Unit tests of {@link AutomaticCombine} class. 103 100 */ 104 static class AutomaticCombineTest { 101 @Nested 102 class AutomaticCombineTest { 105 103 106 104 /** … … 109 107 * @return AutomaticCombine object constructed with the two different constructors. 110 108 */ 111 private staticList<AutomaticCombine> differentlyConstructed(AutomaticCombine ac) {109 private List<AutomaticCombine> differentlyConstructed(AutomaticCombine ac) { 112 110 AutomaticCombine fullyConstructed = new AutomaticCombine(ac.key, ac.description, ac.isRegex, ac.separator, ac.sort); 113 111 AutomaticCombine defaultConstructed = new AutomaticCombine(); … … 121 119 122 120 /** 123 * Setup test.124 */125 @RegisterExtension126 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")127 public JOSMTestRules test = new JOSMTestRules();128 129 /**130 121 * Unit test of {@link AutomaticCombine#matchesKey} with empty key. 131 122 */ … … 229 220 * Unit tests of {@link AutomaticChoice} class. 230 221 */ 231 static class AutomaticChoiceTest { 232 /** 233 * Setup test. 234 */ 235 @RegisterExtension 236 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 237 public JOSMTestRules test = new JOSMTestRules(); 238 239 /** 240 222 @Nested 223 class AutomaticChoiceTest { 224 /** 241 225 * Return AutomaticCombine instantiated with the two possible constructors. 242 226 * @param ac a model for the constructed object. 243 227 * @return AutomaticCombine object constructed with the two different constructors. 244 228 */ 245 private staticList<AutomaticChoice> differentlyConstructed(AutomaticChoice ac) {229 private List<AutomaticChoice> differentlyConstructed(AutomaticChoice ac) { 246 230 AutomaticChoice fullyConstructed = new AutomaticChoice(ac.key, ac.group, ac.description, ac.isRegex, ac.value, ac.score); 247 231 AutomaticChoice defaultConstructed = new AutomaticChoice(); … … 349 333 * Unit tests of {@link AutomaticChoiceGroup} class. 350 334 */ 351 static class AutomaticChoiceGroupTest { 352 /** 353 * Setup test. 354 */ 355 @RegisterExtension 356 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 357 public JOSMTestRules test = new JOSMTestRules(); 358 335 @Nested 336 class AutomaticChoiceGroupTest { 359 337 AutomaticChoice choiceKey1Group1 = new AutomaticChoice("Key1", "Group1", "", false, "value1", "score1"); 360 338 AutomaticChoice choiceKey1Group1bis = new AutomaticChoice("Key1", "Group1", "", false, "value2", "score2"); -
trunk/test/unit/org/openstreetmap/josm/gui/correction/RoleCorrectionTableTest.java
r17275 r18853 9 9 10 10 import java.util.Arrays; 11 import java.util.Collections; 11 12 12 import org.junit.jupiter.api.extension.RegisterExtension;13 13 import org.junit.jupiter.api.Test; 14 14 import org.openstreetmap.josm.data.correction.RoleCorrection; … … 16 16 import org.openstreetmap.josm.data.osm.Relation; 17 17 import org.openstreetmap.josm.data.osm.RelationMember; 18 import org.openstreetmap.josm.testutils.JOSMTestRules;19 20 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;21 18 22 19 /** … … 24 21 */ 25 22 class RoleCorrectionTableTest { 26 27 /**28 * Setup tests29 */30 @RegisterExtension31 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")32 public JOSMTestRules test = new JOSMTestRules();33 34 23 /** 35 24 * Test of {@link RoleCorrectionTable#RoleCorrectionTable}. … … 41 30 r.addMember(member); 42 31 RoleCorrection rc = new RoleCorrection(r, 0, member, "bar"); 43 RoleCorrectionTable t = new RoleCorrectionTable( Arrays.asList(rc));32 RoleCorrectionTable t = new RoleCorrectionTable(Collections.singletonList(rc)); 44 33 assertNotNull(t.getCellRenderer(0, 0)); 45 34 assertNotNull(t.getCellRenderer(0, 1)); -
trunk/test/unit/org/openstreetmap/josm/gui/correction/TagCorrectionTableTest.java
r17275 r18853 10 10 import java.util.Arrays; 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.correction.TagCorrection; 15 import org.openstreetmap.josm.testutils.JOSMTestRules;16 17 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;18 14 19 15 /** … … 21 17 */ 22 18 class TagCorrectionTableTest { 23 24 /**25 * Setup tests26 */27 @RegisterExtension28 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")29 public JOSMTestRules test = new JOSMTestRules();30 31 19 /** 32 20 * Test of {@link TagCorrectionTable#TagCorrectionTable}. -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/ChangesetDialogTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.gui.dialogs; 3 3 4 import org.junit.jupiter.api.extension.RegisterExtension;5 4 import org.junit.jupiter.api.Test; 6 5 import org.openstreetmap.josm.gui.dialogs.ChangesetDialog.LaunchChangesetManager; 7 import org.openstreetmap.josm.testutils.JOSMTestRules;8 6 9 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;10 7 import net.trajano.commons.testing.UtilityClassTestUtil; 11 8 … … 14 11 */ 15 12 class ChangesetDialogTest { 16 17 /**18 * Setup tests19 */20 @RegisterExtension21 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")22 public JOSMTestRules test = new JOSMTestRules();23 24 13 /** 25 14 * Tests that {@code LaunchChangesetManager} satisfies utility class criteria. -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/properties/TaginfoActionTest.java
r17275 r18853 8 8 9 9 import org.junit.jupiter.api.Test; 10 import org.junit.jupiter.api.extension.RegisterExtension;11 10 import org.openstreetmap.josm.data.osm.Tag; 12 import org.openstreetmap.josm.testutils.JOSMTestRules;13 14 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;15 11 16 12 class TaginfoActionTest { 17 18 /**19 * Setup test.20 */21 @RegisterExtension22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")23 public JOSMTestRules test = new JOSMTestRules();24 25 13 /** 26 14 * Unit test of {@link TaginfoAction#getTaginfoUrlForTag} and {@link TaginfoAction#getTaginfoUrlForRelationType} -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableTest.java
r17275 r18853 8 8 import java.awt.event.MouseListener; 9 9 10 import org.junit.jupiter.api.extension.RegisterExtension;11 10 import org.junit.jupiter.api.Test; 12 11 import org.openstreetmap.josm.data.coor.LatLon; … … 18 17 import org.openstreetmap.josm.gui.dialogs.relation.SelectionTable.DoubleClickAdapter; 19 18 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 20 import org.openstreetmap.josm.testutils.JOSMTestRules;21 22 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;23 19 24 20 /** … … 26 22 */ 27 23 class SelectionTableTest { 28 29 /**30 * Setup test.31 */32 @RegisterExtension33 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")34 public JOSMTestRules test = new JOSMTestRules();35 36 24 /** 37 25 * Unit test of {@link SelectionTable#SelectionTable}. -
trunk/test/unit/org/openstreetmap/josm/gui/download/BookmarkListTest.java
r17721 r18853 2 2 package org.openstreetmap.josm.gui.download; 3 3 4 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 4 import java.time.Instant; 5 5 6 import org.junit.jupiter.api.Test; 6 import org.junit.jupiter.api.extension.RegisterExtension;7 7 import org.openstreetmap.josm.data.osm.Changeset; 8 import org.openstreetmap.josm.testutils.JOSMTestRules;9 10 import java.time.Instant;11 8 12 9 /** … … 14 11 */ 15 12 class BookmarkListTest { 16 17 /**18 * Setup test.19 */20 @RegisterExtension21 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")22 public JOSMTestRules test = new JOSMTestRules();23 24 13 /** 25 14 * Unit test of {@link BookmarkList.ChangesetBookmark#ChangesetBookmark(Changeset)} -
trunk/test/unit/org/openstreetmap/josm/gui/history/HistoryBrowserDialogTest.java
r17838 r18853 6 6 import java.time.Instant; 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.OsmPrimitiveType; … … 14 13 import org.openstreetmap.josm.data.osm.history.HistoryRelation; 15 14 import org.openstreetmap.josm.data.osm.history.HistoryWay; 16 import org.openstreetmap.josm.testutils.JOSMTestRules;17 18 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;19 15 20 16 /** … … 22 18 */ 23 19 class HistoryBrowserDialogTest { 24 25 /**26 * Setup test.27 */28 @RegisterExtension29 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")30 public JOSMTestRules test = new JOSMTestRules();31 32 20 /** 33 21 * Test for {@link HistoryBrowserDialog#buildTitle}. -
trunk/test/unit/org/openstreetmap/josm/gui/io/ActionFlagsTableCellTest.java
r17275 r18853 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;20 16 21 17 /** … … 23 19 */ 24 20 class ActionFlagsTableCellTest { 25 /**26 * Setup test.27 */28 @RegisterExtension29 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")30 public JOSMTestRules test = new JOSMTestRules();31 32 21 /** 33 22 * Test of {@link ActionFlagsTableCell} class. -
trunk/test/unit/org/openstreetmap/josm/gui/io/SaveLayerInfoTest.java
r17275 r18853 9 9 10 10 import org.junit.jupiter.api.Test; 11 import org.junit.jupiter.api.extension.RegisterExtension;12 11 import org.openstreetmap.josm.data.osm.DataSet; 13 12 import org.openstreetmap.josm.gui.layer.AbstractModifiableLayer; 14 13 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 15 import org.openstreetmap.josm.testutils.JOSMTestRules;16 14 17 15 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; … … 21 19 */ 22 20 class SaveLayerInfoTest { 23 /**24 * Setup test.25 */26 @RegisterExtension27 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")28 public JOSMTestRules test = new JOSMTestRules();29 30 21 /** 31 22 * Test of {@link SaveLayerInfo} class - null case. -
trunk/test/unit/org/openstreetmap/josm/gui/io/SaveLayerTaskTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.gui.io; 3 3 4 import static org.junit.jupiter.api.Assertions.assert NotNull;4 import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; 5 5 import static org.junit.jupiter.api.Assertions.assertThrows; 6 6 7 7 import org.junit.jupiter.api.Test; 8 import org.junit.jupiter.api.extension.RegisterExtension;9 8 import org.openstreetmap.josm.data.osm.DataSet; 10 9 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 11 import org.openstreetmap.josm.testutils.JOSMTestRules;12 10 13 11 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; … … 17 15 */ 18 16 class SaveLayerTaskTest { 19 /**20 * Setup test.21 */22 @RegisterExtension23 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")24 public JOSMTestRules test = new JOSMTestRules();25 26 17 /** 27 18 * Test of {@link SaveLayerTask} class - null case. … … 38 29 @Test 39 30 void testSaveLayerTaskNominal() { 40 assert NotNull(new SaveLayerTask(new SaveLayerInfo(new OsmDataLayer(new DataSet(), "", null)), null));31 assertDoesNotThrow(() -> new SaveLayerTask(new SaveLayerInfo(new OsmDataLayer(new DataSet(), "", null)), null)); 41 32 } 42 33 } -
trunk/test/unit/org/openstreetmap/josm/gui/io/UploadAndSaveProgressRendererTest.java
r17275 r18853 9 9 import javax.swing.JPanel; 10 10 11 import org.junit.jupiter.api.extension.RegisterExtension;12 11 import org.junit.jupiter.api.Test; 13 12 import org.openstreetmap.josm.gui.io.SaveLayersModel.Mode; 14 import org.openstreetmap.josm.testutils.JOSMTestRules;15 16 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;17 13 18 14 /** … … 20 16 */ 21 17 class UploadAndSaveProgressRendererTest { 22 23 /**24 * Setup tests25 */26 @RegisterExtension27 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")28 public JOSMTestRules test = new JOSMTestRules();29 30 18 /** 31 19 * Unit test of {@link UploadAndSaveProgressRenderer#UploadAndSaveProgressRenderer}. -
trunk/test/unit/org/openstreetmap/josm/gui/io/UploadPrimitivesTaskTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.gui.io; 3 3 4 import static org.junit.jupiter.api.Assertions.assert NotNull;4 import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; 5 5 6 import org.junit.jupiter.api.extension.RegisterExtension;7 6 import org.junit.jupiter.api.Test; 8 7 import org.openstreetmap.josm.data.osm.Changeset; … … 10 9 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 11 10 import org.openstreetmap.josm.io.UploadStrategySpecification; 12 import org.openstreetmap.josm.testutils.JOSMTestRules;13 14 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;15 11 16 12 /** … … 18 14 */ 19 15 class UploadPrimitivesTaskTest { 20 21 /**22 * Setup tests23 */24 @RegisterExtension25 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")26 public JOSMTestRules test = new JOSMTestRules();27 28 16 /** 29 17 * Test of {@link UploadPrimitivesTask#UploadPrimitivesTask}. … … 31 19 @Test 32 20 void testUploadPrimitivesTask() { 33 assert NotNull(new UploadPrimitivesTask(21 assertDoesNotThrow(() -> new UploadPrimitivesTask( 34 22 new UploadStrategySpecification(), 35 23 new OsmDataLayer(new DataSet(), null, null), -
trunk/test/unit/org/openstreetmap/josm/gui/io/UploadedObjectsSummaryPanelTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.gui.io; 3 3 4 import static org.junit.jupiter.api.Assertions.assert NotNull;4 import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; 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 /** … … 14 10 */ 15 11 class UploadedObjectsSummaryPanelTest { 16 17 /**18 * Setup tests19 */20 @RegisterExtension21 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")22 public JOSMTestRules test = new JOSMTestRules();23 24 12 /** 25 13 * Test of {@link UploadedObjectsSummaryPanel#UploadedObjectsSummaryPanel}. … … 27 15 @Test 28 16 void testUploadedObjectsSummaryPanel() { 29 assert NotNull(new UploadedObjectsSummaryPanel());17 assertDoesNotThrow(UploadedObjectsSummaryPanel::new); 30 18 } 31 19 } -
trunk/test/unit/org/openstreetmap/josm/gui/io/importexport/ImageImporterTest.java
r17548 r18853 11 11 import java.util.List; 12 12 13 import org.junit.jupiter.api.extension.RegisterExtension;14 13 import org.junit.jupiter.api.Test; 15 14 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 16 import org.openstreetmap.josm.testutils.JOSMTestRules;17 18 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;19 15 20 16 /** … … 22 18 */ 23 19 class ImageImporterTest { 24 25 /**26 * Setup test27 */28 @RegisterExtension29 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")30 public JOSMTestRules test = new JOSMTestRules();31 32 20 /** 33 21 * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/14868">Bug #14868</a>. -
trunk/test/unit/org/openstreetmap/josm/gui/io/importexport/NoteImporterTest.java
r17275 r18853 7 7 import java.io.File; 8 8 9 import org.junit.jupiter.api.extension.RegisterExtension;10 9 import org.junit.jupiter.api.Test; 11 10 import org.openstreetmap.josm.TestUtils; 12 11 import org.openstreetmap.josm.gui.MainApplication; 13 import org.openstreetmap.josm.testutils.JOSMTestRules;14 12 15 13 /** … … 17 15 */ 18 16 class NoteImporterTest { 19 20 /**21 * Use the test rules to remove any layers and reset state.22 */23 @RegisterExtension24 public final JOSMTestRules rules = new JOSMTestRules();25 26 17 /** 27 18 * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/12531">Bug #12531</a>. -
trunk/test/unit/org/openstreetmap/josm/gui/layer/AbstractMapViewPaintableTest.java
r17275 r18853 9 9 import org.junit.jupiter.api.BeforeEach; 10 10 import org.junit.jupiter.api.Test; 11 import org.junit.jupiter.api.extension.RegisterExtension;12 11 import org.openstreetmap.josm.gui.layer.MapViewPaintable.PaintableInvalidationListener; 13 import org.openstreetmap.josm.testutils.JOSMTestRules;14 15 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;16 12 17 13 /** … … 20 16 */ 21 17 class AbstractMapViewPaintableTest { 22 /**23 * No special test rules24 */25 @RegisterExtension26 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")27 public JOSMTestRules test = new JOSMTestRules();28 29 18 private Layer testLayer; 30 19 -
trunk/test/unit/org/openstreetmap/josm/gui/layer/MapViewPaintableTest.java
r17275 r18853 4 4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 5 6 import org.junit.jupiter.api.BeforeAll;7 6 import org.junit.jupiter.api.Test; 8 import org.openstreetmap.josm.JOSMFixture;9 7 import org.openstreetmap.josm.gui.layer.MapViewPaintable.PaintableInvalidationEvent; 10 8 … … 13 11 */ 14 12 class MapViewPaintableTest { 15 16 /**17 * Setup tests18 */19 @BeforeAll20 public static void setUpBeforeClass() {21 JOSMFixture.createUnitTestFixture().init();22 }23 24 13 /** 25 14 * Unit test of {@link MapViewPaintable.PaintableInvalidationEvent#toString} -
trunk/test/unit/org/openstreetmap/josm/gui/layer/NativeScaleLayerTest.java
r17275 r18853 6 6 import java.util.Collections; 7 7 8 import org.junit.jupiter.api.BeforeAll;9 8 import org.junit.jupiter.api.Test; 10 import org.openstreetmap.josm.JOSMFixture;11 9 12 10 /** … … 14 12 */ 15 13 class NativeScaleLayerTest { 16 17 /**18 * Setup tests19 */20 @BeforeAll21 public static void setUpBeforeClass() {22 JOSMFixture.createUnitTestFixture().init();23 }24 25 14 /** 26 15 * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/12255">#12255</a>. … … 28 17 @Test 29 18 void testTicket12255() { 30 assertNull(new NativeScaleLayer.ScaleList(Collections. <Double>emptyList()).getSnapScale(10, 2, false));19 assertNull(new NativeScaleLayer.ScaleList(Collections.emptyList()).getSnapScale(10, 2, false)); 31 20 } 32 21 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/NoteLayerTest.java
r17275 r18853 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 /** … … 14 10 */ 15 11 class NoteLayerTest { 16 17 /**18 * Setup tests19 */20 @RegisterExtension21 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")22 public JOSMTestRules test = new JOSMTestRules();23 24 12 /** 25 13 * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/13208">#13208</a>. -
trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImagesTest.java
r17715 r18853 6 6 import java.util.Collections; 7 7 8 import org.junit.jupiter.api.BeforeAll;9 8 import org.junit.jupiter.api.Test; 10 import org.junit.jupiter.api.extension.RegisterExtension;11 9 import org.openstreetmap.josm.data.gpx.GpxData; 12 10 import org.openstreetmap.josm.data.gpx.GpxTimeOffset; 13 11 import org.openstreetmap.josm.data.gpx.GpxTimezone; 14 12 import org.openstreetmap.josm.io.GpxReaderTest; 15 import org.openstreetmap.josm.testutils. JOSMTestRules;13 import org.openstreetmap.josm.testutils.annotations.Timezone; 16 14 import org.openstreetmap.josm.tools.Pair; 17 15 import org.openstreetmap.josm.tools.date.DateUtils; 18 import org.openstreetmap.josm.tools.date.DateUtilsTest;19 20 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;21 16 22 17 /** 23 18 * Unit tests of {@link CorrelateGpxWithImages} class. 24 19 */ 20 @Timezone 25 21 class CorrelateGpxWithImagesTest { 26 27 /**28 * Setup test.29 */30 @RegisterExtension31 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")32 public JOSMTestRules test = new JOSMTestRules();33 34 /**35 * Setup test.36 */37 @BeforeAll38 public static void setUp() {39 DateUtilsTest.setTimeZone(DateUtils.UTC);40 }41 42 22 /** 43 23 * Tests automatic guessing of timezone/offset -
trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityActionTest.java
r17275 r18853 9 9 import org.junit.jupiter.api.Disabled; 10 10 import org.junit.jupiter.api.Test; 11 import org.junit.jupiter.api.extension.RegisterExtension;12 11 import org.openstreetmap.josm.TestUtils; 13 12 import org.openstreetmap.josm.gui.ExtendedDialog; 14 13 import org.openstreetmap.josm.gui.layer.GpxLayerTest; 15 import org.openstreetmap.josm.testutils.JOSMTestRules;16 14 import org.openstreetmap.josm.testutils.mockers.ExtendedDialogMocker; 17 18 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;19 15 20 16 /** … … 22 18 */ 23 19 class ChooseTrackVisibilityActionTest { 24 25 /**26 * Setup test.27 */28 @RegisterExtension29 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")30 public JOSMTestRules test = new JOSMTestRules();31 32 20 /** 33 21 * Test action. -
trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ConvertToDataLayerActionTest.java
r18690 r18853 17 17 18 18 import org.junit.jupiter.api.Test; 19 import org.junit.jupiter.api.extension.RegisterExtension;20 19 import org.openstreetmap.josm.TestUtils; 21 20 import org.openstreetmap.josm.data.coor.LatLon; … … 30 29 import org.openstreetmap.josm.io.OsmReader; 31 30 import org.openstreetmap.josm.spi.preferences.Config; 32 import org.openstreetmap.josm.testutils.JOSMTestRules;33 31 import org.xml.sax.SAXException; 34 35 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;36 32 37 33 /** 38 34 * Unit tests of {@link ConvertToDataLayerAction} class. 39 35 */ 40 public class ConvertToDataLayerActionTest { 41 42 /** 43 * Setup test. 44 */ 45 @RegisterExtension 46 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 47 public JOSMTestRules test = new JOSMTestRules(); 48 36 class ConvertToDataLayerActionTest { 49 37 /** 50 38 * Tests a conversion from a GPX marker layer to a OSM dataset -
trunk/test/unit/org/openstreetmap/josm/gui/layer/imagery/ColorfulImageProcessorTest.java
r17983 r18853 12 12 13 13 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 14 19 15 /** … … 40 36 41 37 private static final IndexColorModel COLOR_MODEL = new IndexColorModel(8, PALETTE.length, PALETTE, 0, true, 255, DataBuffer.TYPE_BYTE); 42 43 /**44 * No special rules45 */46 @RegisterExtension47 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")48 public JOSMTestRules test = new JOSMTestRules();49 38 50 39 /** -
trunk/test/unit/org/openstreetmap/josm/gui/layer/imagery/GammaImageProcessorTest.java
r17275 r18853 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 /** … … 15 11 */ 16 12 class GammaImageProcessorTest { 17 18 /**19 * No special rules20 */21 @RegisterExtension22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")23 public JOSMTestRules test = new JOSMTestRules();24 25 13 /** 26 14 * Test {@link GammaImageProcessor#setGamma(double)} and {@link GammaImageProcessor#getGamma()} -
trunk/test/unit/org/openstreetmap/josm/gui/layer/imagery/SharpenImageProcessorTest.java
r17275 r18853 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 /** … … 15 11 */ 16 12 class SharpenImageProcessorTest { 17 18 /**19 * No special rules20 */21 @RegisterExtension22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")23 public JOSMTestRules test = new JOSMTestRules();24 25 13 /** 26 14 * Test {@link SharpenImageProcessor#setSharpenLevel(float)} and {@link SharpenImageProcessor#getSharpenLevel()} -
trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/AudioMarkerTest.java
r17275 r18853 7 7 import java.net.URL; 8 8 9 import org.junit.jupiter.api.BeforeAll;10 9 import org.junit.jupiter.api.Test; 11 import org.openstreetmap.josm.JOSMFixture;12 10 import org.openstreetmap.josm.data.coor.LatLon; 13 11 import org.openstreetmap.josm.data.gpx.GpxData; … … 18 16 */ 19 17 class AudioMarkerTest { 20 21 /**22 * Setup tests23 */24 @BeforeAll25 public static void setUpBeforeClass() {26 JOSMFixture.createUnitTestFixture().init();27 }28 29 18 /** 30 19 * Unit test of {@link AudioMarker#AudioMarker}. -
trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarkerTest.java
r17275 r18853 5 5 import static org.junit.jupiter.api.Assertions.assertNotNull; 6 6 7 import org.junit.jupiter.api.BeforeAll;8 7 import org.junit.jupiter.api.Test; 9 import org.openstreetmap.josm.JOSMFixture;10 8 import org.openstreetmap.josm.data.coor.LatLon; 11 9 import org.openstreetmap.josm.data.gpx.WayPoint; … … 15 13 */ 16 14 class PlayHeadMarkerTest { 17 18 /**19 * Setup tests20 */21 @BeforeAll22 public static void setUpBeforeClass() {23 JOSMFixture.createUnitTestFixture().init();24 }25 26 15 /** 27 16 * Unit test of {@link PlayHeadMarker#PlayHeadMarker}. -
trunk/test/unit/org/openstreetmap/josm/gui/mappaint/LabelCompositionStrategyTest.java
r17275 r18853 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.data.osm.Node; … … 15 14 import org.openstreetmap.josm.gui.mappaint.styleelement.LabelCompositionStrategy.StaticLabelCompositionStrategy; 16 15 import org.openstreetmap.josm.gui.mappaint.styleelement.LabelCompositionStrategy.TagLookupCompositionStrategy; 17 import org.openstreetmap.josm.testutils.JOSMTestRules;18 19 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;20 16 21 17 /** … … 23 19 */ 24 20 class LabelCompositionStrategyTest { 25 26 /**27 * Setup rule28 */29 @RegisterExtension30 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")31 public JOSMTestRules test = new JOSMTestRules();32 33 21 /** 34 22 * Test {@link StaticLabelCompositionStrategy}. -
trunk/test/unit/org/openstreetmap/josm/gui/mappaint/MapCSSWithExtendedTextDirectivesTest.java
r18690 r18853 9 9 import java.awt.Color; 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.Node; … … 16 15 import org.openstreetmap.josm.gui.mappaint.styleelement.LabelCompositionStrategy.TagLookupCompositionStrategy; 17 16 import org.openstreetmap.josm.gui.mappaint.styleelement.TextLabel; 18 import org.openstreetmap.josm.testutils.JOSMTestRules;19 20 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;21 17 22 18 /** … … 24 20 */ 25 21 class MapCSSWithExtendedTextDirectivesTest { 26 27 /**28 * Setup rule29 */30 @RegisterExtension31 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")32 public JOSMTestRules test = new JOSMTestRules();33 34 22 /** 35 23 * Test {@link DeriveLabelFromNameTagsCompositionStrategy} -
trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactoryTest.java
r17758 r18853 2 2 package org.openstreetmap.josm.gui.mappaint.mapcss; 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 import net.trajano.commons.testing.UtilityClassTestUtil;10 11 4 import java.lang.reflect.Method; 12 5 import java.lang.reflect.Modifier; 6 7 import org.junit.jupiter.api.Test; 8 9 import net.trajano.commons.testing.UtilityClassTestUtil; 13 10 14 11 /** … … 16 13 */ 17 14 class ExpressionFactoryTest { 18 19 /**20 * Setup rule21 */22 @RegisterExtension23 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")24 public JOSMTestRules test = new JOSMTestRules();25 26 15 /** 27 16 * Tests that {@code Functions} satisfies utility class criteria. -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreferenceTest.java
r17275 r18853 4 4 import static org.junit.jupiter.api.Assertions.assertNotNull; 5 5 6 import org.junit.jupiter.api.BeforeAll;7 6 import org.junit.jupiter.api.Test; 8 import org.openstreetmap.josm.JOSMFixture;9 7 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils; 10 8 … … 13 11 */ 14 12 class AdvancedPreferenceTest { 15 16 /**17 * Setup test.18 */19 @BeforeAll20 public static void setUpBeforeClass() {21 JOSMFixture.createUnitTestFixture().init();22 }23 24 13 /** 25 14 * Unit test of {@link AdvancedPreference#AdvancedPreference}. -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/ListEditorTest.java
r17275 r18853 6 6 import static org.junit.jupiter.api.Assertions.assertTrue; 7 7 8 import java.util. Arrays;8 import java.util.Collections; 9 9 10 import org.junit.jupiter.api.BeforeAll;11 10 import org.junit.jupiter.api.Test; 12 import org.openstreetmap.josm.JOSMFixture;13 11 import org.openstreetmap.josm.gui.preferences.advanced.ListEditor.ListSettingTableModel; 14 12 … … 17 15 */ 18 16 class ListEditorTest { 19 20 /**21 * Setup test.22 */23 @BeforeAll24 public static void setUpBeforeClass() {25 JOSMFixture.createUnitTestFixture().init();26 }27 28 17 /** 29 18 * Unit test of {@link ListSettingTableModel} class. … … 33 22 ListSettingTableModel model = new ListSettingTableModel(null); 34 23 assertNotNull(model.getData()); 35 model = new ListSettingTableModel( Arrays.asList("foo"));24 model = new ListSettingTableModel(Collections.singletonList("foo")); 36 25 assertTrue(model.getData().contains("foo")); 37 26 assertEquals(2, model.getRowCount()); -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/PrefEntryTest.java
r17275 r18853 6 6 import static org.junit.jupiter.api.Assertions.assertTrue; 7 7 8 import org.junit.jupiter.api.BeforeAll;9 8 import org.junit.jupiter.api.Test; 10 import org.openstreetmap.josm.JOSMFixture;11 9 import org.openstreetmap.josm.TestUtils; 12 10 import org.openstreetmap.josm.spi.preferences.StringSetting; … … 18 16 */ 19 17 class PrefEntryTest { 20 21 /**22 * Setup test.23 */24 @BeforeAll25 public static void setUpBeforeClass() {26 JOSMFixture.createUnitTestFixture().init();27 }28 29 18 /** 30 19 * Unit test of {@link PrefEntry#PrefEntry}. -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/audio/AudioPreferenceTest.java
r17275 r18853 4 4 import static org.junit.jupiter.api.Assertions.assertNotNull; 5 5 6 import org.junit.jupiter.api.BeforeAll;7 6 import org.junit.jupiter.api.Test; 8 import org.openstreetmap.josm.JOSMFixture;9 7 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils; 10 8 import org.openstreetmap.josm.spi.preferences.Config; … … 14 12 */ 15 13 class AudioPreferenceTest { 16 17 /**18 * Setup test.19 */20 @BeforeAll21 public static void setUpBeforeClass() {22 JOSMFixture.createUnitTestFixture().init();23 }24 25 14 /** 26 15 * Unit test of {@link AudioPreference#AudioPreference}. -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/ColorPreferenceTest.java
r17275 r18853 4 4 import static org.junit.jupiter.api.Assertions.assertNotNull; 5 5 6 import org.junit.jupiter.api.BeforeAll;7 6 import org.junit.jupiter.api.Test; 8 import org.openstreetmap.josm.JOSMFixture;9 7 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils; 10 8 … … 13 11 */ 14 12 class ColorPreferenceTest { 15 16 /**17 * Setup test.18 */19 @BeforeAll20 public static void setUpBeforeClass() {21 JOSMFixture.createUnitTestFixture().init();22 }23 24 13 /** 25 14 * Unit test of {@link ColorPreference#ColorPreference}. -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/DisplayPreferenceTest.java
r17275 r18853 4 4 import static org.junit.jupiter.api.Assertions.assertNotNull; 5 5 6 import org.junit.jupiter.api.BeforeAll;7 6 import org.junit.jupiter.api.Test; 8 import org.openstreetmap.josm.JOSMFixture;9 7 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils; 10 8 … … 13 11 */ 14 12 class DisplayPreferenceTest { 15 16 /**17 * Setup test.18 */19 @BeforeAll20 public static void setUpBeforeClass() {21 JOSMFixture.createUnitTestFixture().init();22 }23 24 13 /** 25 14 * Unit test of {@link DisplayPreference#DisplayPreference}. -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/DrawingPreferenceTest.java
r17275 r18853 4 4 import static org.junit.jupiter.api.Assertions.assertNotNull; 5 5 6 import org.junit.jupiter.api.BeforeAll;7 6 import org.junit.jupiter.api.Test; 8 import org.openstreetmap.josm.JOSMFixture;9 7 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils; 10 8 … … 13 11 */ 14 12 class DrawingPreferenceTest { 15 16 /**17 * Setup test.18 */19 @BeforeAll20 public static void setUpBeforeClass() {21 JOSMFixture.createUnitTestFixture().init();22 }23 24 13 /** 25 14 * Unit test of {@link DrawingPreference#DrawingPreference}. -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/GPXPreferenceTest.java
r17275 r18853 4 4 import static org.junit.jupiter.api.Assertions.assertNotNull; 5 5 6 import org.junit.jupiter.api.BeforeAll;7 6 import org.junit.jupiter.api.Test; 8 import org.openstreetmap.josm.JOSMFixture;9 7 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils; 10 8 … … 13 11 */ 14 12 class GPXPreferenceTest { 15 16 /**17 * Setup test.18 */19 @BeforeAll20 public static void setUpBeforeClass() {21 JOSMFixture.createUnitTestFixture().init();22 }23 24 13 /** 25 14 * Unit test of {@link GPXPreference.Factory}. -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/LafPreferenceTest.java
r17275 r18853 4 4 import static org.junit.jupiter.api.Assertions.assertNotNull; 5 5 6 import org.junit.jupiter.api.BeforeAll;7 6 import org.junit.jupiter.api.Test; 8 import org.openstreetmap.josm.JOSMFixture;9 7 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils; 10 8 … … 13 11 */ 14 12 class LafPreferenceTest { 15 16 /**17 * Setup test.18 */19 @BeforeAll20 public static void setUpBeforeClass() {21 JOSMFixture.createUnitTestFixture().init();22 }23 24 13 /** 25 14 * Unit test of {@link LafPreference#LafPreference}. -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/LanguagePreferenceTest.java
r17275 r18853 4 4 import static org.junit.jupiter.api.Assertions.assertNotNull; 5 5 6 import org.junit.jupiter.api.BeforeAll;7 6 import org.junit.jupiter.api.Test; 8 import org.openstreetmap.josm.JOSMFixture;9 7 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils; 10 8 … … 13 11 */ 14 12 class LanguagePreferenceTest { 15 16 /**17 * Setup test.18 */19 @BeforeAll20 public static void setUpBeforeClass() {21 JOSMFixture.createUnitTestFixture().init();22 }23 24 13 /** 25 14 * Unit test of {@link LanguagePreference#LanguagePreference}. -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/BackupPreferenceTest.java
r17275 r18853 4 4 import static org.junit.jupiter.api.Assertions.assertNotNull; 5 5 6 import org.junit.jupiter.api.BeforeAll;7 6 import org.junit.jupiter.api.Test; 8 import org.openstreetmap.josm.JOSMFixture;9 7 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils; 10 8 … … 13 11 */ 14 12 class BackupPreferenceTest { 15 16 /**17 * Setup test.18 */19 @BeforeAll20 public static void setUpBeforeClass() {21 JOSMFixture.createUnitTestFixture().init();22 }23 24 13 /** 25 14 * Unit test of {@link BackupPreference#BackupPreference}. -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTest.java
r17275 r18853 4 4 import static org.junit.jupiter.api.Assertions.assertNotNull; 5 5 6 import org.junit.jupiter.api.BeforeAll;7 6 import org.junit.jupiter.api.Test; 8 import org.openstreetmap.josm.JOSMFixture;9 7 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils; 10 8 … … 13 11 */ 14 12 class MapPaintPreferenceTest { 15 16 /**17 * Setup test.18 */19 @BeforeAll20 public static void setUpBeforeClass() {21 JOSMFixture.createUnitTestFixture().init();22 }23 24 13 /** 25 14 * Unit test of {@link MapPaintPreference#MapPaintPreference}. -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTest.java
r17275 r18853 4 4 import static org.junit.jupiter.api.Assertions.assertNotNull; 5 5 6 import org.junit.jupiter.api.BeforeAll;7 6 import org.junit.jupiter.api.Test; 8 import org.openstreetmap.josm.JOSMFixture;9 7 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils; 10 8 … … 13 11 */ 14 12 class TaggingPresetPreferenceTest { 15 16 /**17 * Setup test.18 */19 @BeforeAll20 public static void setUpBeforeClass() {21 JOSMFixture.createUnitTestFixture().init();22 }23 13 24 14 /** -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreferenceTest.java
r17275 r18853 4 4 import static org.junit.jupiter.api.Assertions.assertNotNull; 5 5 6 import org.junit.jupiter.api.BeforeAll;7 6 import org.junit.jupiter.api.Test; 8 import org.openstreetmap.josm.JOSMFixture;9 7 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils; 10 8 … … 13 11 */ 14 12 class ProjectionPreferenceTest { 15 16 /**17 * Setup test.18 */19 @BeforeAll20 public static void setUpBeforeClass() {21 JOSMFixture.createUnitTestFixture().init();22 }23 24 13 /** 25 14 * Unit test of {@link ProjectionPreference#ProjectionPreference}. -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/remotecontrol/RemoteControlPreferenceTest.java
r17275 r18853 4 4 import static org.junit.jupiter.api.Assertions.assertNotNull; 5 5 6 import org.junit.jupiter.api.BeforeAll;7 6 import org.junit.jupiter.api.Test; 8 import org.openstreetmap.josm.JOSMFixture;9 7 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils; 10 8 … … 13 11 */ 14 12 class RemoteControlPreferenceTest { 15 16 /**17 * Setup test.18 */19 @BeforeAll20 public static void setUpBeforeClass() {21 JOSMFixture.createUnitTestFixture().init();22 }23 24 13 /** 25 14 * Unit test of {@link RemoteControlPreference#RemoteControlPreference}. -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/shortcut/ShortcutPreferenceTest.java
r17275 r18853 4 4 import static org.junit.jupiter.api.Assertions.assertNotNull; 5 5 6 import org.junit.jupiter.api.BeforeAll;7 6 import org.junit.jupiter.api.Test; 8 import org.openstreetmap.josm.JOSMFixture;9 7 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils; 10 8 … … 13 11 */ 14 12 class ShortcutPreferenceTest { 15 16 /**17 * Setup test.18 */19 @BeforeAll20 public static void setUpBeforeClass() {21 JOSMFixture.createUnitTestFixture().init();22 }23 24 13 /** 25 14 * Unit test of {@link ShortcutPreference#ShortcutPreference}. -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorPreferenceTest.java
r17275 r18853 4 4 import static org.junit.jupiter.api.Assertions.assertNotNull; 5 5 6 import org.junit.jupiter.api.BeforeAll;7 6 import org.junit.jupiter.api.Test; 8 import org.openstreetmap.josm.JOSMFixture;9 7 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils; 10 8 … … 13 11 */ 14 12 class ValidatorPreferenceTest { 15 16 /**17 * Setup test.18 */19 @BeforeAll20 public static void setUpBeforeClass() {21 JOSMFixture.createUnitTestFixture().init();22 }23 24 13 /** 25 14 * Unit test of {@link ValidatorPreference#ValidatorPreference}. -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorTestsPreferenceTest.java
r17275 r18853 4 4 import static org.junit.jupiter.api.Assertions.assertNotNull; 5 5 6 import org.junit.jupiter.api.BeforeAll;7 6 import org.junit.jupiter.api.Test; 8 import org.openstreetmap.josm.JOSMFixture;9 7 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils; 10 8 … … 13 11 */ 14 12 class ValidatorTestsPreferenceTest { 15 16 /**17 * Setup test.18 */19 @BeforeAll20 public static void setUpBeforeClass() {21 JOSMFixture.createUnitTestFixture().init();22 }23 24 13 /** 25 14 * Unit test of {@link ValidatorTestsPreference#ValidatorTestsPreference}. -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManagerTest.java
r17275 r18853 2 2 package org.openstreetmap.josm.gui.tagging.ac; 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; … … 9 8 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 10 9 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager.UserInputTag; 11 import org.openstreetmap.josm.testutils.JOSMTestRules;12 10 13 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;14 11 import nl.jqno.equalsverifier.EqualsVerifier; 15 12 … … 18 15 */ 19 16 class AutoCompletionManagerTest { 20 21 /**22 * Setup rule23 */24 @RegisterExtension25 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")26 public JOSMTestRules test = new JOSMTestRules();27 28 17 /** 29 18 * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/17064">#17064</a>. -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/PresetClassificationsTest.java
r17275 r18853 14 14 import org.junit.jupiter.api.BeforeAll; 15 15 import org.junit.jupiter.api.Test; 16 import org.openstreetmap.josm.JOSMFixture;17 16 import org.openstreetmap.josm.data.osm.Node; 18 17 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 37 36 @BeforeAll 38 37 public static void setUp() throws IOException, SAXException { 39 JOSMFixture.createUnitTestFixture().init();40 38 final Collection<TaggingPreset> presets = TaggingPresetReader.readAll("resource://data/defaultpresets.xml", true); 41 39 classifications.loadPresets(presets); -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetItemGuiSupportTest.java
r17876 r18853 2 2 package org.openstreetmap.josm.gui.tagging.presets; 3 3 4 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 5 import org.junit.jupiter.api.Test; 6 import org.junit.jupiter.api.extension.RegisterExtension; 7 import org.openstreetmap.josm.data.osm.OsmPrimitive; 8 import org.openstreetmap.josm.data.osm.OsmUtils; 9 import org.openstreetmap.josm.data.osm.Tag; 10 import org.openstreetmap.josm.testutils.JOSMTestRules; 11 import org.openstreetmap.josm.tools.template_engine.TemplateEntry; 12 import org.openstreetmap.josm.tools.template_engine.TemplateParser; 4 import static org.junit.jupiter.api.Assertions.assertEquals; 13 5 14 6 import java.util.ArrayList; … … 17 9 import java.util.Collections; 18 10 19 import static org.junit.jupiter.api.Assertions.assertEquals; 11 import org.junit.jupiter.api.Test; 12 import org.openstreetmap.josm.data.osm.OsmPrimitive; 13 import org.openstreetmap.josm.data.osm.OsmUtils; 14 import org.openstreetmap.josm.data.osm.Tag; 15 import org.openstreetmap.josm.tools.template_engine.TemplateEntry; 16 import org.openstreetmap.josm.tools.template_engine.TemplateParser; 20 17 21 18 /** … … 23 20 */ 24 21 class TaggingPresetItemGuiSupportTest { 25 26 /**27 * Setup rule28 */29 @RegisterExtension30 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")31 public JOSMTestRules test = new JOSMTestRules();32 33 22 /** 34 23 * Tests {@link TemplateEntry} evaluation -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReaderTest.java
r18690 r18853 15 15 16 16 import org.junit.jupiter.api.Test; 17 import org.junit.jupiter.api.extension.RegisterExtension;18 17 import org.openstreetmap.josm.TestUtils; 19 18 import org.openstreetmap.josm.gui.tagging.presets.items.Check; 20 19 import org.openstreetmap.josm.gui.tagging.presets.items.Key; 21 import org.openstreetmap.josm.testutils.JOSMTestRules;22 20 import org.xml.sax.SAXException; 23 24 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;25 21 26 22 /** … … 28 24 */ 29 25 class TaggingPresetReaderTest { 30 31 /**32 * Setup rule33 */34 @RegisterExtension35 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")36 public JOSMTestRules test = new JOSMTestRules();37 38 26 /** 39 27 * #8954 - last checkbox in the preset is not added -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetTest.java
r18037 r18853 8 8 9 9 import org.junit.jupiter.api.Test; 10 import org.junit.jupiter.api.extension.RegisterExtension;11 10 import org.openstreetmap.josm.data.osm.IPrimitive; 12 11 import org.openstreetmap.josm.data.osm.OsmUtils; … … 14 13 import org.openstreetmap.josm.data.osm.search.SearchParseError; 15 14 import org.openstreetmap.josm.gui.tagging.presets.items.Key; 16 import org.openstreetmap.josm.testutils.JOSMTestRules;17 18 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;19 15 20 16 /** … … 22 18 */ 23 19 class TaggingPresetTest { 24 25 /**26 * Setup test.27 */28 @RegisterExtension29 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")30 public JOSMTestRules test = new JOSMTestRules();31 32 20 /** 33 21 * Tests {@link TaggingPreset#test(IPrimitive)} -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/CheckGroupTest.java
r17609 r18853 8 8 import javax.swing.JPanel; 9 9 10 import org.junit.jupiter.api.BeforeAll;11 10 import org.junit.jupiter.api.Test; 12 import org.openstreetmap.josm.JOSMFixture;13 11 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport; 14 12 … … 17 15 */ 18 16 class CheckGroupTest { 19 20 /**21 * Setup test.22 */23 @BeforeAll24 public static void setUp() {25 JOSMFixture.createUnitTestFixture().init();26 }27 28 17 /** 29 18 * Unit test for {@link CheckGroup#addToPanel}. -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/ItemSeparatorTest.java
r17609 r18853 8 8 import javax.swing.JPanel; 9 9 10 import org.junit.jupiter.api.BeforeAll;11 10 import org.junit.jupiter.api.Test; 12 import org.openstreetmap.josm.JOSMFixture;13 11 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport; 14 12 … … 17 15 */ 18 16 class ItemSeparatorTest { 19 20 /**21 * Setup test.22 */23 @BeforeAll24 public static void setUp() {25 JOSMFixture.createUnitTestFixture().init();26 }27 28 17 /** 29 18 * Unit test for {@link ItemSeparator#addToPanel}. -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/KeyTest.java
r17609 r18853 7 7 import javax.swing.JPanel; 8 8 9 import org.junit.jupiter.api.BeforeAll;10 9 import org.junit.jupiter.api.Test; 11 import org.openstreetmap.josm.JOSMFixture;12 10 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport; 13 11 … … 16 14 */ 17 15 class KeyTest { 18 19 /**20 * Setup test.21 */22 @BeforeAll23 public static void setUp() {24 JOSMFixture.createUnitTestFixture().init();25 }26 27 16 /** 28 17 * Unit test for {@link Key#addToPanel}. -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/LabelTest.java
r17609 r18853 7 7 import javax.swing.JPanel; 8 8 9 import org.junit.jupiter.api.BeforeAll;10 9 import org.junit.jupiter.api.Test; 11 import org.openstreetmap.josm.JOSMFixture;12 10 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport; 13 11 … … 16 14 */ 17 15 class LabelTest { 18 19 /**20 * Setup test.21 */22 @BeforeAll23 public static void setUp() {24 JOSMFixture.createUnitTestFixture().init();25 }26 27 16 /** 28 17 * Unit test for {@link Label#addToPanel}. -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/LinkTest.java
r17609 r18853 8 8 import javax.swing.JPanel; 9 9 10 import org.junit.jupiter.api.BeforeAll;11 10 import org.junit.jupiter.api.Test; 12 import org.openstreetmap.josm.JOSMFixture;13 11 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport; 14 12 import org.openstreetmap.josm.spi.preferences.Config; … … 18 16 */ 19 17 class LinkTest { 20 21 /**22 * Setup test.23 */24 @BeforeAll25 public static void setUp() {26 JOSMFixture.createUnitTestFixture().init();27 }28 29 18 /** 30 19 * Unit test for {@link Link#addToPanel}. -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/MultiSelectTest.java
r17609 r18853 7 7 import javax.swing.JPanel; 8 8 9 import org.junit.jupiter.api.BeforeAll;10 9 import org.junit.jupiter.api.Test; 11 import org.openstreetmap.josm.JOSMFixture;12 10 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport; 13 11 … … 16 14 */ 17 15 class MultiSelectTest { 18 19 /**20 * Setup test.21 */22 @BeforeAll23 public static void setUp() {24 JOSMFixture.createUnitTestFixture().init();25 }26 27 16 /** 28 17 * Unit test for {@link MultiSelect#addToPanel}. -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/OptionalTest.java
r17609 r18853 8 8 import javax.swing.JPanel; 9 9 10 import org.junit.jupiter.api.BeforeAll;11 10 import org.junit.jupiter.api.Test; 12 import org.openstreetmap.josm.JOSMFixture;13 11 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport; 14 12 … … 17 15 */ 18 16 class OptionalTest { 19 20 /**21 * Setup test.22 */23 @BeforeAll24 public static void setUp() {25 JOSMFixture.createUnitTestFixture().init();26 }27 28 17 /** 29 18 * Unit test for {@link Optional#addToPanel}. -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/PresetListEntryTest.java
r18327 r18853 5 5 import static org.junit.jupiter.api.Assertions.assertTrue; 6 6 7 import org.junit.jupiter.api.BeforeAll;8 7 import org.junit.jupiter.api.Test; 9 import org.openstreetmap.josm.JOSMFixture;10 8 11 9 /** … … 13 11 */ 14 12 class PresetListEntryTest { 15 16 /**17 * Setup test.18 */19 @BeforeAll20 public static void setUp() {21 JOSMFixture.createUnitTestFixture().init();22 }23 24 13 /** 25 14 * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/12416">#12416</a>. -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/RolesTest.java
r17609 r18853 8 8 import javax.swing.JPanel; 9 9 10 import org.junit.jupiter.api.BeforeAll;11 10 import org.junit.jupiter.api.Test; 12 import org.openstreetmap.josm.JOSMFixture;13 11 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport; 14 12 … … 17 15 */ 18 16 class RolesTest { 19 20 /**21 * Setup test.22 */23 @BeforeAll24 public static void setUp() {25 JOSMFixture.createUnitTestFixture().init();26 }27 28 17 /** 29 18 * Unit test for {@link Roles#addToPanel}. -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/SpaceTest.java
r17609 r18853 8 8 import javax.swing.JPanel; 9 9 10 import org.junit.jupiter.api.BeforeAll;11 10 import org.junit.jupiter.api.Test; 12 import org.openstreetmap.josm.JOSMFixture;13 11 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport; 14 12 … … 17 15 */ 18 16 class SpaceTest { 19 20 /**21 * Setup test.22 */23 @BeforeAll24 public static void setUp() {25 JOSMFixture.createUnitTestFixture().init();26 }27 28 17 /** 29 18 * Unit test for {@link Space#addToPanel}. -
trunk/test/unit/org/openstreetmap/josm/gui/util/MultiLineFlowLayoutTest.java
r17275 r18853 12 12 import org.junit.jupiter.api.BeforeEach; 13 13 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 14 19 15 /** … … 22 18 */ 23 19 class MultiLineFlowLayoutTest { 24 /**25 * No special rules.26 */27 @RegisterExtension28 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")29 public JOSMTestRules test = new JOSMTestRules();30 31 20 private static final int TEST_WIDHT = 500; 32 21 private JPanel container; -
trunk/test/unit/org/openstreetmap/josm/gui/widgets/AutoAdjustingSplitPaneTest.java
r17275 r18853 8 8 import javax.swing.JSplitPane; 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 /** … … 18 14 */ 19 15 class AutoAdjustingSplitPaneTest { 20 21 /**22 * Setup test.23 */24 @RegisterExtension25 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")26 public JOSMTestRules test = new JOSMTestRules();27 28 16 /** 29 17 * Unit test of {@link AutoAdjustingSplitPane} class. -
trunk/test/unit/org/openstreetmap/josm/io/OsmApiTest.java
r17275 r18853 7 7 import java.nio.charset.StandardCharsets; 8 8 9 import org.junit.jupiter.api.BeforeAll;10 9 import org.junit.jupiter.api.Test; 11 import org.openstreetmap.josm.JOSMFixture;12 10 import org.openstreetmap.josm.data.osm.Changeset; 13 11 import org.openstreetmap.josm.data.osm.User; … … 18 16 */ 19 17 class OsmApiTest { 20 21 /**22 * Setup test.23 */24 @BeforeAll25 public static void setUp() {26 JOSMFixture.createUnitTestFixture().init();27 }28 29 18 /** 30 19 * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/12675">Bug #12675</a>. -
trunk/test/unit/org/openstreetmap/josm/io/audio/AudioPlayerTest.java
r17275 r18853 3 3 4 4 import static org.junit.jupiter.api.Assertions.assertFalse; 5 import static org.junit.jupiter.api.Assertions.assertTimeout; 5 6 import static org.junit.jupiter.api.Assertions.assertTrue; 6 import static org.junit.jupiter.api.Assertions.assertTimeout;7 7 8 8 import java.io.File; 9 import java.net.MalformedURLException;10 9 import java.net.URL; 11 10 import java.time.Duration; 12 11 13 import org.junit.jupiter.api.BeforeAll;14 12 import org.junit.jupiter.api.Disabled; 15 13 import org.junit.jupiter.api.Test; 16 import org.openstreetmap.josm.JOSMFixture;17 14 import org.openstreetmap.josm.TestUtils; 18 15 import org.openstreetmap.josm.tools.Stopwatch; … … 28 25 29 26 /** 30 * Setup test.31 */32 @BeforeAll33 public static void setUp() {34 JOSMFixture.createUnitTestFixture().init();35 }36 37 /**38 27 * Test method for {@code AudioPlayer#play(URL)} 39 * @throws Exception audio fault exception, e.g. can't open stream, unhandleable audio format40 * @throws MalformedURLException wrong URL41 28 */ 42 29 @Test 43 void testPlay() throws MalformedURLException, Exception{30 void testPlay() { 44 31 assertTimeout(Duration.ofMillis(4*MAX_DURATION), () -> { 45 32 File wav1 = new File(TestUtils.getRegressionDataFile(6851, "20111003_121226.wav")); -
trunk/test/unit/org/openstreetmap/josm/io/audio/AudioUtilTest.java
r17275 r18853 6 6 import java.io.File; 7 7 8 import org.junit.jupiter.api.BeforeAll;9 8 import org.junit.jupiter.api.Test; 10 import org.openstreetmap.josm.JOSMFixture;11 9 import org.openstreetmap.josm.TestUtils; 12 10 … … 17 15 18 16 private static final double EPSILON = 1e-11; 19 20 /**21 * Setup test.22 */23 @BeforeAll24 public static void setUp() {25 JOSMFixture.createUnitTestFixture().init();26 }27 17 28 18 /** -
trunk/test/unit/org/openstreetmap/josm/io/nmea/NmeaReaderTest.java
r18788 r18853 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.coor.LatLon; … … 27 26 import org.openstreetmap.josm.data.gpx.WayPoint; 28 27 import org.openstreetmap.josm.io.GpxReaderTest; 29 import org.openstreetmap.josm.testutils.JOSMTestRules;30 28 import org.openstreetmap.josm.tools.date.DateUtils; 31 29 import org.xml.sax.SAXException; 32 33 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;34 30 35 31 /** … … 37 33 */ 38 34 class NmeaReaderTest { 39 /**40 * Set the timezone and timeout.41 */42 @RegisterExtension43 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")44 public JOSMTestRules test = new JOSMTestRules();45 46 35 /** 47 36 * Tests reading a nmea file. -
trunk/test/unit/org/openstreetmap/josm/io/protocols/data/HandlerTest.java
r17275 r18853 10 10 import org.junit.jupiter.api.BeforeEach; 11 11 import org.junit.jupiter.api.Test; 12 import org.junit.jupiter.api.extension.RegisterExtension;13 import org.openstreetmap.josm.testutils.JOSMTestRules;14 12 15 13 /** … … 17 15 */ 18 16 class HandlerTest { 19 20 /**21 * Use the test rules to remove any layers and reset state.22 */23 @RegisterExtension24 public final JOSMTestRules rules = new JOSMTestRules();25 26 17 /** 27 18 * Setup test. -
trunk/test/unit/org/openstreetmap/josm/io/rtklib/RtkLibPosReaderTest.java
r18048 r18853 13 13 14 14 import org.junit.jupiter.api.Test; 15 import org.junit.jupiter.api.extension.RegisterExtension;16 15 import org.openstreetmap.josm.data.coor.LatLon; 17 16 import org.openstreetmap.josm.data.gpx.GpxConstants; 18 17 import org.openstreetmap.josm.data.gpx.WayPoint; 19 import org.openstreetmap.josm.testutils.JOSMTestRules;20 18 import org.openstreetmap.josm.tools.date.DateUtils; 21 19 import org.xml.sax.SAXException; 22 23 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;24 20 25 21 /** … … 27 23 */ 28 24 class RtkLibPosReaderTest { 29 /**30 * Set the timezone and timeout.31 */32 @RegisterExtension33 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")34 public JOSMTestRules test = new JOSMTestRules();35 36 25 private static RtkLibPosReader read(String path) throws IOException, SAXException { 37 26 TimeZone.setDefault(TimeZone.getTimeZone("Europe/Berlin")); -
trunk/test/unit/org/openstreetmap/josm/testutils/annotations/JosmDefaults.java
r18694 r18853 77 77 /** 78 78 * Clean up what test not using these test rules may have broken. 79 * See {@link org.openstreetmap.josm.JOSMFixture} for the most common reason why this needs to be called. 79 80 */ 80 private void cleanUpFromJosmFixture() {81 private static void cleanUpFromJosmFixture() { 81 82 MemoryManagerTest.resetState(true); 82 83 JOSMTestRules.cleanLayerEnvironment(); -
trunk/test/unit/org/openstreetmap/josm/tools/ExifReaderTest.java
r17715 r18853 12 12 import org.junit.jupiter.api.BeforeEach; 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.coor.LatLon; 17 16 import org.openstreetmap.josm.data.coor.conversion.AbstractCoordinateFormat; 18 17 import org.openstreetmap.josm.data.coor.conversion.DMSCoordinateFormat; 19 import org.openstreetmap.josm.testutils.JOSMTestRules;20 21 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;22 18 23 19 /** … … 26 22 */ 27 23 class ExifReaderTest { 28 /**29 * Set the timezone and timeout.30 */31 @RegisterExtension32 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")33 public JOSMTestRules test = new JOSMTestRules();34 35 24 private File orientationSampleFile, directionSampleFile; 36 25 -
trunk/test/unit/org/openstreetmap/josm/tools/PlatformHookOsxTest.java
r17679 r18853 13 13 import org.junit.jupiter.api.BeforeAll; 14 14 import org.junit.jupiter.api.Test; 15 import org.openstreetmap.josm.JOSMFixture;16 15 import org.openstreetmap.josm.spi.preferences.Config; 17 16 … … 28 27 @BeforeAll 29 28 public static void setUp() { 30 JOSMFixture.createUnitTestFixture().init();31 29 hook = new PlatformHookOsx(); 32 30 } -
trunk/test/unit/org/openstreetmap/josm/tools/PlatformHookTestIT.java
r18723 r18853 8 8 import java.net.URL; 9 9 10 import org.junit.jupiter.api.Test; 11 10 12 import jakarta.json.Json; 11 12 import org.junit.jupiter.api.Test;13 import org.junit.jupiter.api.extension.RegisterExtension;14 import org.openstreetmap.josm.testutils.JOSMTestRules;15 16 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;17 13 18 14 /** … … 20 16 */ 21 17 class PlatformHookTestIT { 22 23 /**24 * Setup rule25 */26 @RegisterExtension27 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")28 public JOSMTestRules test = new JOSMTestRules();29 30 18 /** 31 19 * Test that we always support the latest Ubuntu version. -
trunk/test/unit/org/openstreetmap/josm/tools/ShortcutTest.java
r17275 r18853 9 9 import javax.swing.KeyStroke; 10 10 11 import org.junit.jupiter.api.BeforeAll;12 11 import org.junit.jupiter.api.Test; 13 import org.openstreetmap.josm.JOSMFixture;14 12 15 13 /** … … 17 15 */ 18 16 class ShortcutTest { 19 20 /**21 * Setup test.22 */23 @BeforeAll24 public static void setUp() {25 JOSMFixture.createUnitTestFixture().init();26 }27 28 17 /** 29 18 * Test method for {@code Shortcut#makeTooltip} -
trunk/test/unit/org/openstreetmap/josm/tools/template_engine/TemplateEntryTest.java
r18690 r18853 6 6 import java.util.Set; 7 7 8 import org.junit.jupiter.api.extension.RegisterExtension;9 8 import org.junit.jupiter.api.Test; 10 9 import org.openstreetmap.josm.TestUtils; 11 import org.openstreetmap.josm.testutils.JOSMTestRules;12 10 import org.openstreetmap.josm.tools.Logging; 13 11 14 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;15 12 import nl.jqno.equalsverifier.EqualsVerifier; 16 13 import nl.jqno.equalsverifier.Warning; … … 20 17 */ 21 18 class TemplateEntryTest { 22 23 /**24 * Setup rule.25 */26 @RegisterExtension27 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")28 public JOSMTestRules test = new JOSMTestRules();29 30 19 /** 31 20 * Unit test of methods {@link TemplateEntry#equals} and {@link TemplateEntry#hashCode}, including all subclasses. -
trunk/test/unit/org/openstreetmap/josm/tools/template_engine/TemplateParserTest.java
r18690 r18853 8 8 import java.util.List; 9 9 10 import org.junit.jupiter.api.BeforeAll;11 10 import org.junit.jupiter.api.Test; 12 import org.openstreetmap.josm.JOSMFixture;13 11 import org.openstreetmap.josm.data.osm.Node; 14 12 import org.openstreetmap.josm.data.osm.Relation; … … 23 21 */ 24 22 class TemplateParserTest { 25 26 /**27 * Setup test.28 */29 @BeforeAll30 public static void setUp() {31 JOSMFixture.createUnitTestFixture().init();32 }33 34 23 /** 35 24 * Test to parse an empty string.
Note:
See TracChangeset
for help on using the changeset viewer.