Ignore:
Timestamp:
2021-07-16T09:16:33+02:00 (3 years ago)
Author:
Don-vip
Message:

fix #21064 - Add JUnit 5 extension for preferences (patch by taylor.smock)

Location:
trunk/test/unit/org/openstreetmap/josm
Files:
4 added
162 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/actions/ExpertToggleActionTest.java

    r17275 r18037  
    99import javax.swing.JPanel;
    1010
    11 import org.junit.jupiter.api.extension.RegisterExtension;
     11import org.openstreetmap.josm.actions.ExpertToggleAction.ExpertModeChangeListener;
     12import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     13
    1214import org.junit.jupiter.api.Test;
    13 import org.openstreetmap.josm.actions.ExpertToggleAction.ExpertModeChangeListener;
    14 import org.openstreetmap.josm.testutils.JOSMTestRules;
    15 
    16 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1715
    1816/**
     
    2119 * @since 11224
    2220 */
     21// We need prefs to store expert mode state.
     22@BasicPreferences
    2323class ExpertToggleActionTest {
    24     /**
    25      * We need prefs to store expert mode state.
    26      */
    27     @RegisterExtension
    28     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    29     public JOSMTestRules test = new JOSMTestRules().preferences();
    30 
    3124    /**
    3225     * Test {@link ExpertToggleAction#addVisibilitySwitcher(java.awt.Component)}
  • trunk/test/unit/org/openstreetmap/josm/command/AddCommandTest.java

    r17275 r18037  
    77import java.util.ArrayList;
    88
    9 import org.junit.jupiter.api.extension.RegisterExtension;
    10 import org.junit.jupiter.api.Test;
    119import org.openstreetmap.josm.TestUtils;
    1210import org.openstreetmap.josm.data.coor.LatLon;
     
    1816import org.openstreetmap.josm.data.osm.Way;
    1917import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    20 import org.openstreetmap.josm.testutils.JOSMTestRules;
     18import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     19import org.openstreetmap.josm.testutils.annotations.I18n;
    2120
    22 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    2321import nl.jqno.equalsverifier.EqualsVerifier;
    2422import nl.jqno.equalsverifier.Warning;
     23import org.junit.jupiter.api.Test;
    2524
    2625/**
    2726 * Unit tests of {@link AddCommand} class.
    2827 */
     28@I18n
     29// We need prefs for nodes.
     30@BasicPreferences
    2931class AddCommandTest {
    30 
    31     /**
    32      * We need prefs for nodes.
    33      */
    34     @RegisterExtension
    35     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    36     public JOSMTestRules test = new JOSMTestRules().preferences().i18n();
    37 
    3832    /**
    3933     * Test if the add command is executed correctly and sets the modified flag.
  • trunk/test/unit/org/openstreetmap/josm/command/AddPrimitivesCommandTest.java

    r17296 r18037  
    1212import java.util.List;
    1313
    14 import org.junit.jupiter.api.Test;
    15 import org.junit.jupiter.api.extension.RegisterExtension;
    1614import org.openstreetmap.josm.TestUtils;
    1715import org.openstreetmap.josm.data.coor.LatLon;
     
    2523import org.openstreetmap.josm.data.osm.WayData;
    2624import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    27 import org.openstreetmap.josm.testutils.JOSMTestRules;
    28 
    29 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     25import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     26import org.openstreetmap.josm.testutils.annotations.I18n;
     27
    3028import nl.jqno.equalsverifier.EqualsVerifier;
    3129import nl.jqno.equalsverifier.Warning;
     30import org.junit.jupiter.api.Test;
    3231
    3332/**
    3433 * Unit tests of {@link AddPrimitivesCommand} class.
    3534 */
     35@I18n
     36// We need prefs for nodes.
     37@BasicPreferences
    3638class AddPrimitivesCommandTest {
    37 
    38     /**
    39      * We need prefs for nodes.
    40      */
    41     @RegisterExtension
    42     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    43     public JOSMTestRules test = new JOSMTestRules().preferences().i18n();
    44 
    4539    /**
    4640     * Test if the add command is executed correctly and does not set the modified flag.
  • trunk/test/unit/org/openstreetmap/josm/command/ChangeCommandTest.java

    r17275 r18037  
    55import static org.junit.jupiter.api.Assertions.assertEquals;
    66import static org.junit.jupiter.api.Assertions.assertNull;
     7import static org.junit.jupiter.api.Assertions.assertThrows;
    78import static org.junit.jupiter.api.Assertions.assertTrue;
    8 import static org.junit.jupiter.api.Assertions.assertThrows;
    99
    1010import java.util.ArrayList;
     
    1212import java.util.List;
    1313
    14 import org.junit.jupiter.api.BeforeEach;
    15 import org.junit.jupiter.api.Test;
    16 import org.junit.jupiter.api.extension.RegisterExtension;
    1714import org.openstreetmap.josm.TestUtils;
    1815import org.openstreetmap.josm.command.CommandTest.CommandTestData;
     
    2623import org.openstreetmap.josm.data.osm.Way;
    2724import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    28 import org.openstreetmap.josm.testutils.JOSMTestRules;
     25import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     26import org.openstreetmap.josm.testutils.annotations.I18n;
    2927
    30 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    3128import nl.jqno.equalsverifier.EqualsVerifier;
    3229import nl.jqno.equalsverifier.Warning;
     30import org.junit.jupiter.api.BeforeEach;
     31import org.junit.jupiter.api.Test;
    3332
    3433/**
    3534 * Unit tests of {@link ChangeCommand} class.
    3635 */
     36@I18n
     37// We need prefs for nodes.
     38@BasicPreferences
    3739class ChangeCommandTest {
    38 
    39     /**
    40      * We need prefs for nodes.
    41      */
    42     @RegisterExtension
    43     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    44     public JOSMTestRules test = new JOSMTestRules().preferences().i18n();
    4540    private CommandTestData testData;
    4641
  • trunk/test/unit/org/openstreetmap/josm/command/ChangeMembersCommandTest.java

    r17275 r18037  
    88import java.util.List;
    99
    10 import org.junit.jupiter.api.BeforeEach;
    11 import org.junit.jupiter.api.Test;
    12 import org.junit.jupiter.api.extension.RegisterExtension;
    1310import org.openstreetmap.josm.TestUtils;
    1411import org.openstreetmap.josm.command.CommandTest.CommandTestDataWithRelation;
     
    1916import org.openstreetmap.josm.data.osm.User;
    2017import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    21 import org.openstreetmap.josm.testutils.JOSMTestRules;
     18import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     19import org.openstreetmap.josm.testutils.annotations.I18n;
    2220
    23 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    2421import nl.jqno.equalsverifier.EqualsVerifier;
    2522import nl.jqno.equalsverifier.Warning;
     23import org.junit.jupiter.api.BeforeEach;
     24import org.junit.jupiter.api.Test;
    2625
    2726/**
    2827 * Unit tests of {@link ChangeMembersCommand} class.
    2928 */
     29@I18n
     30// We need prefs for nodes.
     31@BasicPreferences
    3032class ChangeMembersCommandTest {
    31 
    32     /**
    33      * We need prefs for nodes.
    34      */
    35     @RegisterExtension
    36     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    37     public JOSMTestRules test = new JOSMTestRules().preferences().i18n();
    3833    private CommandTestDataWithRelation testData;
    3934
  • trunk/test/unit/org/openstreetmap/josm/command/ChangeNodesCommandTest.java

    r17275 r18037  
    55import static org.junit.jupiter.api.Assertions.assertEquals;
    66import static org.junit.jupiter.api.Assertions.assertFalse;
     7import static org.junit.jupiter.api.Assertions.assertThrows;
    78import static org.junit.jupiter.api.Assertions.assertTrue;
    8 import static org.junit.jupiter.api.Assertions.assertThrows;
    99
    1010import java.util.ArrayList;
     
    1313import java.util.List;
    1414
    15 import org.junit.jupiter.api.BeforeEach;
    16 import org.junit.jupiter.api.Test;
    17 import org.junit.jupiter.api.extension.RegisterExtension;
    1815import org.openstreetmap.josm.TestUtils;
    1916import org.openstreetmap.josm.command.CommandTest.CommandTestData;
     
    2522import org.openstreetmap.josm.data.osm.Way;
    2623import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    27 import org.openstreetmap.josm.testutils.JOSMTestRules;
     24import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     25import org.openstreetmap.josm.testutils.annotations.I18n;
    2826
    29 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    3027import nl.jqno.equalsverifier.EqualsVerifier;
    3128import nl.jqno.equalsverifier.Warning;
     29import org.junit.jupiter.api.BeforeEach;
     30import org.junit.jupiter.api.Test;
    3231
    3332/**
    3433 * Unit tests of {@link ChangeNodesCommand} class.
    3534 */
     35@I18n
     36// We need prefs for nodes.
     37@BasicPreferences
    3638class ChangeNodesCommandTest {
    37 
    38     /**
    39      * We need prefs for nodes.
    40      */
    41     @RegisterExtension
    42     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    43     public JOSMTestRules test = new JOSMTestRules().preferences().i18n();
    4439    private CommandTestData testData;
    4540
  • trunk/test/unit/org/openstreetmap/josm/command/ChangePropertyCommandTest.java

    r17275 r18037  
    1414import java.util.List;
    1515
    16 import org.junit.jupiter.api.BeforeEach;
    17 import org.junit.jupiter.api.Test;
    18 import org.junit.jupiter.api.extension.RegisterExtension;
    1916import org.openstreetmap.josm.TestUtils;
    2017import org.openstreetmap.josm.command.CommandTest.CommandTestData;
     
    2724import org.openstreetmap.josm.data.osm.Way;
    2825import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    29 import org.openstreetmap.josm.testutils.JOSMTestRules;
    30 
    31 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     26import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     27import org.openstreetmap.josm.testutils.annotations.I18n;
     28
    3229import nl.jqno.equalsverifier.EqualsVerifier;
    3330import nl.jqno.equalsverifier.Warning;
     31import org.junit.jupiter.api.BeforeEach;
     32import org.junit.jupiter.api.Test;
    3433
    3534/**
    3635 * Unit tests of {@link ChangePropertyCommand} class.
    3736 */
     37@I18n
     38// We need prefs for nodes.
     39@BasicPreferences
    3840class ChangePropertyCommandTest {
    39 
    40     /**
    41      * We need prefs for nodes.
    42      */
    43     @RegisterExtension
    44     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    45     public JOSMTestRules test = new JOSMTestRules().preferences().i18n();
    4641    private CommandTestData testData;
    4742
  • trunk/test/unit/org/openstreetmap/josm/command/ChangePropertyKeyCommandTest.java

    r17275 r18037  
    1111import java.util.Collection;
    1212
    13 import org.junit.jupiter.api.BeforeEach;
    14 import org.junit.jupiter.api.Test;
    15 import org.junit.jupiter.api.extension.RegisterExtension;
    1613import org.openstreetmap.josm.TestUtils;
    1714import org.openstreetmap.josm.command.CommandTest.CommandTestData;
     
    2118import org.openstreetmap.josm.data.osm.User;
    2219import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    23 import org.openstreetmap.josm.testutils.JOSMTestRules;
     20import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     21import org.openstreetmap.josm.testutils.annotations.I18n;
    2422
    25 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    2623import nl.jqno.equalsverifier.EqualsVerifier;
    2724import nl.jqno.equalsverifier.Warning;
     25import org.junit.jupiter.api.BeforeEach;
     26import org.junit.jupiter.api.Test;
    2827
    2928/**
    3029 * Unit tests of {@link ChangePropertyKeyCommand} class.
    3130 */
     31@I18n
     32// We need prefs for nodes.
     33@BasicPreferences
    3234class ChangePropertyKeyCommandTest {
    33 
    34     /**
    35      * We need prefs for nodes.
    36      */
    37     @RegisterExtension
    38     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    39     public JOSMTestRules test = new JOSMTestRules().preferences().i18n();
    4035    private CommandTestData testData;
    4136
  • trunk/test/unit/org/openstreetmap/josm/command/ChangeRelationMemberRoleCommandTest.java

    r17275 r18037  
    1010import java.util.ArrayList;
    1111
    12 import org.junit.jupiter.api.BeforeEach;
    13 import org.junit.jupiter.api.Test;
    14 import org.junit.jupiter.api.extension.RegisterExtension;
    1512import org.openstreetmap.josm.TestUtils;
    1613import org.openstreetmap.josm.command.CommandTest.CommandTestDataWithRelation;
     
    2017import org.openstreetmap.josm.data.osm.User;
    2118import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    22 import org.openstreetmap.josm.testutils.JOSMTestRules;
     19import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     20import org.openstreetmap.josm.testutils.annotations.I18n;
    2321
    24 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    2522import nl.jqno.equalsverifier.EqualsVerifier;
    2623import nl.jqno.equalsverifier.Warning;
     24import org.junit.jupiter.api.BeforeEach;
     25import org.junit.jupiter.api.Test;
    2726
    2827/**
    2928 * Unit tests of {@link ChangeRelationMemberRoleCommand} class.
    3029 */
     30@I18n
     31// We need prefs for nodes.
     32@BasicPreferences
    3133class ChangeRelationMemberRoleCommandTest {
    32 
    33     /**
    34      * We need prefs for nodes.
    35      */
    36     @RegisterExtension
    37     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    38     public JOSMTestRules test = new JOSMTestRules().preferences().i18n();
    3934    private CommandTestDataWithRelation testData;
    4035
  • trunk/test/unit/org/openstreetmap/josm/command/CommandTest.java

    r17275 r18037  
    44import java.util.Arrays;
    55
    6 import org.junit.jupiter.api.Test;
    7 import org.junit.jupiter.api.extension.RegisterExtension;
    86import org.openstreetmap.josm.TestUtils;
    97import org.openstreetmap.josm.data.coor.LatLon;
     
    1614import org.openstreetmap.josm.gui.MainApplication;
    1715import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    18 import org.openstreetmap.josm.testutils.JOSMTestRules;
     16import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     17import org.openstreetmap.josm.testutils.annotations.I18n;
    1918
    20 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    2119import nl.jqno.equalsverifier.EqualsVerifier;
    2220import nl.jqno.equalsverifier.Warning;
     21import org.junit.jupiter.api.Test;
    2322
    2423/**
    2524 * Unit tests of {@link Command} class.
    2625 */
     26@I18n
     27// We need prefs for nodes / data sets.
     28@BasicPreferences
    2729public class CommandTest {
    28 
    29     /**
    30      * We need prefs for nodes / data sets.
    31      */
    32     @RegisterExtension
    33     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    34     public JOSMTestRules test = new JOSMTestRules().preferences().i18n();
    35 
    3630    /**
    3731     * Unit test of methods {@link Command#equals} and {@link Command#hashCode}.
  • trunk/test/unit/org/openstreetmap/josm/command/DeleteCommandTest.java

    r17275 r18037  
    55import static org.junit.jupiter.api.Assertions.assertEquals;
    66import static org.junit.jupiter.api.Assertions.assertFalse;
     7import static org.junit.jupiter.api.Assertions.assertThrows;
    78import static org.junit.jupiter.api.Assertions.assertTrue;
    8 import static org.junit.jupiter.api.Assertions.assertThrows;
    99
    1010import java.util.ArrayList;
     
    1414import java.util.NoSuchElementException;
    1515
    16 import org.junit.jupiter.api.BeforeEach;
    17 import org.junit.jupiter.api.Test;
    18 import org.junit.jupiter.api.extension.RegisterExtension;
    1916import org.openstreetmap.josm.TestUtils;
    2017import org.openstreetmap.josm.command.CommandTest.CommandTestDataWithRelation;
     
    2724import org.openstreetmap.josm.data.osm.WaySegment;
    2825import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    29 import org.openstreetmap.josm.testutils.JOSMTestRules;
    30 
    31 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     26import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     27import org.openstreetmap.josm.testutils.annotations.I18n;
     28
    3229import nl.jqno.equalsverifier.EqualsVerifier;
    3330import nl.jqno.equalsverifier.Warning;
     31import org.junit.jupiter.api.BeforeEach;
     32import org.junit.jupiter.api.Test;
    3433
    3534/**
    3635 * Unit tests of {@link DeleteCommand} class.
    3736 */
     37// We need prefs for nodes.
     38@BasicPreferences
     39@I18n
    3840class DeleteCommandTest {
    39 
    40     /**
    41      * We need prefs for nodes.
    42      */
    43     @RegisterExtension
    44     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    45     public JOSMTestRules test = new JOSMTestRules().preferences().i18n();
    4641    private CommandTestDataWithRelation testData;
    4742
  • trunk/test/unit/org/openstreetmap/josm/command/PurgeCommandTest.java

    r17333 r18037  
    1313import java.util.List;
    1414
    15 import org.junit.jupiter.api.BeforeEach;
    16 import org.junit.jupiter.api.Test;
    17 import org.junit.jupiter.api.extension.RegisterExtension;
    1815import org.openstreetmap.josm.TestUtils;
    1916import org.openstreetmap.josm.command.CommandTest.CommandTestDataWithRelation;
     
    2825import org.openstreetmap.josm.data.osm.User;
    2926import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    30 import org.openstreetmap.josm.testutils.JOSMTestRules;
     27import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    3128
    32 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    3329import nl.jqno.equalsverifier.EqualsVerifier;
    3430import nl.jqno.equalsverifier.Warning;
     31import org.junit.jupiter.api.BeforeEach;
     32import org.junit.jupiter.api.Test;
    3533
    3634/**
    3735 * Unit tests of {@link PurgeCommand} class.
    3836 */
     37// We need prefs for nodes.
     38@BasicPreferences
    3939class PurgeCommandTest {
    40     /**
    41      * We need prefs for nodes.
    42      */
    43     @RegisterExtension
    44     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    45     public JOSMTestRules test = new JOSMTestRules().preferences();
    4640    private CommandTestDataWithRelation testData;
    4741
  • trunk/test/unit/org/openstreetmap/josm/command/RemoveNodesCommandTest.java

    r17275 r18037  
    99import java.util.Collections;
    1010
    11 import org.junit.jupiter.api.BeforeEach;
    12 import org.junit.jupiter.api.Test;
    13 import org.junit.jupiter.api.extension.RegisterExtension;
    1411import org.openstreetmap.josm.TestUtils;
    1512import org.openstreetmap.josm.command.CommandTest.CommandTestDataWithRelation;
     
    1916import org.openstreetmap.josm.data.osm.Way;
    2017import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    21 import org.openstreetmap.josm.testutils.JOSMTestRules;
     18import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2219
    23 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    2420import nl.jqno.equalsverifier.EqualsVerifier;
    2521import nl.jqno.equalsverifier.Warning;
     22import org.junit.jupiter.api.BeforeEach;
     23import org.junit.jupiter.api.Test;
    2624
    2725/**
    2826 * Unit tests of {@link RemoveNodesCommand} class.
    2927 */
     28// We need prefs for nodes.
     29@BasicPreferences
    3030class RemoveNodesCommandTest {
    31 
    32     /**
    33      * We need prefs for nodes.
    34      */
    35     @RegisterExtension
    36     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    37     public JOSMTestRules test = new JOSMTestRules().preferences();
    3831    private CommandTestDataWithRelation testData;
    3932
  • trunk/test/unit/org/openstreetmap/josm/command/SelectCommandTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertArrayEquals;
    55import static org.junit.jupiter.api.Assertions.assertFalse;
     6import static org.junit.jupiter.api.Assertions.assertThrows;
    67import static org.junit.jupiter.api.Assertions.assertTrue;
    7 import static org.junit.jupiter.api.Assertions.assertThrows;
    88
    99import java.util.ArrayList;
     
    1111import java.util.List;
    1212
    13 import org.junit.jupiter.api.BeforeEach;
    14 import org.junit.jupiter.api.Test;
    15 import org.junit.jupiter.api.extension.RegisterExtension;
    1613import org.openstreetmap.josm.TestUtils;
    1714import org.openstreetmap.josm.command.CommandTest.CommandTestDataWithRelation;
     
    2017import org.openstreetmap.josm.data.osm.User;
    2118import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    22 import org.openstreetmap.josm.testutils.JOSMTestRules;
     19import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2320
    24 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    2521import nl.jqno.equalsverifier.EqualsVerifier;
    2622import nl.jqno.equalsverifier.Warning;
     23import org.junit.jupiter.api.BeforeEach;
     24import org.junit.jupiter.api.Test;
    2725
    2826/**
    2927 * Unit tests of {@link SelectCommand} class.
    3028 */
     29// We need prefs for nodes.
     30@BasicPreferences
    3131class SelectCommandTest {
    32 
    33     /**
    34      * We need prefs for nodes.
    35      */
    36     @RegisterExtension
    37     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    38     public JOSMTestRules test = new JOSMTestRules().preferences();
    3932    private CommandTestDataWithRelation testData;
    4033
  • trunk/test/unit/org/openstreetmap/josm/command/SequenceCommandTest.java

    r17275 r18037  
    1919import java.util.Collections;
    2020
    21 import org.junit.jupiter.api.BeforeEach;
    22 import org.junit.jupiter.api.Test;
    23 import org.junit.jupiter.api.extension.RegisterExtension;
    2421import org.openstreetmap.josm.TestUtils;
    2522import org.openstreetmap.josm.command.CommandTest.CommandTestDataWithRelation;
     
    2926import org.openstreetmap.josm.data.osm.User;
    3027import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    31 import org.openstreetmap.josm.testutils.JOSMTestRules;
     28import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    3229import org.openstreetmap.josm.tools.bugreport.ReportedException;
    3330
    34 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    3531import nl.jqno.equalsverifier.EqualsVerifier;
    3632import nl.jqno.equalsverifier.Warning;
     33import org.junit.jupiter.api.BeforeEach;
     34import org.junit.jupiter.api.Test;
    3735
    3836/**
    3937 * Unit tests of {@link SequenceCommand} class.
    4038 */
     39// We need prefs for nodes.
     40@BasicPreferences
    4141class SequenceCommandTest {
    42 
    43     /**
    44      * We need prefs for nodes.
    45      */
    46     @RegisterExtension
    47     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    48     public JOSMTestRules test = new JOSMTestRules().preferences();
    4942    private CommandTestDataWithRelation testData;
    5043
  • trunk/test/unit/org/openstreetmap/josm/data/PreferencesUtilsTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertEquals;
    55
     6import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     7
     8import net.trajano.commons.testing.UtilityClassTestUtil;
    69import org.junit.jupiter.api.BeforeEach;
    710import org.junit.jupiter.api.Test;
    8 import org.junit.jupiter.api.extension.RegisterExtension;
    9 import org.openstreetmap.josm.testutils.JOSMTestRules;
    10 
    11 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    12 import net.trajano.commons.testing.UtilityClassTestUtil;
    1311
    1412/**
    1513 * Unit tests for class {@link PreferencesUtils}.
    1614 */
     15@BasicPreferences
    1716class PreferencesUtilsTest {
    18 
    19     /**
    20      * Setup test.
    21      */
    22     @RegisterExtension
    23     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    24     public JOSMTestRules test = new JOSMTestRules().preferences();
    25 
    2617    /**
    2718     * Setup test.
  • trunk/test/unit/org/openstreetmap/josm/data/UserIdentityManagerTest.java

    r17275 r18037  
    77import static org.junit.jupiter.api.Assertions.assertNull;
    88import static org.junit.jupiter.api.Assertions.assertSame;
     9import static org.junit.jupiter.api.Assertions.assertThrows;
    910import static org.junit.jupiter.api.Assertions.assertTrue;
    10 import static org.junit.jupiter.api.Assertions.assertThrows;
    11 
    12 import org.junit.jupiter.api.Test;
    13 import org.junit.jupiter.api.extension.RegisterExtension;
     11import static org.junit.jupiter.api.Assertions.fail;
     12
     13import java.util.function.Function;
     14import java.util.stream.Stream;
     15
    1416import org.openstreetmap.josm.data.osm.User;
    1517import org.openstreetmap.josm.data.osm.UserInfo;
    1618import org.openstreetmap.josm.spi.preferences.Config;
    17 import org.openstreetmap.josm.testutils.JOSMTestRules;
     19import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1820
    1921import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     22import org.junit.jupiter.api.Test;
     23import org.junit.jupiter.params.ParameterizedTest;
     24import org.junit.jupiter.params.provider.Arguments;
     25import org.junit.jupiter.params.provider.MethodSource;
    2026
    2127/**
    2228 * Unit tests of {@link UserIdentityManager} class.
    2329 */
     30@BasicPreferences
    2431class UserIdentityManagerTest {
    25 
    26     /**
    27      * Setup test.
    28      */
    29     @RegisterExtension
    30     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    31     public JOSMTestRules test = new JOSMTestRules().preferences();
    32 
    3332    private static UserInfo newUserInfo() {
    3433        return newUserInfo(1, "a description");
     
    180179    }
    181180
    182     /**
    183      * Preferences include neither an url nor a user name => we have an anonymous user
    184      */
    185     @Test
    186     void testInitFromPreferences1() {
     181    static Stream<Arguments> testInitFromPreferences() {
     182        return Stream.of(
     183          Arguments.of((Function<UserIdentityManager, Boolean>) UserIdentityManager::isAnonymous,
     184            new String[] {"osm-server.url", null, "osm-server.username", null},
     185            "Preferences include neither an url nor a user name => we have an anonymous user"),
     186          Arguments.of((Function<UserIdentityManager, Boolean>) UserIdentityManager::isAnonymous,
     187            new String[] {"osm-server.url", "http://api.openstreetmap.org", "osm-server.username", null},
     188            "Preferences include neither an url nor a user name => we have an anonymous user"),
     189          Arguments.of((Function<UserIdentityManager, Boolean>) UserIdentityManager::isPartiallyIdentified,
     190            new String[] {"osm-server.url", "http://api.openstreetmap.org", "osm-server.username", "test"},
     191            "Preferences include an user name => we have a partially identified user")
     192        );
     193    }
     194
     195    @ParameterizedTest
     196    @MethodSource
     197    void testInitFromPreferences(Function<UserIdentityManager, Boolean> verifier, String[] config, String failureMessage) {
     198        if (config.length % 2 != 0) {
     199            fail("The arguments must be paired");
     200        }
    187201        UserIdentityManager im = UserIdentityManager.getInstance();
    188202
     
    194208
    195209        try {
    196             Config.getPref().put("osm-server.url", null);
    197             Config.getPref().put("osm-server.username", null);
     210            for (int i = 0; i < config.length / 2; i++) {
     211                Config.getPref().put(config[2 * i], config[2 * i + 1]);
     212            }
    198213
    199214            im.initFromPreferences();
    200215
    201             assertTrue(im.isAnonymous());
     216            assertTrue(verifier.apply(im), failureMessage);
    202217        } finally {
    203218            Config.getPref().addPreferenceChangeListener(im);
     
    206221
    207222    /**
    208      * Preferences include neither an url nor a user name => we have an anonymous user
    209      */
    210     @Test
    211     void testInitFromPreferences2() {
    212         UserIdentityManager im = UserIdentityManager.getInstance();
    213 
    214         // reset it
    215         im.setAnonymous();
     223     * Preferences include an user name which is different from the current
     224     * user name and we are currently fully identifed => josm user becomes
     225     * partially identified
     226     *
     227     * Note: Test #4 since the other three are parameterized
     228     */
     229    @Test
     230    void testInitFromPreferences4() {
     231        UserIdentityManager im = UserIdentityManager.getInstance();
    216232
    217233        // for this test we disable the listener
     
    219235
    220236        try {
     237            im.setFullyIdentified("test1", newUserInfo());
     238
    221239            Config.getPref().put("osm-server.url", "http://api.openstreetmap.org");
    222             Config.getPref().put("osm-server.username", null);
    223 
    224             im.initFromPreferences();
    225 
    226             assertTrue(im.isAnonymous());
    227         } finally {
    228             Config.getPref().addPreferenceChangeListener(im);
    229         }
    230     }
    231 
    232     /**
    233      * Preferences include an user name => we have a partially identified user
    234      */
    235     @Test
    236     void testInitFromPreferences3() {
    237         UserIdentityManager im = UserIdentityManager.getInstance();
    238 
    239         // for this test we disable the listener
    240         Config.getPref().removePreferenceChangeListener(im);
    241 
    242         try {
    243             // reset it
    244             im.setAnonymous();
    245 
    246             Config.getPref().put("osm-server.url", "http://api.openstreetmap.org");
    247             Config.getPref().put("osm-server.username", "test");
     240            Config.getPref().put("osm-server.username", "test2");
    248241
    249242            im.initFromPreferences();
     
    256249
    257250    /**
    258      * Preferences include an user name which is different from the current
    259      * user name and we are currently fully identifed => josm user becomes
    260      * partially identified
    261      */
    262     @Test
    263     void testInitFromPreferences4() {
    264         UserIdentityManager im = UserIdentityManager.getInstance();
    265 
    266         // for this test we disable the listener
    267         Config.getPref().removePreferenceChangeListener(im);
    268 
    269         try {
    270             im.setFullyIdentified("test1", newUserInfo());
    271 
    272             Config.getPref().put("osm-server.url", "http://api.openstreetmap.org");
    273             Config.getPref().put("osm-server.username", "test2");
    274 
    275             im.initFromPreferences();
    276 
    277             assertTrue(im.isPartiallyIdentified());
    278         } finally {
    279             Config.getPref().addPreferenceChangeListener(im);
    280         }
    281     }
    282 
    283     /**
    284251     * Preferences include an user name which is the same as the current
    285252     * user name and we are currently fully identifed => josm user remains
  • trunk/test/unit/org/openstreetmap/josm/data/cache/JCSCacheManagerTest.java

    r17275 r18037  
    99import java.util.logging.Logger;
    1010
     11import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     12
     13import net.trajano.commons.testing.UtilityClassTestUtil;
    1114import org.apache.commons.jcs3.access.CacheAccess;
    1215import org.apache.commons.jcs3.auxiliary.disk.block.BlockDiskCacheAttributes;
    1316import org.junit.jupiter.api.Test;
    14 import org.junit.jupiter.api.extension.RegisterExtension;
    15 import org.openstreetmap.josm.testutils.JOSMTestRules;
    16 
    17 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    18 import net.trajano.commons.testing.UtilityClassTestUtil;
     17import org.junit.jupiter.api.Timeout;
    1918
    2019/**
    2120 * Unit tests for class {@link JCSCacheManager}.
    2221 */
     22@Timeout(20)
     23@BasicPreferences
    2324class JCSCacheManagerTest {
    24 
    25     /**
    26      * Setup test.
    27      */
    28     @RegisterExtension
    29     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    30     public JOSMTestRules test = new JOSMTestRules().preferences().timeout(20000);
    31 
    3225    /**
    3326     * Tests that {@code JCSCacheManager} satisfies utility class criteria.
  • trunk/test/unit/org/openstreetmap/josm/data/osm/TagCollectionTest.java

    r17275 r18037  
    1717import java.util.stream.Stream;
    1818
     19import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     20
    1921import org.junit.jupiter.api.Test;
    20 import org.junit.jupiter.api.extension.RegisterExtension;
    21 import org.openstreetmap.josm.testutils.JOSMTestRules;
    22 
    23 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    2422
    2523/**
     
    2725 * @author Michael Zangl
    2826 */
     27// We need prefs for using primitives
     28@BasicPreferences
    2929class TagCollectionTest {
    3030    private final Tag tagA = new Tag("k", "v");
     
    3535    private final Tag tagNullKey = new Tag(null, "b");
    3636    private final Tag tagNullValue = new Tag("k2", null);
    37 
    38     /**
    39      * We need prefs for using primitives
    40      */
    41     @RegisterExtension
    42     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    43     public JOSMTestRules test = new JOSMTestRules().preferences();
    4437
    4538    private void assertTagCounts(TagCollection collection, int a, int b, int c, int d) {
  • trunk/test/unit/org/openstreetmap/josm/data/osm/event/SelectionEventManagerTest.java

    r17275 r18037  
    99import java.util.List;
    1010
    11 import org.junit.jupiter.api.Test;
    12 import org.junit.jupiter.api.extension.RegisterExtension;
    1311import org.openstreetmap.josm.command.CommandTest.CommandTestDataWithRelation;
    1412import org.openstreetmap.josm.data.osm.DataSelectionListener;
     
    1614import org.openstreetmap.josm.gui.MainApplication;
    1715import org.openstreetmap.josm.gui.util.GuiHelper;
    18 import org.openstreetmap.josm.testutils.JOSMTestRules;
     16import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1917
    20 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     18import org.junit.jupiter.api.Test;
    2119
    2220/**
     
    2523 * @since 12048
    2624 */
     25@BasicPreferences
    2726class SelectionEventManagerTest {
    2827    private final class SelectionListener implements DataSelectionListener {
     
    3938        }
    4039    }
    41 
    42     /**
    43      */
    44     @RegisterExtension
    45     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    46     public JOSMTestRules test = new JOSMTestRules().preferences();
    4740
    4841    /**
  • trunk/test/unit/org/openstreetmap/josm/data/osm/search/SearchCompilerTest.java

    r17749 r18037  
    1919import java.util.Set;
    2020
    21 import org.junit.Assert;
    22 import org.junit.jupiter.api.Test;
    23 import org.junit.jupiter.api.extension.RegisterExtension;
    2421import org.openstreetmap.josm.TestUtils;
    2522import org.openstreetmap.josm.data.coor.LatLon;
     
    4340import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets;
    4441import org.openstreetmap.josm.gui.tagging.presets.items.Key;
    45 import org.openstreetmap.josm.testutils.JOSMTestRules;
     42import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    4643import org.openstreetmap.josm.tools.Logging;
    4744
    48 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    4945import nl.jqno.equalsverifier.EqualsVerifier;
    5046import nl.jqno.equalsverifier.Warning;
     47import org.junit.Assert;
     48import org.junit.jupiter.api.Test;
     49import org.junit.jupiter.api.Timeout;
    5150
    5251/**
    5352 * Unit tests for class {@link SearchCompiler}.
    5453 */
     54// We need prefs for this. We access preferences when creating OSM primitives
     55@BasicPreferences
     56@Timeout(30)
    5557class SearchCompilerTest {
    56 
    57     /**
    58      * We need prefs for this. We access preferences when creating OSM primitives.
    59      */
    60     @RegisterExtension
    61     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    62     public JOSMTestRules test = new JOSMTestRules().preferences().timeout(30000);
    63 
    6458    private static final class SearchContext {
    6559        final DataSet ds = new DataSet();
  • trunk/test/unit/org/openstreetmap/josm/data/preferences/NamedColorPropertyTest.java

    r17275 r18037  
    1111import javax.swing.UIManager;
    1212
     13import org.openstreetmap.josm.data.Preferences;
     14import org.openstreetmap.josm.spi.preferences.Config;
     15import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     16
    1317import org.junit.jupiter.api.BeforeEach;
    1418import org.junit.jupiter.api.Test;
    15 import org.junit.jupiter.api.extension.RegisterExtension;
    16 import org.openstreetmap.josm.data.Preferences;
    17 import org.openstreetmap.josm.spi.preferences.Config;
    18 import org.openstreetmap.josm.testutils.JOSMTestRules;
    19 
    20 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    2119
    2220/**
     
    2422 * @author Michael Zangl
    2523 */
     24// This is a preference test
     25@BasicPreferences
    2626class NamedColorPropertyTest {
    27     /**
    28      * This is a preference test.
    29      */
    30     @RegisterExtension
    31     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    32     public JOSMTestRules test = new JOSMTestRules().preferences();
    3327    private NamedColorProperty base;
    3428
  • trunk/test/unit/org/openstreetmap/josm/data/preferences/PreferencesWriterTest.java

    r17275 r18037  
    1313import java.util.TreeMap;
    1414
    15 import org.junit.jupiter.api.Test;
    1615import org.openstreetmap.josm.data.Version;
    17 import org.openstreetmap.josm.spi.preferences.Setting;
     16import org.openstreetmap.josm.spi.preferences.AbstractSetting;
    1817import org.openstreetmap.josm.spi.preferences.ListListSetting;
    1918import org.openstreetmap.josm.spi.preferences.ListSetting;
    20 import org.openstreetmap.josm.spi.preferences.AbstractSetting;
     19import org.openstreetmap.josm.spi.preferences.MapListSetting;
     20import org.openstreetmap.josm.spi.preferences.Setting;
    2121import org.openstreetmap.josm.spi.preferences.StringSetting;
    22 import org.openstreetmap.josm.spi.preferences.MapListSetting;
     22import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     23
     24import org.junit.jupiter.api.Test;
    2325
    2426/**
    2527 * Unit tests for class {@link PreferencesWriter}.
    2628 */
     29// This is a preference test
     30@BasicPreferences
    2731class PreferencesWriterTest {
    2832
  • trunk/test/unit/org/openstreetmap/josm/data/preferences/StrokePropertyTest.java

    r17275 r18037  
    77import java.awt.BasicStroke;
    88
    9 import org.junit.jupiter.api.extension.RegisterExtension;
     9import org.openstreetmap.josm.spi.preferences.Config;
     10import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     11
    1012import org.junit.jupiter.api.Test;
    11 import org.openstreetmap.josm.spi.preferences.Config;
    12 import org.openstreetmap.josm.testutils.JOSMTestRules;
    13 
    14 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1513
    1614/**
     
    1816 * @author Michael Zangl
    1917 */
     18// This is a preference test
     19@BasicPreferences
    2020class StrokePropertyTest {
    21     /**
    22      * This is a preference test
    23      */
    24     @RegisterExtension
    25     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    26     public JOSMTestRules test = new JOSMTestRules().preferences();
    27 
    2821    /**
    2922     * Test {@link StrokeProperty#get()}
  • trunk/test/unit/org/openstreetmap/josm/data/projection/CustomProjectionTest.java

    r17275 r18037  
    88import java.util.stream.Stream;
    99
    10 import org.junit.jupiter.api.extension.RegisterExtension;
    11 import org.junit.jupiter.api.Test;
    1210import org.openstreetmap.josm.data.coor.LatLon;
    1311import org.openstreetmap.josm.data.projection.CustomProjection.Polarity;
    14 import org.openstreetmap.josm.testutils.JOSMTestRules;
     12import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1513
    16 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     14import org.junit.jupiter.api.Test;
    1715
    1816/**
     
    2018 * @author Michael Zangl
    2119 */
     20// Need pref to load pref
     21@BasicPreferences
    2222class CustomProjectionTest {
    23     /**
    24      * Need pref to load pref.
    25      */
    26     @RegisterExtension
    27     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    28     public JOSMTestRules test = new JOSMTestRules().preferences();
    29 
    3023    /**
    3124     * Test {@link CustomProjection#parseAngle(String, String)}
  • trunk/test/unit/org/openstreetmap/josm/data/protobuf/ProtobufTest.java

    r17867 r18037  
    3232import org.openstreetmap.josm.data.vector.VectorWay;
    3333import org.openstreetmap.josm.io.Compression;
    34 import org.openstreetmap.josm.testutils.JOSMTestRules;
     34import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    3535
    3636import org.junit.jupiter.api.Test;
    37 import org.junit.jupiter.api.extension.RegisterExtension;
    3837
    3938/**
     
    6059    }
    6160
    62     @RegisterExtension
    63     JOSMTestRules josmTestRules = new JOSMTestRules().preferences();
    64 
    6561    private Number bytesToVarInt(int... bytes) {
    6662        byte[] byteArray = new byte[bytes.length];
     
    108104    }
    109105
     106    @BasicPreferences
    110107    @Test
    111108    void testRead_17_26028_50060() throws IOException {
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/DuplicateRelationTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertEquals;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
    7 import org.junit.jupiter.api.Test;
    86import org.openstreetmap.josm.TestUtils;
    97import org.openstreetmap.josm.data.coor.LatLon;
     
    1311import org.openstreetmap.josm.data.validation.TestError;
    1412import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    15 import org.openstreetmap.josm.testutils.JOSMTestRules;
     13import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1614
    17 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     15import org.junit.jupiter.api.Test;
    1816
    1917/**
    2018 * JUnit Test of "Duplicate relation" validation test.
    2119 */
     20@BasicPreferences
    2221class DuplicateRelationTest {
    23 
    24     /**
    25      * Setup test by initializing JOSM preferences and projection.
    26      */
    27     @RegisterExtension
    28     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    29     public JOSMTestRules test = new JOSMTestRules().preferences();
    30 
    3122    static class ExpectedResult {
    3223        final int code;
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/OpeningHourTestTest.java

    r17591 r18037  
    1717import java.util.Set;
    1818
    19 import org.junit.jupiter.api.BeforeEach;
    20 import org.junit.jupiter.api.Test;
    21 import org.junit.jupiter.api.extension.RegisterExtension;
    2219import org.openstreetmap.josm.command.ChangePropertyCommand;
    2320import org.openstreetmap.josm.data.coor.LatLon;
     
    3229import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetReader;
    3330import org.openstreetmap.josm.gui.tagging.presets.items.KeyedItem;
    34 import org.openstreetmap.josm.testutils.JOSMTestRules;
     31import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     32import org.openstreetmap.josm.testutils.annotations.I18n;
    3533import org.openstreetmap.josm.tools.Logging;
    3634
    37 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     35import org.junit.jupiter.api.BeforeEach;
     36import org.junit.jupiter.api.Test;
    3837
    3938/**
     
    4140 * @see OpeningHourTest
    4241 */
     42@I18n
     43@BasicPreferences
    4344class OpeningHourTestTest {
    44     /**
    45      * We need preferences for this. We check strings so we need i18n.
    46      */
    47     @RegisterExtension
    48     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    49     public JOSMTestRules test = new JOSMTestRules().preferences().i18n();
    50 
    5145    private OpeningHourTest openingHourTest;
    5246
  • trunk/test/unit/org/openstreetmap/josm/data/validation/util/EntitiesTest.java

    r17275 r18037  
    22package org.openstreetmap.josm.data.validation.util;
    33
    4 import org.junit.jupiter.api.extension.RegisterExtension;
     4import net.trajano.commons.testing.UtilityClassTestUtil;
    55import 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;
    106
    117/**
     
    139 */
    1410class EntitiesTest {
    15 
    16     /**
    17      * Setup test.
    18      */
    19     @RegisterExtension
    20     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    21     public JOSMTestRules test = new JOSMTestRules();
    22 
    2311    /**
    2412     * Tests that {@code Entities} satisfies utility class criteria.
  • trunk/test/unit/org/openstreetmap/josm/data/validation/util/MultipleNameVisitorTest.java

    r17275 r18037  
    66import java.util.Arrays;
    77
    8 import org.junit.jupiter.api.extension.RegisterExtension;
    9 import org.junit.jupiter.api.Test;
    108import org.openstreetmap.josm.TestUtils;
    119import org.openstreetmap.josm.data.osm.Way;
    12 import org.openstreetmap.josm.testutils.JOSMTestRules;
     10import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1311
    14 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     12import org.junit.jupiter.api.Test;
    1513
    1614/**
    1715 * Unit tests for class {@link MultipleNameVisitor}.
    1816 */
     17@BasicPreferences
    1918class MultipleNameVisitorTest {
    20 
    21     /**
    22      * Setup test.
    23      */
    24     @RegisterExtension
    25     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    26     public JOSMTestRules test = new JOSMTestRules().preferences();
    27 
    2819    /**
    2920     * Non-regression test for bug #11967.
  • trunk/test/unit/org/openstreetmap/josm/data/vector/VectorRelationTest.java

    r17867 r18037  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.data.vector;
    3 
    4 import org.junit.jupiter.api.Test;
    5 import org.junit.jupiter.api.extension.RegisterExtension;
    6 import org.openstreetmap.josm.testutils.JOSMTestRules;
    7 
    8 import java.util.Arrays;
    93
    104import static org.junit.jupiter.api.Assertions.assertEquals;
     
    148import static org.junit.jupiter.api.Assertions.assertTrue;
    159
     10import java.util.Arrays;
     11
     12import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     13
     14import org.junit.jupiter.api.Test;
     15
    1616/**
    1717 * Test class for {@link VectorRelation}
     
    1919 * @since 17862
    2020 */
     21@BasicPreferences
    2122class VectorRelationTest {
    22     @RegisterExtension
    23     JOSMTestRules rule = new JOSMTestRules();
    24 
    2523    @Test
    2624    void testMembers() {
  • trunk/test/unit/org/openstreetmap/josm/data/vector/VectorWayTest.java

    r17867 r18037  
    22package org.openstreetmap.josm.data.vector;
    33
    4 import org.junit.jupiter.api.Test;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertFalse;
     6import static org.junit.jupiter.api.Assertions.assertNull;
     7import static org.junit.jupiter.api.Assertions.assertSame;
     8import static org.junit.jupiter.api.Assertions.assertTrue;
     9import static org.junit.jupiter.api.Assertions.fail;
     10
     11import java.util.ArrayList;
     12import java.util.Arrays;
     13import java.util.Collections;
     14import java.util.List;
     15
    516import org.openstreetmap.josm.data.coor.LatLon;
    617import org.openstreetmap.josm.data.osm.BBox;
     
    1021import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
    1122import org.openstreetmap.josm.data.osm.visitor.PrimitiveVisitor;
     23import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1224
    13 import java.util.ArrayList;
    14 import java.util.Arrays;
    15 import java.util.Collections;
    16 import java.util.List;
    17 
    18 import static org.junit.jupiter.api.Assertions.assertEquals;
    19 import static org.junit.jupiter.api.Assertions.assertFalse;
    20 import static org.junit.jupiter.api.Assertions.assertNull;
    21 import static org.junit.jupiter.api.Assertions.assertSame;
    22 import static org.junit.jupiter.api.Assertions.assertTrue;
    23 import static org.junit.jupiter.api.Assertions.fail;
     25import org.junit.jupiter.api.Test;
    2426
    2527/**
     
    5052
    5153    @Test
     54    @BasicPreferences
    5255    void testNodes() {
    5356        VectorNode node1 = new VectorNode("test");
  • trunk/test/unit/org/openstreetmap/josm/gui/autofilter/AutoFilterRuleTest.java

    r17275 r18037  
    99import java.util.stream.IntStream;
    1010
    11 import org.junit.jupiter.api.extension.RegisterExtension;
    12 import org.junit.jupiter.api.Test;
    1311import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1412import org.openstreetmap.josm.data.osm.OsmUtils;
    15 import org.openstreetmap.josm.testutils.JOSMTestRules;
     13import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     14import org.openstreetmap.josm.testutils.annotations.I18n;
    1615
    17 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     16import org.junit.jupiter.api.Test;
    1817
    1918/**
    2019 * Unit tests of {@link AutoFilterRule} class.
    2120 */
     21@BasicPreferences
     22@I18n
    2223class AutoFilterRuleTest {
    23 
    24     /**
    25      * Setup tests
    26      */
    27     @RegisterExtension
    28     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    29     public JOSMTestRules test = new JOSMTestRules().i18n();
    30 
    3124    /**
    3225     * Unit test of {@link AutoFilterRule#getTagValuesForPrimitive}.
  • trunk/test/unit/org/openstreetmap/josm/gui/bbox/SizeButtonTest.java

    r17275 r18037  
    66import static org.junit.jupiter.api.Assertions.assertTrue;
    77
    8 import org.junit.jupiter.api.extension.RegisterExtension;
    9 import org.junit.jupiter.api.Test;
    108import org.openstreetmap.josm.TestUtils;
    119import org.openstreetmap.josm.gui.bbox.SizeButton.AccessibleSizeButton;
    12 import org.openstreetmap.josm.testutils.JOSMTestRules;
     10import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1311
    14 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     12import org.junit.jupiter.api.Test;
    1513
    1614/**
    1715 * Unit tests of {@link SizeButton} class.
    1816 */
     17@BasicPreferences
    1918class SizeButtonTest {
    20 
    21     /**
    22      * Setup tests
    23      */
    24     @RegisterExtension
    25     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    26     public JOSMTestRules test = new JOSMTestRules().preferences();
    27 
    2819    /**
    2920     * Unit test of {@link SizeButton#SizeButton}.
  • trunk/test/unit/org/openstreetmap/josm/gui/bugreport/BugReportSettingsPanelTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
    7 import org.junit.jupiter.api.Test;
    8 import org.openstreetmap.josm.testutils.JOSMTestRules;
    96import org.openstreetmap.josm.tools.bugreport.BugReport;
    107
    11 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     8import org.junit.jupiter.api.Test;
    129
    1310/**
     
    1512 */
    1613class BugReportSettingsPanelTest {
    17 
    18     /**
    19      * Setup test
    20      */
    21     @RegisterExtension
    22     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    23     public JOSMTestRules test = new JOSMTestRules();
    24 
    2514    /**
    2615     * Test {@link BugReportSettingsPanel}
  • trunk/test/unit/org/openstreetmap/josm/gui/bugreport/DebugTextDisplayTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertEquals;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
     6import org.openstreetmap.josm.gui.datatransfer.ClipboardUtils;
     7import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     8
    79import org.junit.jupiter.api.Test;
    8 import org.openstreetmap.josm.gui.datatransfer.ClipboardUtils;
    9 import org.openstreetmap.josm.testutils.JOSMTestRules;
    10 
    11 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1210
    1311/**
    1412 * Unit test of {@link DebugTextDisplay} class.
    1513 */
     14@BasicPreferences
    1615class DebugTextDisplayTest {
    17     /**
    18      * Setup test
    19      */
    20     @RegisterExtension
    21     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    22     public JOSMTestRules test = new JOSMTestRules().preferences();
    23 
    2416    /**
    2517     * Test {@link DebugTextDisplay#getCodeText}
  • trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/ConflictResolverTest.java

    r17275 r18037  
    77import java.util.NoSuchElementException;
    88
    9 import org.junit.jupiter.api.Test;
    10 import org.junit.jupiter.api.extension.RegisterExtension;
    119import org.openstreetmap.josm.command.SequenceCommand;
    1210import org.openstreetmap.josm.data.conflict.Conflict;
     
    1614import org.openstreetmap.josm.data.osm.Relation;
    1715import org.openstreetmap.josm.data.osm.Way;
    18 import org.openstreetmap.josm.testutils.JOSMTestRules;
     16import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1917
    20 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     18import org.junit.jupiter.api.Test;
    2119
    2220/**
    2321 * Unit tests of {@link ConflictResolver} class.
    2422 */
     23@BasicPreferences
    2524class ConflictResolverTest {
    26 
    27     /**
    28      * Setup test.
    29      */
    30     @RegisterExtension
    31     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    32     public JOSMTestRules test = new JOSMTestRules().preferences();
    33 
    3425    /**
    3526     * Unit test of {@link ConflictResolver#buildResolveCommand} - empty case.
  • trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergeModelTest.java

    r17374 r18037  
    22package org.openstreetmap.josm.gui.conflict.pair.nodes;
    33
    4 import static org.junit.jupiter.api.Assertions.fail;
    54import static org.junit.jupiter.api.Assertions.assertEquals;
    65import static org.junit.jupiter.api.Assertions.assertFalse;
    76import static org.junit.jupiter.api.Assertions.assertTrue;
     7import static org.junit.jupiter.api.Assertions.fail;
    88
    99import java.beans.PropertyChangeEvent;
     
    1919import javax.swing.DefaultListSelectionModel;
    2020
    21 import org.junit.jupiter.api.Test;
    22 import org.junit.jupiter.api.extension.RegisterExtension;
    2321import org.openstreetmap.josm.TestUtils;
    2422import org.openstreetmap.josm.data.osm.Node;
     
    2624import org.openstreetmap.josm.gui.conflict.pair.AbstractListMergeModel;
    2725import org.openstreetmap.josm.testutils.DatasetFactory;
    28 import org.openstreetmap.josm.testutils.JOSMTestRules;
     26import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2927import org.openstreetmap.josm.tools.Logging;
    3028
    31 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     29import org.junit.jupiter.api.Test;
    3230
    3331/**
    3432 * Unit tests of {@link NodeListMergeModel}.
    3533 */
     34// Needed to due to OSM primitive dependencies
     35@BasicPreferences
    3636class NodeListMergeModelTest {
    37 
    3837    private final DatasetFactory my = new DatasetFactory();
    3938    private final DatasetFactory their = new DatasetFactory();
    40 
    41     /**
    42      * Setup test.
    43      */
    44     @RegisterExtension
    45     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    46     public JOSMTestRules test = new JOSMTestRules();
    4739
    4840    @SuppressWarnings("unchecked")
  • trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergerTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
     6import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     7
    78import org.junit.jupiter.api.Test;
    8 import org.openstreetmap.josm.testutils.JOSMTestRules;
    9 
    10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    119
    1210/**
    1311 * Unit tests of {@link NodeListMerger} class.
    1412 */
     13@BasicPreferences
    1514class NodeListMergerTest {
    16 
    17     /**
    18      * Setup test.
    19      */
    20     @RegisterExtension
    21     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    22     public JOSMTestRules test = new JOSMTestRules().preferences();
    23 
    2415    /**
    2516     * Unit test of {@link NodeListMerger#NodeListMerger}.
  • trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMergeModelTest.java

    r17275 r18037  
    99import javax.swing.event.ChangeListener;
    1010
    11 import org.junit.jupiter.api.BeforeEach;
    12 import org.junit.jupiter.api.Test;
    13 import org.junit.jupiter.api.extension.RegisterExtension;
    1411import org.openstreetmap.josm.data.conflict.Conflict;
    1512import org.openstreetmap.josm.data.coor.LatLon;
     
    2017import org.openstreetmap.josm.data.osm.Way;
    2118import org.openstreetmap.josm.gui.conflict.pair.MergeDecisionType;
    22 import org.openstreetmap.josm.testutils.JOSMTestRules;
     19import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2320
    24 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     21import org.junit.jupiter.api.BeforeEach;
     22import org.junit.jupiter.api.Test;
    2523
    2624/**
    2725 * Unit tests of {@link PropertiesMergeModel}.
    2826 */
     27// Needed to due to OSM primitive dependencies
     28@BasicPreferences
    2929class PropertiesMergeModelTest {
    3030
     
    5050     * Setup test.
    5151     */
    52     @RegisterExtension
    53     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    54     public JOSMTestRules test = new JOSMTestRules();
    55 
    56     /**
    57      * Setup test.
    58      */
    5952    @BeforeEach
    60     public void setUp() {
     53    void setUp() {
    6154        model = new PropertiesMergeModel();
    6255    }
  • trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMergerTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
     6import org.openstreetmap.josm.TestUtils;
     7import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     8
    79import org.junit.jupiter.api.Test;
    8 import org.openstreetmap.josm.TestUtils;
    9 import org.openstreetmap.josm.testutils.JOSMTestRules;
    10 
    11 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1210
    1311/**
    1412 * Unit tests of {@link PropertiesMerger} class.
    1513 */
     14@BasicPreferences
    1615class PropertiesMergerTest {
    17 
    18     /**
    19      * Setup test.
    20      */
    21     @RegisterExtension
    22     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    23     public JOSMTestRules test = new JOSMTestRules().preferences();
    24 
    2516    /**
    2617     * Unit test of {@link PropertiesMerger#PropertiesMerger}.
  • trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberMergerTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
     6import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     7
    78import org.junit.jupiter.api.Test;
    8 import org.openstreetmap.josm.testutils.JOSMTestRules;
    9 
    10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    119
    1210/**
    1311 * Unit tests of {@link RelationMemberMerger} class.
    1412 */
     13@BasicPreferences
    1514class RelationMemberMergerTest {
    16 
    17     /**
    18      * Setup test.
    19      */
    20     @RegisterExtension
    21     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    22     public JOSMTestRules test = new JOSMTestRules().preferences();
    23 
    2415    /**
    2516     * Unit test of {@link RelationMemberMerger#RelationMemberMerger}.
  • trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellEditorTest.java

    r17275 r18037  
    88import java.awt.Component;
    99
    10 import org.junit.jupiter.api.extension.RegisterExtension;
    11 import org.junit.jupiter.api.Test;
    1210import org.openstreetmap.josm.data.osm.Node;
    1311import org.openstreetmap.josm.data.osm.RelationMember;
    14 import org.openstreetmap.josm.testutils.JOSMTestRules;
     12import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1513
    16 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     14import org.junit.jupiter.api.Test;
    1715
    1816/**
    1917 * Unit tests of {@link RelationMemberTableCellEditor} class.
    2018 */
     19@BasicPreferences
    2120class RelationMemberTableCellEditorTest {
    22 
    23     /**
    24      * Setup test.
    25      */
    26     @RegisterExtension
    27     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    28     public JOSMTestRules test = new JOSMTestRules().preferences();
    29 
    3021    /**
    3122     * Unit test of {@link RelationMemberTableCellEditor#RelationMemberTableCellEditor}.
  • trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellRendererTest.java

    r17275 r18037  
    66import javax.swing.JTable;
    77
    8 import org.junit.jupiter.api.extension.RegisterExtension;
    9 import org.junit.jupiter.api.Test;
    108import org.openstreetmap.josm.data.osm.Node;
    119import org.openstreetmap.josm.data.osm.RelationMember;
    1210import org.openstreetmap.josm.gui.conflict.pair.ListRole;
    1311import org.openstreetmap.josm.gui.conflict.pair.nodes.NodeListMergeModel;
    14 import org.openstreetmap.josm.testutils.JOSMTestRules;
     12import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1513
    16 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     14import org.junit.jupiter.api.Test;
    1715
    1816/**
    1917 * Unit tests of {@link RelationMemberTableCellRenderer} class.
    2018 */
     19@BasicPreferences
    2120class RelationMemberTableCellRendererTest {
    22 
    23     /**
    24      * Setup test.
    25      */
    26     @RegisterExtension
    27     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    28     public JOSMTestRules test = new JOSMTestRules().preferences();
    29 
    3021    /**
    3122     * Unit test of {@link RelationMemberTableCellRenderer#RelationMemberTableCellRenderer}.
  • trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergeItemTest.java

    r17275 r18037  
    66import static org.junit.jupiter.api.Assertions.fail;
    77
    8 import org.junit.jupiter.api.extension.RegisterExtension;
    9 import org.junit.jupiter.api.Test;
    108import org.openstreetmap.josm.data.osm.Node;
    119import org.openstreetmap.josm.gui.conflict.pair.MergeDecisionType;
    12 import org.openstreetmap.josm.testutils.JOSMTestRules;
     10import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1311import org.openstreetmap.josm.tools.Logging;
    1412
    15 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     13import org.junit.jupiter.api.Test;
    1614
    1715/**
    1816 * Unit tests of {@link TagMergeItem} class.
    1917 */
     18// Needed to due to OSM primitive dependencies
     19@BasicPreferences
    2020class TagMergeItemTest {
    21 
    22     /**
    23      * Setup test.
    24      */
    25     @RegisterExtension
    26     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    27     public JOSMTestRules test = new JOSMTestRules();
    28 
    2921    @Test
    3022    void testTagMergeItem() {
  • trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergeModelTest.java

    r17275 r18037  
    99import java.util.Set;
    1010
    11 import org.junit.jupiter.api.extension.RegisterExtension;
    12 import org.junit.jupiter.api.Test;
    1311import org.openstreetmap.josm.TestUtils;
    1412import org.openstreetmap.josm.data.osm.Node;
    1513import org.openstreetmap.josm.gui.conflict.pair.MergeDecisionType;
    16 import org.openstreetmap.josm.testutils.JOSMTestRules;
    17 
    18 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     14import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     15
     16import org.junit.jupiter.api.Test;
    1917
    2018/**
     
    2220 */
    2321@SuppressWarnings("unchecked")
     22// Needed to due to OSM primitive dependencies
     23@BasicPreferences
    2424class TagMergeModelTest {
    25 
    26     /**
    27      * Setup test.
    28      */
    29     @RegisterExtension
    30     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    31     public JOSMTestRules test = new JOSMTestRules();
    32 
    3325    protected Set<PropertyChangeListener> getListeners(TagMergeModel model) throws ReflectiveOperationException {
    3426        return (Set<PropertyChangeListener>) TestUtils.getPrivateField(model, "listeners");
  • trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergerTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
     6import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     7
    78import org.junit.jupiter.api.Test;
    8 import org.openstreetmap.josm.testutils.JOSMTestRules;
    9 
    10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    119
    1210/**
    1311 * Unit tests of {@link TagMerger} class.
    1412 */
     13@BasicPreferences
    1514class TagMergerTest {
    16 
    17     /**
    18      * Setup test.
    19      */
    20     @RegisterExtension
    21     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    22     public JOSMTestRules test = new JOSMTestRules().preferences();
    23 
    2415    /**
    2516     * Unit test of {@link TagMerger#TagMerger}.
  • trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellEditorTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
    76import org.junit.jupiter.api.Test;
    8 import org.openstreetmap.josm.testutils.JOSMTestRules;
    9 
    10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    117
    128/**
     
    1410 */
    1511class MultiValueCellEditorTest {
    16 
    17     /**
    18      * Setup test.
    19      */
    20     @RegisterExtension
    21     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    22     public JOSMTestRules test = new JOSMTestRules();
    23 
    2412    /**
    2513     * Unit test of {@link MultiValueCellEditor#MultiValueCellEditor}.
  • trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellRendererTest.java

    r17275 r18037  
    1010import javax.swing.JTable;
    1111
    12 import org.junit.jupiter.api.extension.RegisterExtension;
    13 import org.junit.jupiter.api.Test;
    1412import org.openstreetmap.josm.data.osm.Tag;
    1513import org.openstreetmap.josm.data.osm.TagCollection;
    16 import org.openstreetmap.josm.testutils.JOSMTestRules;
     14import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1715
    18 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     16import org.junit.jupiter.api.Test;
    1917
    2018/**
    2119 * Unit tests of {@link MultiValueCellRenderer} class.
    2220 */
     21@BasicPreferences
    2322class MultiValueCellRendererTest {
    24 
    25     /**
    26      * Setup test.
    27      */
    28     @RegisterExtension
    29     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    30     public JOSMTestRules test = new JOSMTestRules().preferences();
    31 
    3223    /**
    3324     * Unit test of {@link MultiValueCellRenderer#MultiValueCellRenderer}.
  • trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/PasteTagsConflictResolverDialogTest.java

    r17275 r18037  
    99import java.awt.Insets;
    1010
    11 import org.junit.jupiter.api.extension.RegisterExtension;
    12 import org.junit.jupiter.api.Test;
    1311import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
    1412import org.openstreetmap.josm.gui.conflict.tags.PasteTagsConflictResolverDialog.StatisticsInfo;
    1513import org.openstreetmap.josm.gui.conflict.tags.PasteTagsConflictResolverDialog.StatisticsInfoTable;
    1614import org.openstreetmap.josm.gui.conflict.tags.PasteTagsConflictResolverDialog.StatisticsTableModel;
    17 import org.openstreetmap.josm.testutils.JOSMTestRules;
     15import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1816
    19 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     17import org.junit.jupiter.api.Test;
    2018
    2119/**
    2220 * Unit tests of {@link PasteTagsConflictResolverDialog} class.
    2321 */
     22// Needed to due to OSM primitive dependencies
     23@BasicPreferences
    2424class PasteTagsConflictResolverDialogTest {
    25 
    26     /**
    27      * Setup test.
    28      */
    29     @RegisterExtension
    30     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    31     public JOSMTestRules test = new JOSMTestRules();
    32 
    3325    /**
    3426     * Unit test of {@link PasteTagsConflictResolverDialog#PANE_TITLES}.
  • trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverModelTest.java

    r17275 r18037  
    1010import java.util.List;
    1111
    12 import org.junit.jupiter.api.extension.RegisterExtension;
    13 import org.junit.jupiter.api.Test;
    1412import org.openstreetmap.josm.data.coor.LatLon;
    1513import org.openstreetmap.josm.data.osm.DataSet;
     
    1816import org.openstreetmap.josm.data.osm.RelationMember;
    1917import org.openstreetmap.josm.data.osm.Way;
    20 import org.openstreetmap.josm.testutils.JOSMTestRules;
     18import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2119
    22 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     20import org.junit.jupiter.api.Test;
    2321
    2422/**
    2523 * Unit tests of {@link RelationMemberConflictResolverModel} class.
    2624 */
     25// Only needed for OSM primitives
     26@BasicPreferences
    2727class RelationMemberConflictResolverModelTest {
    28 
    29     /**
    30      * Setup test.
    31      */
    32     @RegisterExtension
    33     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    34     public JOSMTestRules test = new JOSMTestRules();
    35 
    3628    List<Way> buildTestDataSet() {
    3729        final DataSet ds = new DataSet();
  • trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
     6import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     7
    78import org.junit.jupiter.api.Test;
    8 import org.openstreetmap.josm.testutils.JOSMTestRules;
    9 
    10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    119
    1210/**
    1311 * Unit tests of {@link RelationMemberConflictResolver} class.
    1412 */
     13@BasicPreferences
    1514class RelationMemberConflictResolverTest {
    16 
    17     /**
    18      * Setup test.
    19      */
    20     @RegisterExtension
    21     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    22     public JOSMTestRules test = new JOSMTestRules().preferences();
    23 
    2415    /**
    2516     * Unit test for {@link RelationMemberConflictResolver#RelationMemberConflictResolver}.
  • trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolutionUtilTest.java

    r17564 r18037  
    1515import java.util.stream.Collectors;
    1616
    17 import org.junit.jupiter.api.Test;
    18 import org.junit.jupiter.api.extension.RegisterExtension;
    1917import org.openstreetmap.josm.data.osm.Tag;
    2018import org.openstreetmap.josm.data.osm.TagCollection;
     
    2321import org.openstreetmap.josm.gui.conflict.tags.TagConflictResolutionUtil.AutomaticCombine;
    2422import org.openstreetmap.josm.testutils.JOSMTestRules;
     23import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2524
    2625import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     26import org.junit.jupiter.api.Test;
     27import org.junit.jupiter.api.extension.RegisterExtension;
    2728
    2829/**
    2930 * Unit tests of {@link TagConflictResolutionUtil} class.
    3031 */
     32@BasicPreferences
    3133class TagConflictResolutionUtilTest {
    32 
    33     /**
    34      * Setup test.
    35      */
    36     @RegisterExtension
    37     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    38     public JOSMTestRules test = new JOSMTestRules();
    39 
    4034    private static HashSet<String> newHashSet(String... values) {
    4135        return Arrays.stream(values).collect(Collectors.toCollection(HashSet::new));
  • trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/ClipboardUtilsTest.java

    r17677 r18037  
    1717import java.io.IOException;
    1818
    19 import org.junit.jupiter.api.extension.RegisterExtension;
     19import net.trajano.commons.testing.UtilityClassTestUtil;
    2020import org.junit.jupiter.api.Test;
    21 import org.openstreetmap.josm.testutils.JOSMTestRules;
    22 
    23 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    24 import net.trajano.commons.testing.UtilityClassTestUtil;
    2521
    2622/**
     
    6662        }
    6763    }
    68 
    69     /**
    70      * No dependencies
    71      */
    72     @RegisterExtension
    73     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    74     public JOSMTestRules test = new JOSMTestRules();
    7564
    7665    /**
  • trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/PrimitiveTransferableTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertEquals;
    55import static org.junit.jupiter.api.Assertions.assertFalse;
     6import static org.junit.jupiter.api.Assertions.assertThrows;
    67import static org.junit.jupiter.api.Assertions.assertTrue;
    7 import static org.junit.jupiter.api.Assertions.assertThrows;
    88
    99import java.awt.datatransfer.DataFlavor;
     
    1414import java.util.List;
    1515
    16 import org.junit.jupiter.api.Test;
    17 import org.junit.jupiter.api.extension.RegisterExtension;
    1816import org.openstreetmap.josm.data.osm.Node;
    1917import org.openstreetmap.josm.data.osm.NodeData;
     
    2119import org.openstreetmap.josm.gui.datatransfer.data.PrimitiveTransferData;
    2220import org.openstreetmap.josm.gui.datatransfer.data.TagTransferData;
    23 import org.openstreetmap.josm.testutils.JOSMTestRules;
     21import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2422
    25 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     23import org.junit.jupiter.api.Test;
    2624
    2725/**
    2826 * Unit tests of {@link PrimitiveTransferable} class.
    2927 */
     28// Only needed for OSM primitives
     29@BasicPreferences
    3030class PrimitiveTransferableTest {
    31     /**
    32      * Prefs to use OSM primitives
    33      */
    34     @RegisterExtension
    35     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    36     public JOSMTestRules test = new JOSMTestRules().preferences();
    37 
    3831    /**
    3932     * Test of {@link PrimitiveTransferable#getTransferDataFlavors()} method response order
  • trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/RelationMemberTransferableTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertEquals;
    55import static org.junit.jupiter.api.Assertions.assertFalse;
     6import static org.junit.jupiter.api.Assertions.assertThrows;
    67import static org.junit.jupiter.api.Assertions.assertTrue;
    7 import static org.junit.jupiter.api.Assertions.assertThrows;
     8
    89import static org.openstreetmap.josm.gui.datatransfer.RelationMemberTransferable.RELATION_MEMBER_DATA;
    910
     
    1314import java.util.Collections;
    1415
    15 import org.junit.jupiter.api.Test;
    16 import org.junit.jupiter.api.extension.RegisterExtension;
    1716import org.openstreetmap.josm.data.osm.Node;
    1817import org.openstreetmap.josm.data.osm.PrimitiveData;
     
    2019import org.openstreetmap.josm.data.osm.RelationMemberData;
    2120import org.openstreetmap.josm.gui.datatransfer.data.PrimitiveTransferData;
    22 import org.openstreetmap.josm.testutils.JOSMTestRules;
     21import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2322
    24 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     23import org.junit.jupiter.api.Test;
    2524
    2625/**
     
    2827 */
    2928class RelationMemberTransferableTest {
    30 
    31     /**
    32      * Setup tests
    33      */
    34     @RegisterExtension
    35     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    36     public JOSMTestRules test = new JOSMTestRules();
    37 
    3829    /**
    3930     * Test of {@link RelationMemberTransferable#getTransferDataFlavors()} method.
     
    6455     */
    6556    @Test
     57    @BasicPreferences
    6658    void testGetTransferDataNominal() throws UnsupportedFlavorException {
    6759        RelationMemberTransferable rmt = new RelationMemberTransferable(Collections.singleton(new RelationMember("test", new Node(1))));
  • trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/TagTransferableTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertEquals;
    55import static org.junit.jupiter.api.Assertions.assertFalse;
     6import static org.junit.jupiter.api.Assertions.assertThrows;
    67import static org.junit.jupiter.api.Assertions.assertTrue;
    7 import static org.junit.jupiter.api.Assertions.assertThrows;
    88
    99import java.awt.datatransfer.DataFlavor;
     
    1212import java.util.Map;
    1313
     14import org.openstreetmap.josm.gui.datatransfer.data.TagTransferData;
     15
    1416import org.junit.jupiter.api.Test;
    15 import org.junit.jupiter.api.extension.RegisterExtension;
    16 import org.openstreetmap.josm.gui.datatransfer.data.TagTransferData;
    17 import org.openstreetmap.josm.testutils.JOSMTestRules;
    18 
    19 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    2017
    2118/**
     
    2320 */
    2421class TagTransferableTest {
    25 
    26     /**
    27      * Setup tests
    28      */
    29     @RegisterExtension
    30     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    31     public JOSMTestRules test = new JOSMTestRules();
    32 
    3322    /**
    3423     * Test of {@link TagTransferable#isDataFlavorSupported} method.
  • trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/data/PrimitiveTagTransferDataTest.java

    r17275 r18037  
    99import java.util.Map;
    1010
    11 import org.junit.jupiter.api.extension.RegisterExtension;
    12 import org.junit.jupiter.api.Test;
    1311import org.openstreetmap.josm.data.osm.Node;
    1412import org.openstreetmap.josm.data.osm.NodeData;
     
    1816import org.openstreetmap.josm.data.osm.TagCollection;
    1917import org.openstreetmap.josm.data.osm.WayData;
    20 import org.openstreetmap.josm.testutils.JOSMTestRules;
     18import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2119
    22 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     20import org.junit.jupiter.api.Test;
    2321
    2422/**
     
    2624 * @author Michael Zangl
    2725 */
     26// Only required due to OSM primitive dependencies
     27@BasicPreferences
    2828class PrimitiveTagTransferDataTest {
    29     /**
    30      * Prefs only required because of the dependencies of OSM primitives.
    31      */
    32     @RegisterExtension
    33     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    34     public JOSMTestRules test = new JOSMTestRules().preferences();
    35 
    3629    private static boolean isHeterogeneousSource(PrimitiveData... t) {
    3730        return new PrimitiveTagTransferData(Arrays.asList(t)).isHeterogeneousSource();
  • trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/importers/OsmLinkPasterTest.java

    r17275 r18037  
    55import static org.junit.jupiter.api.Assertions.assertNull;
    66
    7 import org.junit.jupiter.api.extension.RegisterExtension;
     7import org.openstreetmap.josm.data.coor.LatLon;
     8
    89import org.junit.jupiter.api.Test;
    9 import org.openstreetmap.josm.data.coor.LatLon;
    10 import org.openstreetmap.josm.testutils.JOSMTestRules;
    11 
    12 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1310
    1411/**
     
    1714 */
    1815class OsmLinkPasterTest {
    19     /**
    20      * No dependencies
    21      */
    22     @RegisterExtension
    23     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    24     public JOSMTestRules test = new JOSMTestRules();
    25 
    2616    /**
    2717     * Test of {@link OsmLinkPaster#parseLatLon(String)}
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/NotesDialogTest.java

    r17714 r18037  
    1111import javax.swing.JList;
    1212
    13 import org.junit.jupiter.api.Test;
    14 import org.junit.jupiter.api.extension.RegisterExtension;
    1513import org.openstreetmap.josm.data.coor.LatLon;
    1614import org.openstreetmap.josm.data.notes.Note;
     
    1816import org.openstreetmap.josm.data.osm.User;
    1917import org.openstreetmap.josm.gui.dialogs.NotesDialog.NoteRenderer;
    20 import org.openstreetmap.josm.testutils.JOSMTestRules;
     18import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2119
    22 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     20import org.junit.jupiter.api.Test;
    2321
    2422/**
    2523 * Unit tests of {@link NotesDialog}
    2624 */
     25@BasicPreferences
    2726class NotesDialogTest {
    28 
    29     /**
    30      * Setup tests
    31      */
    32     @RegisterExtension
    33     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    34     public JOSMTestRules josmTestRules = new JOSMTestRules().preferences();
    35 
    3627    private Note createMultiLineNote() {
    3728        Note note = new Note(LatLon.ZERO);
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManagerTest.java

    r17275 r18037  
    88import java.awt.GraphicsEnvironment;
    99import java.awt.event.ActionEvent;
     10import java.util.Collections;
     11import java.util.List;
     12
    1013import javax.swing.JButton;
    1114import javax.swing.JDialog;
    1215
    13 import java.util.Collections;
    14 import java.util.List;
    15 
    16 import org.junit.jupiter.api.extension.RegisterExtension;
    17 import org.junit.jupiter.api.Test;
    1816import org.openstreetmap.josm.TestUtils;
    1917import org.openstreetmap.josm.data.osm.Changeset;
     
    2826import org.openstreetmap.josm.gui.dialogs.changeset.ChangesetCacheManager.ShowDetailAction;
    2927import org.openstreetmap.josm.gui.dialogs.changeset.query.ChangesetQueryDialog;
    30 import org.openstreetmap.josm.testutils.JOSMTestRules;
     28import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    3129import org.openstreetmap.josm.testutils.mockers.HelpAwareOptionPaneMocker;
    3230import org.openstreetmap.josm.testutils.mockers.WindowMocker;
     
    3533import mockit.Mock;
    3634import mockit.MockUp;
    37 
    38 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     35import org.junit.jupiter.api.Test;
    3936
    4037/**
    4138 * Unit tests of {@link ChangesetCacheManager} class.
    4239 */
     40@BasicPreferences
    4341class ChangesetCacheManagerTest {
    44 
    45     /**
    46      * Setup tests
    47      */
    48     @RegisterExtension
    49     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    50     public JOSMTestRules test = new JOSMTestRules().preferences();
    51 
    5242    /**
    5343     * Unit test of {@link ChangesetCacheManager#destroyInstance}.
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheTableColumnModelTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
    76import org.junit.jupiter.api.Test;
    8 import org.openstreetmap.josm.testutils.JOSMTestRules;
    9 
    10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    117
    128/**
     
    1410 */
    1511class ChangesetCacheTableColumnModelTest {
    16 
    17     /**
    18      * Setup tests
    19      */
    20     @RegisterExtension
    21     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    22     public JOSMTestRules test = new JOSMTestRules();
    23 
    2412    /**
    2513     * Unit test of {@link ChangesetCacheTableColumnModel}.
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanelTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
    7 import org.junit.jupiter.api.Test;
    86import org.openstreetmap.josm.testutils.JOSMTestRules;
    97
    108import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     9import org.junit.jupiter.api.Test;
     10import org.junit.jupiter.api.extension.RegisterExtension;
    1111
    1212/**
     
    2020    @RegisterExtension
    2121    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    22     public JOSMTestRules test = new JOSMTestRules().preferences();
     22    public JOSMTestRules test = new JOSMTestRules().preferences().main();
    2323
    2424    /**
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanelTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
     6import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     7
    78import org.junit.jupiter.api.Test;
    8 import org.openstreetmap.josm.testutils.JOSMTestRules;
    9 
    10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    119
    1210/**
    1311 * Unit tests of {@link ChangesetDetailPanel} class.
    1412 */
     13@BasicPreferences
    1514class ChangesetDetailPanelTest {
    16 
    17     /**
    18      * Setup tests
    19      */
    20     @RegisterExtension
    21     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    22     public JOSMTestRules test = new JOSMTestRules().preferences();
    23 
    2415    /**
    2516     * Unit test of {@link ChangesetDetailPanel#ChangesetDetailPanel}.
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDiscussionPanelTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
     6import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     7
    78import org.junit.jupiter.api.Test;
    8 import org.openstreetmap.josm.testutils.JOSMTestRules;
    9 
    10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    119
    1210/**
    1311 * Unit tests of {@link ChangesetDiscussionPanel} class.
    1412 */
     13@BasicPreferences
    1514class ChangesetDiscussionPanelTest {
    16 
    17     /**
    18      * Setup tests
    19      */
    20     @RegisterExtension
    21     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    22     public JOSMTestRules test = new JOSMTestRules().preferences();
    23 
    2415    /**
    2516     * Unit test of {@link ChangesetDiscussionPanel#ChangesetDiscussionPanel}.
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetTagsPanelTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
     6import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     7
    78import org.junit.jupiter.api.Test;
    8 import org.openstreetmap.josm.testutils.JOSMTestRules;
    9 
    10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    119
    1210/**
    1311 * Unit tests of {@link ChangesetTagsPanel} class.
    1412 */
     13@BasicPreferences
    1514class ChangesetTagsPanelTest {
    16 
    17     /**
    18      * Setup tests
    19      */
    20     @RegisterExtension
    21     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    22     public JOSMTestRules test = new JOSMTestRules().preferences();
    23 
    2415    /**
    2516     * Unit test of {@link ChangesetTagsPanel#ChangesetTagsPanel}.
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanelTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
     6import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     7
    78import org.junit.jupiter.api.Test;
    8 import org.openstreetmap.josm.testutils.JOSMTestRules;
    9 
    10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    119
    1210/**
    1311 * Unit tests of {@link AdvancedChangesetQueryPanel} class.
    1412 */
     13@BasicPreferences
    1514class AdvancedChangesetQueryPanelTest {
    16 
    17     /**
    18      * Setup test.
    19      */
    20     @RegisterExtension
    21     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    22     public JOSMTestRules test = new JOSMTestRules().preferences();
    23 
    2415    /**
    2516     * Unit test of {@link AdvancedChangesetQueryPanel#AdvancedChangesetQueryPanel}.
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/query/BasicChangesetQueryPanelTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
     6import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     7
    78import org.junit.jupiter.api.Test;
    8 import org.openstreetmap.josm.testutils.JOSMTestRules;
    9 
    10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    119
    1210/**
    1311 * Unit tests of {@link BasicChangesetQueryPanel} class.
    1412 */
     13@BasicPreferences
    1514class BasicChangesetQueryPanelTest {
    16 
    17     /**
    18      * Setup test.
    19      */
    20     @RegisterExtension
    21     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    22     public JOSMTestRules test = new JOSMTestRules().preferences();
    23 
    2415    /**
    2516     * Unit test of {@link BasicChangesetQueryPanel#BasicChangesetQueryPanel}.
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanelTest.java

    r17275 r18037  
    55import static org.junit.jupiter.api.Assertions.assertTrue;
    66
     7import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     8
    79import org.junit.jupiter.api.Test;
    8 import org.junit.jupiter.api.extension.RegisterExtension;
    9 import org.openstreetmap.josm.testutils.JOSMTestRules;
    10 
    11 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1210
    1311/**
    1412 * Unit tests of {@link UrlBasedQueryPanel} class.
    1513 */
     14@BasicPreferences
    1615class UrlBasedQueryPanelTest {
    17 
    18     /**
    19      * Setup test.
    20      */
    21     @RegisterExtension
    22     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    23     public JOSMTestRules test = new JOSMTestRules().preferences();
    24 
    2516    /**
    2617     * Unit test of {@link UrlBasedQueryPanel#UrlBasedQueryPanel}.
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/layer/DuplicateActionTest.java

    r17275 r18037  
    99import java.io.InputStream;
    1010
    11 import org.junit.jupiter.api.extension.RegisterExtension;
    12 import org.junit.jupiter.api.Test;
    1311import org.openstreetmap.josm.TestUtils;
    1412import org.openstreetmap.josm.gui.MainApplication;
    1513import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    1614import org.openstreetmap.josm.io.OsmReader;
    17 import org.openstreetmap.josm.testutils.JOSMTestRules;
     15import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1816
    19 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     17import org.junit.jupiter.api.Test;
    2018
    2119/**
    2220 * Unit tests of {@link DuplicateAction} class.
    2321 */
     22// TMS layer needs prefs. Platform for LayerListDialog shortcuts.
     23@BasicPreferences
    2424class DuplicateActionTest {
    25     /**
    26      * TMS layer needs prefs. Platform for LayerListDialog shortcuts.
    27      */
    28     @RegisterExtension
    29     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    30     public JOSMTestRules test = new JOSMTestRules().preferences();
    31 
    3225    /**
    3326     * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/4539">#4539</a>.
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialogTest.java

    r17275 r18037  
    77import java.util.List;
    88
    9 import org.junit.jupiter.api.extension.RegisterExtension;
    10 import org.junit.jupiter.api.Test;
    119import org.openstreetmap.josm.data.coor.LatLon;
    1210import org.openstreetmap.josm.data.osm.Node;
    1311import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1412import org.openstreetmap.josm.data.osm.Way;
    15 import org.openstreetmap.josm.testutils.JOSMTestRules;
     13import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1614
    17 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     15import org.junit.jupiter.api.Test;
    1816
    1917/**
    2018 * Unit tests of {@link PropertiesDialog} class.
    2119 */
     20@BasicPreferences
    2221class PropertiesDialogTest {
    23 
    24     /**
    25      * Setup tests
    26      */
    27     @RegisterExtension
    28     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    29     public JOSMTestRules test = new JOSMTestRules();
    30 
    3122    private static String createSearchSetting(List<OsmPrimitive> sel, boolean sameType) {
    3223        return PropertiesDialog.createSearchSetting("foo", sel, sameType).text;
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/properties/RecentTagCollectionTest.java

    r17275 r18037  
    99import java.util.Collections;
    1010
    11 import org.junit.jupiter.api.extension.RegisterExtension;
    12 import org.junit.jupiter.api.Test;
    1311import org.openstreetmap.josm.data.osm.Tag;
    1412import org.openstreetmap.josm.data.osm.search.SearchParseError;
    1513import org.openstreetmap.josm.data.osm.search.SearchSetting;
    1614import org.openstreetmap.josm.data.preferences.ListProperty;
    17 import org.openstreetmap.josm.testutils.JOSMTestRules;
     15import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1816
    19 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     17import org.junit.jupiter.api.Test;
    2018
    2119/**
    2220 * Unit tests of {@link RecentTagCollection} class.
    2321 */
     22@BasicPreferences
    2423class RecentTagCollectionTest {
    25 
    26     /**
    27      * Setup tests
    28      */
    29     @RegisterExtension
    30     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    31     public JOSMTestRules test = new JOSMTestRules().preferences();
    32 
    3324    /**
    3425     * Performs various tests on a {@link RecentTagCollection}.
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowserTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
    7 import org.junit.jupiter.api.Test;
    86import org.openstreetmap.josm.data.osm.DataSet;
    97import org.openstreetmap.josm.data.osm.Relation;
    108import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    11 import org.openstreetmap.josm.testutils.JOSMTestRules;
     9import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1210
    13 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     11import org.junit.jupiter.api.Test;
    1412
    1513/**
    1614 * Unit tests of {@link ChildRelationBrowser} class.
    1715 */
     16@BasicPreferences
    1817class ChildRelationBrowserTest {
    19 
    20     /**
    21      * Setup test.
    22      */
    23     @RegisterExtension
    24     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    25     public JOSMTestRules test = new JOSMTestRules().preferences();
    26 
    2718    /**
    2819     * Unit test of {@link ChildRelationBrowser#ChildRelationBrowser}.
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/MemberTableLinkedCellRendererTest.java

    r17275 r18037  
    66import javax.swing.JTable;
    77
    8 import org.junit.jupiter.api.extension.RegisterExtension;
    9 import org.junit.jupiter.api.Test;
    108import org.openstreetmap.josm.TestUtils;
    119import org.openstreetmap.josm.gui.dialogs.relation.sort.WayConnectionType;
    12 import org.openstreetmap.josm.testutils.JOSMTestRules;
     10import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1311
    14 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     12import org.junit.jupiter.api.Test;
    1513
    1614/**
    1715 * Unit tests of {@link MemberTableLinkedCellRenderer} class.
    1816 */
     17@BasicPreferences
    1918class MemberTableLinkedCellRendererTest {
    20 
    21     /**
    22      * Setup test.
    23      */
    24     @RegisterExtension
    25     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    26     public JOSMTestRules test = new JOSMTestRules().preferences();
    27 
    2819    /**
    2920     * Unit test of {@link MemberTableLinkedCellRenderer#MemberTableLinkedCellRenderer}.
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/MemberTableMemberCellRendererTest.java

    r17275 r18037  
    66import javax.swing.JTable;
    77
    8 import org.junit.jupiter.api.extension.RegisterExtension;
    9 import org.junit.jupiter.api.Test;
    108import org.openstreetmap.josm.data.osm.DataSet;
    119import org.openstreetmap.josm.data.osm.Node;
    1210import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    13 import org.openstreetmap.josm.testutils.JOSMTestRules;
     11import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1412
    15 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     13import org.junit.jupiter.api.Test;
    1614
    1715/**
    1816 * Unit tests of {@link MemberTableMemberCellRenderer} class.
    1917 */
     18@BasicPreferences
    2019class MemberTableMemberCellRendererTest {
    21 
    22     /**
    23      * Setup test.
    24      */
    25     @RegisterExtension
    26     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    27     public JOSMTestRules test = new JOSMTestRules().preferences();
    28 
    2920    /**
    3021     * Unit test of {@link MemberTableMemberCellRenderer#MemberTableMemberCellRenderer}.
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModelTest.java

    r17275 r18037  
    88import java.util.List;
    99
    10 import org.junit.jupiter.api.extension.RegisterExtension;
    11 import org.junit.jupiter.api.Test;
    1210import org.openstreetmap.josm.data.osm.Node;
    1311import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1412import org.openstreetmap.josm.data.osm.Tag;
    1513import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetHandler;
    16 import org.openstreetmap.josm.testutils.JOSMTestRules;
     14import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1715
    18 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     16import org.junit.jupiter.api.Test;
    1917
    2018/**
    2119 * Unit tests of {@link MemberTableModel} class.
    2220 */
     21@BasicPreferences
    2322class MemberTableModelTest {
    24 
    25     /**
    26      * Setup test.
    27      */
    28     @RegisterExtension
    29     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    30     public JOSMTestRules test = new JOSMTestRules();
    31 
    3223    /**
    3324     * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/12443">#12443</a>.
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/MemberTableRoleCellRendererTest.java

    r17275 r18037  
    66import javax.swing.JTable;
    77
    8 import org.junit.jupiter.api.extension.RegisterExtension;
    9 import org.junit.jupiter.api.Test;
    108import org.openstreetmap.josm.data.osm.DataSet;
    119import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    12 import org.openstreetmap.josm.testutils.JOSMTestRules;
     10import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1311
    14 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     12import org.junit.jupiter.api.Test;
    1513
    1614/**
    1715 * Unit tests of {@link MemberTableRoleCellRenderer} class.
    1816 */
     17@BasicPreferences
    1918class MemberTableRoleCellRendererTest {
    20 
    21     /**
    22      * Setup test.
    23      */
    24     @RegisterExtension
    25     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    26     public JOSMTestRules test = new JOSMTestRules();
    27 
    2819    /**
    2920     * Unit test of {@link MemberTableRoleCellRenderer#MemberTableRoleCellRenderer}.
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowserTest.java

    r17275 r18037  
    22package org.openstreetmap.josm.gui.dialogs.relation;
    33
    4 import org.junit.jupiter.api.extension.RegisterExtension;
    5 import org.junit.jupiter.api.Test;
    64import org.openstreetmap.josm.data.osm.DataSet;
    75import org.openstreetmap.josm.data.osm.Relation;
    86import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    9 import org.openstreetmap.josm.testutils.JOSMTestRules;
     7import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    108
    11 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     9import org.junit.jupiter.api.Test;
    1210
    1311/**
    1412 * Unit tests of {@link ReferringRelationsBrowser} class.
    1513 */
     14@BasicPreferences
    1615class ReferringRelationsBrowserTest {
    17 
    18     /**
    19      * Setup test.
    20      */
    21     @RegisterExtension
    22     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    23     public JOSMTestRules test = new JOSMTestRules().preferences();
    24 
    2516    /**
    2617     * Unit test of {@link ReferringRelationsBrowser#ReferringRelationsBrowser}.
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/RelationTreeCellRendererTest.java

    r17275 r18037  
    66import javax.swing.JTree;
    77
    8 import org.junit.jupiter.api.extension.RegisterExtension;
     8import org.openstreetmap.josm.data.osm.Relation;
     9import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     10
    911import org.junit.jupiter.api.Test;
    10 import org.openstreetmap.josm.data.osm.Relation;
    11 import org.openstreetmap.josm.testutils.JOSMTestRules;
    12 
    13 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1412
    1513/**
    1614 * Unit tests of {@link RelationTreeCellRenderer} class.
    1715 */
     16@BasicPreferences
    1817class RelationTreeCellRendererTest {
    19 
    20     /**
    21      * Setup test.
    22      */
    23     @RegisterExtension
    24     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    25     public JOSMTestRules test = new JOSMTestRules().preferences();
    26 
    2718    /**
    2819     * Unit test of {@link RelationTreeCellRenderer#RelationTreeCellRenderer}.
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableCellRendererTest.java

    r17275 r18037  
    66import javax.swing.JTable;
    77
    8 import org.junit.jupiter.api.extension.RegisterExtension;
     8import org.openstreetmap.josm.data.osm.Node;
     9import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     10
    911import org.junit.jupiter.api.Test;
    10 import org.openstreetmap.josm.data.osm.Node;
    11 import org.openstreetmap.josm.testutils.JOSMTestRules;
    12 
    13 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1412
    1513/**
    1614 * Unit tests of {@link SelectionTableCellRenderer} class.
    1715 */
     16@BasicPreferences
    1817class SelectionTableCellRendererTest {
    19 
    20     /**
    21      * Setup test.
    22      */
    23     @RegisterExtension
    24     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    25     public JOSMTestRules test = new JOSMTestRules().preferences();
    26 
    2718    /**
    2819     * Unit test of {@link SelectionTableCellRenderer#SelectionTableCellRenderer}.
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanelTest.java

    r17275 r18037  
    1313import java.util.Set;
    1414
    15 import org.junit.jupiter.api.extension.RegisterExtension;
    16 import org.junit.jupiter.api.Test;
    1715import org.openstreetmap.josm.data.osm.Node;
    1816import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1917import org.openstreetmap.josm.data.validation.Severity;
    2018import org.openstreetmap.josm.data.validation.TestError;
    21 import org.openstreetmap.josm.testutils.JOSMTestRules;
     19import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2220
    23 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     21import org.junit.jupiter.api.Test;
    2422
    2523/**
    2624 * Unit tests of {@link ValidatorTreePanel} class.
    2725 */
     26@BasicPreferences
    2827class ValidatorTreePanelTest {
    29 
    30     /**
    31      * Setup tests
    32      */
    33     @RegisterExtension
    34     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    35     public JOSMTestRules test = new JOSMTestRules().preferences();
    36 
    3728    /**
    3829     * Unit test of {@link ValidatorTreePanel#ValidatorTreePanel}.
  • trunk/test/unit/org/openstreetmap/josm/gui/download/BookmarkSelectionTest.java

    r17275 r18037  
    22package org.openstreetmap.josm.gui.download;
    33
    4 import org.junit.jupiter.api.extension.RegisterExtension;
     4import org.openstreetmap.josm.data.Bounds;
     5import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     6
    57import org.junit.jupiter.api.Test;
    6 import org.openstreetmap.josm.data.Bounds;
    7 import org.openstreetmap.josm.testutils.JOSMTestRules;
    8 
    9 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    108
    119/**
    1210 * Unit tests of {@link BookmarkSelection} class.
    1311 */
     12@BasicPreferences
    1413class BookmarkSelectionTest {
    15 
    16     /**
    17      * Setup tests
    18      */
    19     @RegisterExtension
    20     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    21     public JOSMTestRules test = new JOSMTestRules().preferences();
    22 
    2314    /**
    2415     * Test for {@link BookmarkSelection#BookmarkSelection}.
  • trunk/test/unit/org/openstreetmap/josm/gui/download/BoundingBoxSelectionTest.java

    r17275 r18037  
    22package org.openstreetmap.josm.gui.download;
    33
    4 import org.junit.jupiter.api.extension.RegisterExtension;
     4import org.openstreetmap.josm.data.Bounds;
     5import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     6
    57import org.junit.jupiter.api.Test;
    6 import org.openstreetmap.josm.data.Bounds;
    7 import org.openstreetmap.josm.testutils.JOSMTestRules;
    8 
    9 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    108
    119/**
    1210 * Unit tests of {@link BoundingBoxSelection} class.
    1311 */
     12@BasicPreferences
    1413class BoundingBoxSelectionTest {
    15 
    16     /**
    17      * Setup tests
    18      */
    19     @RegisterExtension
    20     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    21     public JOSMTestRules test = new JOSMTestRules().preferences();
    22 
    2314    /**
    2415     * Test for {@link BoundingBoxSelection#BoundingBoxSelection}.
  • trunk/test/unit/org/openstreetmap/josm/gui/download/PlaceSelectionTest.java

    r17275 r18037  
    22package org.openstreetmap.josm.gui.download;
    33
    4 import org.junit.jupiter.api.extension.RegisterExtension;
     4import org.openstreetmap.josm.data.Bounds;
     5import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     6
    57import org.junit.jupiter.api.Test;
    6 import org.openstreetmap.josm.data.Bounds;
    7 import org.openstreetmap.josm.testutils.JOSMTestRules;
    8 
    9 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    108
    119/**
    1210 * Unit tests of {@link PlaceSelection} class.
    1311 */
     12@BasicPreferences
    1413class PlaceSelectionTest {
    15 
    16     /**
    17      * Setup tests
    18      */
    19     @RegisterExtension
    20     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    21     public JOSMTestRules test = new JOSMTestRules().preferences();
    22 
    2314    /**
    2415     * Test for {@link PlaceSelection#PlaceSelection}.
  • trunk/test/unit/org/openstreetmap/josm/gui/download/TileSelectionTest.java

    r17275 r18037  
    22package org.openstreetmap.josm.gui.download;
    33
    4 import org.junit.jupiter.api.extension.RegisterExtension;
     4import org.openstreetmap.josm.data.Bounds;
     5import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     6
    57import org.junit.jupiter.api.Test;
    6 import org.openstreetmap.josm.data.Bounds;
    7 import org.openstreetmap.josm.testutils.JOSMTestRules;
    8 
    9 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    108
    119/**
    1210 * Unit tests of {@link TileSelection} class.
    1311 */
     12@BasicPreferences
    1413class TileSelectionTest {
    15 
    16     /**
    17      * Setup tests
    18      */
    19     @RegisterExtension
    20     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    21     public JOSMTestRules test = new JOSMTestRules().preferences();
    22 
    2314    /**
    2415     * Test for {@link TileSelection#TileSelection}.
  • trunk/test/unit/org/openstreetmap/josm/gui/help/HyperlinkHandlerTest.java

    r17275 r18037  
    1111import javax.swing.text.html.HTMLEditorKit;
    1212
    13 import org.junit.jupiter.api.extension.RegisterExtension;
     13import org.openstreetmap.josm.gui.widgets.JosmEditorPane;
     14import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     15
    1416import org.junit.jupiter.api.Test;
    15 import org.openstreetmap.josm.gui.widgets.JosmEditorPane;
    16 import org.openstreetmap.josm.testutils.JOSMTestRules;
    17 
    18 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1917
    2018/**
    2119 * Unit tests of {@link HyperlinkHandler} class.
    2220 */
     21@BasicPreferences
    2322class HyperlinkHandlerTest {
    24 
    25     /**
    26      * Setup tests
    27      */
    28     @RegisterExtension
    29     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    30     public JOSMTestRules test = new JOSMTestRules().preferences();
    31 
    3223    /**
    3324     * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/17338">#17338</a>.
  • trunk/test/unit/org/openstreetmap/josm/gui/history/CoordinateInfoViewerTest.java

    r17275 r18037  
    55import static org.junit.jupiter.api.Assertions.assertThrows;
    66
     7import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     8
    79import org.junit.jupiter.api.Test;
    8 import org.junit.jupiter.api.extension.RegisterExtension;
    9 import org.openstreetmap.josm.testutils.JOSMTestRules;
    10 
    11 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1210
    1311/**
    1412 * Unit tests of {@link CoordinateInfoViewer} class.
    1513 */
     14@BasicPreferences
    1615class CoordinateInfoViewerTest {
    17 
    18     /**
    19      * Setup test.
    20      */
    21     @RegisterExtension
    22     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    23     public JOSMTestRules test = new JOSMTestRules().preferences();
    24 
    2516    /**
    2617     * Test for {@link CoordinateInfoViewer#CoordinateInfoViewer} - {@code null} handling.
  • trunk/test/unit/org/openstreetmap/josm/gui/history/NodeListViewerTest.java

    r17275 r18037  
    55import static org.junit.jupiter.api.Assertions.assertThrows;
    66
     7import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     8
    79import org.junit.jupiter.api.Test;
    8 import org.junit.jupiter.api.extension.RegisterExtension;
    9 import org.openstreetmap.josm.testutils.JOSMTestRules;
    10 
    11 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1210
    1311/**
    1412 * Unit tests of {@link NodeListViewer} class.
    1513 */
     14@BasicPreferences
    1615class NodeListViewerTest {
    17 
    18     /**
    19      * Setup test.
    20      */
    21     @RegisterExtension
    22     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    23     public JOSMTestRules test = new JOSMTestRules().preferences();
    24 
    2516    /**
    2617     * Test for {@link NodeListViewer#NodeListViewer} - {@code null} handling.
  • trunk/test/unit/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanelTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
     6import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     7
    78import org.junit.jupiter.api.Test;
    8 import org.openstreetmap.josm.testutils.JOSMTestRules;
    9 
    10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    119
    1210/**
    1311 * Unit tests of {@link BasicUploadSettingsPanel} class.
    1412 */
     13@BasicPreferences
    1514class BasicUploadSettingsPanelTest {
    16 
    17     /**
    18      * Setup tests
    19      */
    20     @RegisterExtension
    21     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    22     public JOSMTestRules test = new JOSMTestRules().preferences();
    23 
    2415    /**
    2516     * Test of {@link BasicUploadSettingsPanel#BasicUploadSettingsPanel}.
  • trunk/test/unit/org/openstreetmap/josm/gui/io/ChangesetCellRendererTest.java

    r17717 r18037  
    66import javax.swing.JList;
    77
    8 import org.junit.jupiter.api.extension.RegisterExtension;
    98import org.junit.jupiter.api.Test;
    109import org.openstreetmap.josm.data.osm.Changeset;
    11 import org.openstreetmap.josm.testutils.JOSMTestRules;
    12 
    13 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     10import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1411
    1512import java.time.Instant;
     
    1815 * Unit tests of {@link ChangesetCellRenderer} class.
    1916 */
     17@BasicPreferences
    2018class ChangesetCellRendererTest {
    21     /**
    22      * Setup test.
    23      */
    24     @RegisterExtension
    25     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    26     public JOSMTestRules test = new JOSMTestRules().preferences();
    27 
    2819    /**
    2920     * Test of {@link ChangesetCellRenderer} class.
  • trunk/test/unit/org/openstreetmap/josm/gui/io/ChangesetManagementPanelTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
    76import org.junit.jupiter.api.Test;
    8 import org.openstreetmap.josm.testutils.JOSMTestRules;
    9 
    10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     7import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    118
    129/**
    1310 * Unit tests of {@link ChangesetManagementPanel} class.
    1411 */
     12@BasicPreferences
    1513class ChangesetManagementPanelTest {
    16 
    17     /**
    18      * Setup tests
    19      */
    20     @RegisterExtension
    21     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    22     public JOSMTestRules test = new JOSMTestRules().preferences();
    23 
    2414    /**
    2515     * Test of {@link ChangesetManagementPanel#ChangesetManagementPanel}.
  • trunk/test/unit/org/openstreetmap/josm/gui/io/CredentialDialogTest.java

    r17275 r18037  
    77import static org.junit.jupiter.api.Assertions.assertTrue;
    88
    9 import org.junit.jupiter.api.extension.RegisterExtension;
    109import org.junit.jupiter.api.Test;
    1110import org.openstreetmap.josm.gui.io.CredentialDialog.CredentialPanel;
    12 import org.openstreetmap.josm.testutils.JOSMTestRules;
    13 
    14 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     11import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1512
    1613/**
    1714 * Unit tests of {@link CredentialDialog} class.
    1815 */
     16@BasicPreferences
    1917class CredentialDialogTest {
    20 
    21     /**
    22      * Setup tests
    23      */
    24     @RegisterExtension
    25     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    26     public JOSMTestRules test = new JOSMTestRules().preferences();
    27 
    2818    /**
    2919     * Test of {@link CredentialDialog.CredentialPanel} class.
  • trunk/test/unit/org/openstreetmap/josm/gui/io/CustomConfiguratorTest.java

    r17275 r18037  
    1414
    1515import org.junit.jupiter.api.Test;
    16 import org.junit.jupiter.api.extension.RegisterExtension;
    1716import org.openstreetmap.josm.TestUtils;
    1817import org.openstreetmap.josm.data.Preferences;
    1918import org.openstreetmap.josm.data.PreferencesUtils;
    2019import org.openstreetmap.josm.spi.preferences.Config;
    21 import org.openstreetmap.josm.testutils.JOSMTestRules;
     20import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2221import org.openstreetmap.josm.tools.Utils;
    23 
    24 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    2522
    2623/**
    2724 * Unit tests for class {@link CustomConfigurator}.
    2825 */
     26@BasicPreferences
    2927class CustomConfiguratorTest {
    30 
    31     /**
    32      * Setup test.
    33      */
    34     @RegisterExtension
    35     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    36     public JOSMTestRules test = new JOSMTestRules().preferences();
    37 
    3828    /**
    3929     * Test method for {@link CustomConfigurator#exportPreferencesKeysToFile}.
  • trunk/test/unit/org/openstreetmap/josm/gui/io/LayerNameAndFilePathTableCellTest.java

    r17275 r18037  
    1010import javax.swing.JTable;
    1111
    12 import org.junit.jupiter.api.extension.RegisterExtension;
    1312import org.junit.jupiter.api.Test;
    1413import org.openstreetmap.josm.data.osm.DataSet;
    1514import org.openstreetmap.josm.gui.layer.AbstractModifiableLayer;
    1615import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    17 import org.openstreetmap.josm.testutils.JOSMTestRules;
    18 
    19 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     16import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2017
    2118/**
    2219 * Unit tests of {@link LayerNameAndFilePathTableCell} class.
    2320 */
     21@BasicPreferences
    2422class LayerNameAndFilePathTableCellTest {
    25     /**
    26      * Setup test.
    27      */
    28     @RegisterExtension
    29     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    30     public JOSMTestRules test = new JOSMTestRules().preferences();
    31 
    3223    /**
    3324     * Test of {@link LayerNameAndFilePathTableCell} class.
  • trunk/test/unit/org/openstreetmap/josm/gui/io/UploadDialogTest.java

    r17523 r18037  
    1818
    1919import org.junit.jupiter.api.Test;
    20 import org.junit.jupiter.api.extension.RegisterExtension;
    2120import org.openstreetmap.josm.TestUtils;
    2221import org.openstreetmap.josm.data.osm.DataSet;
     
    2423import org.openstreetmap.josm.io.UploadStrategySpecification;
    2524import org.openstreetmap.josm.spi.preferences.Config;
    26 import org.openstreetmap.josm.testutils.JOSMTestRules;
     25import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2726import org.openstreetmap.josm.testutils.mockers.WindowMocker;
    28 
    29 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    3027
    3128/**
    3229 * Unit tests of {@link UploadDialog} class.
    3330 */
     31@BasicPreferences
    3432class UploadDialogTest {
    35 
    36     /**
    37      * Setup tests
    38      */
    39     @RegisterExtension
    40     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    41     public JOSMTestRules test = new JOSMTestRules().preferences();
    42 
    4333    private static class MockUploadDialog extends JOptionPane implements IUploadDialog {
    4434        private final String source;
  • trunk/test/unit/org/openstreetmap/josm/gui/io/UploadParameterSummaryPanelTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
    76import org.junit.jupiter.api.Test;
    8 import org.openstreetmap.josm.testutils.JOSMTestRules;
    9 
    10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     7import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    118
    129/**
    1310 * Unit tests of {@link UploadParameterSummaryPanel} class.
    1411 */
     12@BasicPreferences
    1513class UploadParameterSummaryPanelTest {
    16 
    17     /**
    18      * Setup tests
    19      */
    20     @RegisterExtension
    21     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    22     public JOSMTestRules test = new JOSMTestRules().preferences();
    23 
    2414    /**
    2515     * Test of {@link UploadParameterSummaryPanel#UploadParameterSummaryPanel}.
  • trunk/test/unit/org/openstreetmap/josm/gui/io/UploadTextComponentValidatorTest.java

    r17275 r18037  
    88import javax.swing.JTextField;
    99
    10 import org.junit.jupiter.api.extension.RegisterExtension;
    1110import org.junit.jupiter.api.Test;
    12 import org.openstreetmap.josm.testutils.JOSMTestRules;
     11import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1312
    14 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    15 
     13@BasicPreferences
    1614class UploadTextComponentValidatorTest {
    17 
    18     /**
    19      * Setup test.
    20      */
    21     @RegisterExtension
    22     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    23     public JOSMTestRules test = new JOSMTestRules().preferences();
    24 
    2515    /**
    2616     * Unit test of {@link UploadTextComponentValidator.UploadCommentValidator}
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/ImageryLayerTest.java

    r17275 r18037  
    55import static org.junit.jupiter.api.Assertions.assertSame;
    66
    7 import org.junit.jupiter.api.extension.RegisterExtension;
    87import org.junit.jupiter.api.Test;
    98import org.openstreetmap.josm.gui.layer.imagery.ImageryFilterSettings;
    10 import org.openstreetmap.josm.testutils.JOSMTestRules;
    11 
    12 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     9import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1310
    1411/**
    1512 * Unit tests of {@link ImageryLayer} class.
    1613 */
     14@BasicPreferences
    1715class ImageryLayerTest {
    18 
    19     /**
    20      * For creating layers
    21      */
    22     @RegisterExtension
    23     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    24     public JOSMTestRules test = new JOSMTestRules().preferences();
    25 
    2616    /**
    2717     * Unit test of {@link ImageryLayer#getFilterSettings()}
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayerTest.java

    r18035 r18037  
    44import static org.junit.jupiter.api.Assertions.assertThrows;
    55
    6 import org.junit.jupiter.api.Test;
    7 import org.junit.jupiter.api.extension.RegisterExtension;
    86import org.openstreetmap.josm.data.osm.DataSet;
    97import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    10 import org.openstreetmap.josm.testutils.JOSMTestRules;
     8import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    119
    12 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     10import org.junit.jupiter.api.Test;
    1311
    1412/**
    1513 * Unit tests of {@link GeoImageLayer} class.
    1614 */
     15// Basic preferences are needed for OSM primitives
     16@BasicPreferences
    1717class GeoImageLayerTest {
    18     /**
    19      * We need prefs for this.
    20      */
    21     @RegisterExtension
    22     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    23     public JOSMTestRules test = new JOSMTestRules().preferences();
    2418
    2519    /**
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplayTest.java

    r17834 r18037  
    1414
    1515import org.junit.jupiter.api.Disabled;
    16 import org.junit.jupiter.api.extension.RegisterExtension;
    1716import org.junit.jupiter.api.Test;
    1817import org.openstreetmap.josm.gui.layer.geoimage.ImageDisplay.VisRect;
    1918import org.openstreetmap.josm.gui.layer.imagery.ImageryFilterSettings;
    20 import org.openstreetmap.josm.testutils.JOSMTestRules;
    21 
    22 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     19import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2320
    2421/**
    2522 * Unit tests of {@link ImageDisplay} class.
    2623 */
     24@BasicPreferences
    2725class ImageDisplayTest {
    28     /**
    29      * We need prefs for this.
    30      */
    31     @RegisterExtension
    32     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    33     public JOSMTestRules test = new JOSMTestRules().preferences();
    34 
    3526    /**
    3627     * Unit test of {@link ImageDisplay#calculateDrawImageRectangle}.
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/ThumbsLoaderTest.java

    r17891 r18037  
    22package org.openstreetmap.josm.gui.layer.geoimage;
    33
    4 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    54import org.junit.jupiter.api.Disabled;
    65import org.junit.jupiter.api.Test;
    7 import org.junit.jupiter.api.extension.RegisterExtension;
    8 import org.openstreetmap.josm.testutils.JOSMTestRules;
     6import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    97import org.openstreetmap.josm.tools.StreamUtils;
    108
     
    2220 * Unit tests of {@link ThumbsLoader} class.
    2321 */
     22@BasicPreferences
    2423class ThumbsLoaderTest {
    25     /**
    26      * Setup test.
    27      */
    28     @RegisterExtension
    29     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    30     public JOSMTestRules test = new JOSMTestRules().preferences();
    31 
    3224    /**
    3325     * Performance test for {@link ThumbsLoader}
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/WikimediaCommonsLoaderTest.java

    r18021 r18037  
    1111import java.util.List;
    1212
    13 import org.junit.jupiter.api.Test;
    14 import org.junit.jupiter.api.extension.RegisterExtension;
    1513import org.openstreetmap.josm.data.Bounds;
    16 import org.openstreetmap.josm.testutils.JOSMTestRules;
     14import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1715
    1816import com.github.tomakehurst.wiremock.WireMockServer;
    19 
    20 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     17import org.junit.jupiter.api.Test;
    2118
    2219/**
    2320 * Unit test of {@link WikimediaCommonsLoader}
    2421 */
     22@BasicPreferences
    2523class WikimediaCommonsLoaderTest {
    26 
    27     /**
    28      * Setup test.
    29      */
    30     @RegisterExtension
    31     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    32     public JOSMTestRules test = new JOSMTestRules().preferences();
    33 
    3424    /**
    3525     * Unit test of {@link WikimediaCommonsLoader}
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackActionTest.java

    r17275 r18037  
    88import java.util.Collections;
    99
    10 import org.junit.jupiter.api.extension.RegisterExtension;
    1110import org.junit.jupiter.api.Test;
    1211import org.openstreetmap.josm.TestUtils;
     
    1716import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    1817import org.openstreetmap.josm.io.GpxReaderTest;
    19 import org.openstreetmap.josm.testutils.JOSMTestRules;
     18import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2019import org.openstreetmap.josm.testutils.mockers.HelpAwareOptionPaneMocker;
    21 
    22 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    2320
    2421/**
    2522 * Unit tests of {@link DownloadAlongTrackAction} class.
    2623 */
     24@BasicPreferences
    2725class DownloadAlongTrackActionTest {
    28 
    29     /**
    30      * The test rules for this test
    31      */
    32     @RegisterExtension
    33     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    34     public JOSMTestRules test = new JOSMTestRules().preferences();
    35 
    3626    private static PleaseWaitRunnable createTask(String file) throws Exception {
    3727        // click "Download" when presented with the appropriate HelpAwareOptionPane
  • trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionFactoryTest.java

    r17774 r18037  
    55
    66import org.junit.jupiter.api.Test;
    7 import org.junit.jupiter.api.extension.RegisterExtension;
    87import org.openstreetmap.josm.gui.mappaint.mapcss.Condition.Context;
    98import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.Op;
    109import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.PseudoClasses;
    11 import org.openstreetmap.josm.testutils.JOSMTestRules;
     10import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1211
    13 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1412import net.trajano.commons.testing.UtilityClassTestUtil;
    1513
     
    2018 * Unit tests of {@link ConditionFactory}.
    2119 */
     20@BasicPreferences
    2221class ConditionFactoryTest {
    23 
    24     /**
    25      * Setup rule
    26      */
    27     @RegisterExtension
    28     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    29     public JOSMTestRules test = new JOSMTestRules().preferences();
    30 
    3122    /**
    3223     * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/14368">#14368</a>.
  • trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionTest.java

    r17642 r18037  
    88import org.junit.jupiter.api.BeforeEach;
    99import org.junit.jupiter.api.Test;
    10 import org.junit.jupiter.api.extension.RegisterExtension;
    1110import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1211import org.openstreetmap.josm.data.osm.OsmUtils;
     
    1615import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.Op;
    1716import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.SimpleKeyValueCondition;
    18 import org.openstreetmap.josm.testutils.JOSMTestRules;
    19 
    20 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     17import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2118
    2219/**
     
    2421 * @author Michael Zangl
    2522 */
     23// We need prefs for nodes
     24@BasicPreferences
    2625class ConditionTest {
    27     /**
    28      * We need prefs for nodes.
    29      */
    30     @RegisterExtension
    31     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    32     public JOSMTestRules test = new JOSMTestRules().preferences();
    3326    private OsmPrimitive node0;
    3427    private OsmPrimitive node1;
  • trunk/test/unit/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUITest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
     6import org.openstreetmap.josm.gui.MainApplication;
     7import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     8
    79import org.junit.jupiter.api.Test;
    8 import org.openstreetmap.josm.gui.MainApplication;
    9 import org.openstreetmap.josm.testutils.JOSMTestRules;
    10 
    11 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1210
    1311/**
    1412 * Unit tests of {@link FullyAutomaticAuthorizationUI} class.
    1513 */
     14@BasicPreferences
    1615class FullyAutomaticAuthorizationUITest {
    17 
    18     /**
    19      * Setup tests
    20      */
    21     @RegisterExtension
    22     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    23     public JOSMTestRules test = new JOSMTestRules().preferences();
    24 
    2516    /**
    2617     * Unit test of {@link FullyAutomaticAuthorizationUI#FullyAutomaticAuthorizationUI}.
  • trunk/test/unit/org/openstreetmap/josm/gui/oauth/FullyAutomaticPropertiesPanelTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertTrue;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
    76import org.junit.jupiter.api.Test;
    8 import org.openstreetmap.josm.testutils.JOSMTestRules;
    9 
    10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     7import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    118
    129/**
    1310 * Unit tests of {@link FullyAutomaticPropertiesPanel} class.
    1411 */
     12@BasicPreferences
    1513class FullyAutomaticPropertiesPanelTest {
    16 
    17     /**
    18      * Setup tests
    19      */
    20     @RegisterExtension
    21     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    22     public JOSMTestRules test = new JOSMTestRules().preferences();
    23 
    2414    /**
    2515     * Unit test of {@link FullyAutomaticPropertiesPanel#FullyAutomaticPropertiesPanel}.
  • trunk/test/unit/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUITest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
    76import org.junit.jupiter.api.Test;
    87import org.openstreetmap.josm.gui.MainApplication;
    9 import org.openstreetmap.josm.testutils.JOSMTestRules;
    10 
    11 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     8import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    129
    1310/**
    1411 * Unit tests of {@link ManualAuthorizationUI} class.
    1512 */
     13@BasicPreferences
    1614class ManualAuthorizationUITest {
    17 
    18     /**
    19      * Setup tests
    20      */
    21     @RegisterExtension
    22     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    23     public JOSMTestRules test = new JOSMTestRules().preferences();
    24 
    2515    /**
    2616     * Unit test of {@link ManualAuthorizationUI#ManualAuthorizationUI}.
  • trunk/test/unit/org/openstreetmap/josm/gui/oauth/SemiAutomaticAuthorizationUITest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
    76import org.junit.jupiter.api.Test;
    87import org.openstreetmap.josm.gui.MainApplication;
    9 import org.openstreetmap.josm.testutils.JOSMTestRules;
    10 
    11 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     8import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    129
    1310/**
    1411 * Unit tests of {@link SemiAutomaticAuthorizationUI} class.
    1512 */
     13@BasicPreferences
    1614class SemiAutomaticAuthorizationUITest {
    17 
    18     /**
    19      * Setup tests
    20      */
    21     @RegisterExtension
    22     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    23     public JOSMTestRules test = new JOSMTestRules().preferences();
    24 
    2515    /**
    2616     * Unit test of {@link SemiAutomaticAuthorizationUI#SemiAutomaticAuthorizationUI}.
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/AddTMSLayerPanelTest.java

    r17275 r18037  
    55import static org.junit.jupiter.api.Assertions.assertFalse;
    66
    7 import org.junit.jupiter.api.extension.RegisterExtension;
     7
     8import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     9
    810import org.junit.jupiter.api.Test;
    9 import org.openstreetmap.josm.testutils.JOSMTestRules;
    10 
    11 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1211
    1312/**
    1413 * Unit tests of {@link AddTMSLayerPanel} class.
    1514 */
     15@BasicPreferences
    1616class AddTMSLayerPanelTest {
    17 
    18     /**
    19      * Setup tests
    20      */
    21     @RegisterExtension
    22     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    23     public JOSMTestRules test = new JOSMTestRules().preferences();
    24 
    2517    /**
    2618     * Unit test of {@link AddTMSLayerPanel}.
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanelTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertFalse;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
     6
     7import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     8
    79import org.junit.jupiter.api.Test;
    8 import org.openstreetmap.josm.testutils.JOSMTestRules;
    9 
    10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1110
    1211/**
    1312 * Unit tests of {@link AddWMSLayerPanel} class.
    1413 */
     14@BasicPreferences
    1515class AddWMSLayerPanelTest {
    16 
    17     /**
    18      * Setup tests
    19      */
    20     @RegisterExtension
    21     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    22     public JOSMTestRules test = new JOSMTestRules().preferences();
    23 
    2416    /**
    2517     * Unit test of {@link AddWMSLayerPanel}.
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/AddWMTSLayerPanelTest.java

    r17275 r18037  
    55import static org.junit.jupiter.api.Assertions.assertThrows;
    66
     7import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     8
    79import org.junit.jupiter.api.Test;
    8 import org.junit.jupiter.api.extension.RegisterExtension;
    9 import org.openstreetmap.josm.testutils.JOSMTestRules;
    10 
    11 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1210
    1311/**
    1412 * Unit tests of {@link AddWMTSLayerPanel} class.
    1513 */
     14@BasicPreferences
    1615class AddWMTSLayerPanelTest {
    17 
    18     /**
    19      * Setup tests
    20      */
    21     @RegisterExtension
    22     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    23     public JOSMTestRules test = new JOSMTestRules().preferences();
    24 
    2516    /**
    2617     * Unit test of {@link AddWMTSLayerPanel}.
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ProxyPreferenceTest.java

    r17275 r18037  
    22package org.openstreetmap.josm.gui.preferences.server;
    33
     4import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
    45import static org.junit.jupiter.api.Assertions.assertNotNull;
    56
    6 import org.junit.jupiter.api.extension.RegisterExtension;
    77import org.junit.jupiter.api.Test;
    88import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
    9 import org.openstreetmap.josm.testutils.JOSMTestRules;
    10 
    11 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     9import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1210
    1311/**
    1412 * Unit tests of {@link ProxyPreference} class.
    1513 */
     14@BasicPreferences
    1615class ProxyPreferenceTest {
    17 
    18     /**
    19      * Setup tests
    20      */
    21     @RegisterExtension
    22     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    23     public JOSMTestRules test = new JOSMTestRules().preferences();
    24 
    2516    /**
    2617     * Unit test of {@link ProxyPreference#ProxyPreference}.
     
    3627    @Test
    3728    void testAddGui() {
    38         PreferencesTestUtils.doTestPreferenceSettingAddGui(new ProxyPreference.Factory(), null);
     29        assertDoesNotThrow(() -> PreferencesTestUtils.doTestPreferenceSettingAddGui(new ProxyPreference.Factory(), null));
    3930    }
    4031}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ServerAccessPreferenceTest.java

    r17275 r18037  
    22package org.openstreetmap.josm.gui.preferences.server;
    33
     4import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
    45import static org.junit.jupiter.api.Assertions.assertNotNull;
    56
    6 import org.junit.jupiter.api.extension.RegisterExtension;
     7
     8import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
     9import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     10
    711import org.junit.jupiter.api.Test;
    8 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
    9 import org.openstreetmap.josm.testutils.JOSMTestRules;
    10 
    11 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1212
    1313/**
    1414 * Unit tests of {@link ServerAccessPreference} class.
    1515 */
     16@BasicPreferences
    1617class ServerAccessPreferenceTest {
    17 
    18     /**
    19      * Setup tests
    20      */
    21     @RegisterExtension
    22     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    23     public JOSMTestRules test = new JOSMTestRules().preferences();
    24 
    2518    /**
    2619     * Unit test of {@link ServerAccessPreference#ServerAccessPreference}.
     
    3629    @Test
    3730    void testAddGui() {
    38         PreferencesTestUtils.doTestPreferenceSettingAddGui(new ServerAccessPreference.Factory(), null);
     31        assertDoesNotThrow(() -> PreferencesTestUtils.doTestPreferenceSettingAddGui(new ServerAccessPreference.Factory(), null));
    3932    }
    4033}
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetTest.java

    r17662 r18037  
    22package org.openstreetmap.josm.gui.tagging.presets;
    33
    4 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     4import static org.junit.jupiter.api.Assertions.assertFalse;
     5import static org.junit.jupiter.api.Assertions.assertTrue;
     6
     7import java.util.EnumSet;
     8
    59import org.junit.jupiter.api.Test;
    610import org.junit.jupiter.api.extension.RegisterExtension;
     
    812import org.openstreetmap.josm.data.osm.OsmUtils;
    913import org.openstreetmap.josm.data.osm.search.SearchCompiler;
     14import org.openstreetmap.josm.data.osm.search.SearchParseError;
    1015import org.openstreetmap.josm.gui.tagging.presets.items.Key;
    1116import org.openstreetmap.josm.testutils.JOSMTestRules;
    1217
    13 import java.util.EnumSet;
    14 
    15 import static org.junit.jupiter.api.Assertions.assertFalse;
    16 import static org.junit.jupiter.api.Assertions.assertTrue;
     18import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1719
    1820/**
     
    3032    /**
    3133     * Tests {@link TaggingPreset#test(IPrimitive)}
     34     * @throws SearchParseError never
    3235     */
    3336    @Test
    34     void test() throws Exception {
     37    void test() throws SearchParseError {
    3538        Key key = new Key();
    3639        key.key = "railway";
  • trunk/test/unit/org/openstreetmap/josm/gui/util/WindowGeometryTest.java

    r17704 r18037  
    1616
    1717import org.junit.jupiter.api.Test;
    18 import org.junit.jupiter.api.extension.RegisterExtension;
    1918import org.openstreetmap.josm.TestUtils;
    2019import org.openstreetmap.josm.gui.util.WindowGeometry.WindowGeometryException;
    2120import org.openstreetmap.josm.spi.preferences.Config;
    22 import org.openstreetmap.josm.testutils.JOSMTestRules;
     21import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2322
    24 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    2523import nl.jqno.equalsverifier.EqualsVerifier;
    2624import nl.jqno.equalsverifier.Warning;
     25import org.junit.jupiter.params.ParameterizedTest;
     26import org.junit.jupiter.params.provider.NullSource;
     27import org.junit.jupiter.params.provider.ValueSource;
    2728
    2829/**
    2930 * Unit tests of {@link WindowGeometry} class.
    3031 */
     32@BasicPreferences
    3133class WindowGeometryTest {
    32     /**
    33      * Some of this depends on preferences.
    34      */
    35     @RegisterExtension
    36     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    37     public JOSMTestRules test = new JOSMTestRules().preferences();
    38 
    3934    /**
    4035     * Test of {@link WindowGeometry#centerInWindow} method.
     
    6257     * Test of {@link WindowGeometry.WindowGeometryException} class.
    6358     */
    64     @Test
    65     void testWindowGeometryException1() {
    66         Config.getPref().put("test", null);
    67         assertThrows(WindowGeometryException.class, () -> new WindowGeometry("test"));
    68     }
    69 
    70     /**
    71      * Test of {@link WindowGeometry.WindowGeometryException} class.
    72      */
    73     @Test
    74     void testWindowGeometryException2() {
    75         Config.getPref().put("test", "");
    76         assertThrows(WindowGeometryException.class, () -> new WindowGeometry("test"));
    77     }
    78 
    79     /**
    80      * Test of {@link WindowGeometry.WindowGeometryException} class.
    81      */
    82     @Test
    83     void testWindowGeometryException3() {
    84         Config.getPref().put("test", "x=not_a_number");
    85         assertThrows(WindowGeometryException.class, () -> new WindowGeometry("test"));
    86     }
    87 
    88     /**
    89      * Test of {@link WindowGeometry.WindowGeometryException} class.
    90      */
    91     @Test
    92     void testWindowGeometryException4() {
    93         Config.getPref().put("test", "wrong_pattern");
     59    @ParameterizedTest
     60    @NullSource
     61    @ValueSource(strings = {"", "x=not_a_number", "wrong_pattern"})
     62    void testWindowGeometryException(String badValue) {
     63        Config.getPref().put("test", badValue);
    9464        assertThrows(WindowGeometryException.class, () -> new WindowGeometry("test"));
    9565    }
     
    10070     */
    10171    @Test
    102     void testWindowGeometryException5() throws WindowGeometryException {
     72    void testWindowGeometryExceptionNoThrow() throws WindowGeometryException {
    10373        Config.getPref().put("test", "x=15,y=55,width=200,height=100");
    10474        assertNotNull(new WindowGeometry("test"));
  • trunk/test/unit/org/openstreetmap/josm/io/CertificateAmendmentTest.java

    r17275 r18037  
    22package org.openstreetmap.josm.io;
    33
    4 import org.junit.jupiter.api.extension.RegisterExtension;
     4import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     5
     6import net.trajano.commons.testing.UtilityClassTestUtil;
    57import 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;
    108
    119/**
    1210 * Unit tests of {@link CertificateAmendment} class.
    1311 */
     12@BasicPreferences
    1413class CertificateAmendmentTest {
    15 
    16     /**
    17      * Setup rule
    18      */
    19     @RegisterExtension
    20     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    21     public JOSMTestRules test = new JOSMTestRules();
    22 
    2314    /**
    2415     * Tests that {@code CertificateAmendment} satisfies utility class criteria.
  • trunk/test/unit/org/openstreetmap/josm/io/ChangesetQueryTest.java

    r17843 r18037  
    22package org.openstreetmap.josm.io;
    33
    4 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    54import org.junit.jupiter.api.Test;
    6 import org.junit.jupiter.api.extension.RegisterExtension;
    7 import org.openstreetmap.josm.testutils.JOSMTestRules;
     5import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    86
    97import java.time.Instant;
     
    1614 * Unit tests of {@link ChangesetQuery}
    1715 */
     16@BasicPreferences
    1817class ChangesetQueryTest {
    19 
    20     /**
    21      * Setup test.
    22      */
    23     @RegisterExtension
    24     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    25     public JOSMTestRules test = new JOSMTestRules().preferences();
    26 
    2718    /**
    2819     * Unit tests of {@link ChangesetQuery#getQueryString()}
  • trunk/test/unit/org/openstreetmap/josm/io/DiffResultProcessorTest.java

    r17275 r18037  
    1010import java.util.Set;
    1111
    12 import org.junit.jupiter.api.extension.RegisterExtension;
    13 import org.junit.jupiter.api.Test;
    1412import org.openstreetmap.josm.data.coor.LatLon;
    1513import org.openstreetmap.josm.data.osm.Changeset;
     
    2220import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    2321import org.openstreetmap.josm.io.DiffResultProcessor.DiffResultEntry;
    24 import org.openstreetmap.josm.testutils.JOSMTestRules;
     22import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2523import org.openstreetmap.josm.tools.Logging;
    2624import org.openstreetmap.josm.tools.XmlParsingException;
    2725
    28 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     26import org.junit.jupiter.api.Test;
    2927
    3028/**
    3129 * Unit tests of {@link DiffResultProcessor}
    3230 */
     31@BasicPreferences
    3332class DiffResultProcessorTest {
    34 
    35     /**
    36      * Setup rule
    37      */
    38     @RegisterExtension
    39     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    40     public JOSMTestRules test = new JOSMTestRules();
    41 
    4233    private static void shouldFail(String s) {
    4334        try {
  • trunk/test/unit/org/openstreetmap/josm/io/GeoJSONReaderTest.java

    r18007 r18037  
    1919import java.util.stream.IntStream;
    2020
    21 import org.junit.jupiter.api.Test;
    22 import org.junit.jupiter.api.extension.RegisterExtension;
    2321import org.openstreetmap.josm.TestUtils;
    2422import org.openstreetmap.josm.data.coor.LatLon;
     
    2725import org.openstreetmap.josm.data.osm.Relation;
    2826import org.openstreetmap.josm.data.osm.Way;
    29 import org.openstreetmap.josm.testutils.JOSMTestRules;
     27import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     28
     29import org.junit.jupiter.api.Test;
    3030
    3131/**
    3232 * Unit tests of {@link GeoJSONReader}.
    3333 */
     34@BasicPreferences
    3435class GeoJSONReaderTest {
    35 
    36     /**
    37      * Setup test.
    38      */
    39     @RegisterExtension
    40     public JOSMTestRules rules = new JOSMTestRules();
    41 
    4236    /**
    4337     * Test reading a GeoJSON file.
  • trunk/test/unit/org/openstreetmap/josm/io/GpxReaderTest.java

    r17275 r18037  
    33
    44import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertThrows;
    56import static org.junit.jupiter.api.Assertions.assertTrue;
    6 import static org.junit.jupiter.api.Assertions.assertThrows;
    77
    88import java.io.ByteArrayInputStream;
     
    1515import java.util.Map;
    1616
    17 import org.junit.jupiter.api.Test;
    18 import org.junit.jupiter.api.extension.RegisterExtension;
    1917import org.openstreetmap.josm.TestUtils;
    2018import org.openstreetmap.josm.data.Bounds;
     
    2220import org.openstreetmap.josm.data.gpx.GpxData;
    2321import org.openstreetmap.josm.data.gpx.WayPoint;
    24 import org.openstreetmap.josm.testutils.JOSMTestRules;
     22import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     23
     24import org.junit.jupiter.api.Test;
    2525import org.xml.sax.SAXException;
    26 
    27 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    2826
    2927/**
    3028 * Tests the {@link GpxReader}.
    3129 */
     30@BasicPreferences
    3231public class GpxReaderTest {
    33 
    34     /**
    35      * Setup rule
    36      */
    37     @RegisterExtension
    38     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    39     public JOSMTestRules test = new JOSMTestRules();
    40 
    4132    /**
    4233     * Parses a GPX file and returns the parsed data
  • trunk/test/unit/org/openstreetmap/josm/io/GpxWriterTest.java

    r17723 r18037  
    1515import java.util.function.Consumer;
    1616
    17 import org.junit.jupiter.api.Test;
    18 import org.junit.jupiter.api.extension.RegisterExtension;
    1917import org.openstreetmap.josm.data.coor.LatLon;
    2018import org.openstreetmap.josm.data.gpx.GpxConstants;
     
    2523import org.openstreetmap.josm.data.gpx.GpxTrackSegment;
    2624import org.openstreetmap.josm.data.gpx.WayPoint;
    27 import org.openstreetmap.josm.testutils.JOSMTestRules;
    28 
    29 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     25import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     26
     27import org.junit.jupiter.api.Test;
    3028
    3129/**
    3230 * Tests the {@link GpxWriter}.
    3331 */
     32@BasicPreferences
    3433public class GpxWriterTest {
    35 
    36     /**
    37      * Setup rule
    38      */
    39     @RegisterExtension
    40     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    41     public JOSMTestRules test = new JOSMTestRules();
    42 
    4334    private static void testSingleWaypoint(Consumer<WayPoint> consumer, String atts) throws IOException {
    4435        GpxData gpx = new GpxData();
  • trunk/test/unit/org/openstreetmap/josm/io/MultiFetchOverpassObjectReaderTest.java

    r17275 r18037  
    77import java.util.List;
    88
    9 import org.junit.jupiter.api.extension.RegisterExtension;
    109import org.junit.jupiter.api.Test;
    1110import org.openstreetmap.josm.data.osm.Node;
     
    1312import org.openstreetmap.josm.data.osm.Relation;
    1413import org.openstreetmap.josm.data.osm.Way;
    15 import org.openstreetmap.josm.testutils.JOSMTestRules;
    16 
    17 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     14import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1815
    1916/**
    2017 * Unit tests of {@link MultiFetchOverpassObjectReader}.
    2118 */
     19@BasicPreferences
    2220class MultiFetchOverpassObjectReaderTest {
    23 
    24     /**
    25      * Setup test.
    26      */
    27     @RegisterExtension
    28     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    29     public JOSMTestRules test = new JOSMTestRules().preferences();
    30 
    3121    /**
    3222     * Test {@link MultiFetchOverpassObjectReader#buildRequestString}
  • trunk/test/unit/org/openstreetmap/josm/io/OsmApiExceptionTest.java

    r17275 r18037  
    55import static org.junit.jupiter.api.Assertions.assertTrue;
    66
    7 import org.junit.jupiter.api.extension.RegisterExtension;
    87import org.junit.jupiter.api.Test;
    9 import org.openstreetmap.josm.testutils.JOSMTestRules;
    10 
    11 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     8import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    129
    1310/**
    1411 * Unit tests of {@link OsmApiException} class.
    1512 */
     13@BasicPreferences
    1614class OsmApiExceptionTest {
    17 
    18     /**
    19      * Setup tests
    20      */
    21     @RegisterExtension
    22     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    23     public JOSMTestRules test = new JOSMTestRules().preferences();
    24 
    2515    /**
    2616     * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/17328">Bug #17328</a>.
  • trunk/test/unit/org/openstreetmap/josm/io/OsmChangeBuilderTest.java

    r17275 r18037  
    77import java.util.Arrays;
    88
    9 import org.junit.jupiter.api.extension.RegisterExtension;
    10 import org.junit.jupiter.api.Test;
    119import org.openstreetmap.josm.data.coor.LatLon;
    1210import org.openstreetmap.josm.data.osm.Changeset;
    1311import org.openstreetmap.josm.data.osm.Node;
    14 import org.openstreetmap.josm.testutils.JOSMTestRules;
     12import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1513import org.openstreetmap.josm.tools.Logging;
    1614
    17 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     15import org.junit.jupiter.api.Test;
    1816
    1917/**
    2018 * Unit tests of {@link OsmChangeBuilder}
    2119 */
     20@BasicPreferences
    2221class OsmChangeBuilderTest {
    23 
    24     /**
    25      * Setup rule
    26      */
    27     @RegisterExtension
    28     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    29     public JOSMTestRules test = new JOSMTestRules();
    30 
    3122    private static void shouldFail(Runnable r) {
    3223        try {
  • trunk/test/unit/org/openstreetmap/josm/io/OsmChangeReaderTest.java

    r17275 r18037  
    1010import java.util.Iterator;
    1111
    12 import org.junit.jupiter.api.extension.RegisterExtension;
    13 import org.junit.jupiter.api.Test;
    1412import org.openstreetmap.josm.data.coor.LatLon;
    1513import org.openstreetmap.josm.data.notes.Note;
     
    1715import org.openstreetmap.josm.data.osm.NoteData;
    1816import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    19 import org.openstreetmap.josm.testutils.JOSMTestRules;
     17import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2018import org.openstreetmap.josm.tools.Pair;
    2119
    22 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     20import org.junit.jupiter.api.Test;
    2321
    2422/**
    2523 * Unit tests of {@link OsmChangeReader}.
    2624 */
     25@BasicPreferences
    2726class OsmChangeReaderTest {
    28 
    29     /**
    30      * Setup rule
    31      */
    32     @RegisterExtension
    33     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    34     public JOSMTestRules test = new JOSMTestRules();
    35 
    3627    /**
    3728     * Parse osmChange.
  • trunk/test/unit/org/openstreetmap/josm/io/OsmChangesetContentParserTest.java

    r17838 r18037  
    1212import java.util.Arrays;
    1313
    14 import org.junit.jupiter.api.extension.RegisterExtension;
    15 import org.junit.jupiter.api.Test;
    1614import org.openstreetmap.josm.data.osm.ChangesetDataSet;
    1715import org.openstreetmap.josm.data.osm.ChangesetDataSet.ChangesetModificationType;
     
    2220import org.openstreetmap.josm.data.osm.history.HistoryWay;
    2321import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    24 import org.openstreetmap.josm.testutils.JOSMTestRules;
     22import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2523import org.openstreetmap.josm.tools.Logging;
    2624import org.openstreetmap.josm.tools.XmlParsingException;
    2725
    2826import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     27import org.junit.jupiter.api.Test;
    2928
    3029/**
    3130 * Unit tests of {@link OsmChangesetContentParser}.
    3231 */
     32@BasicPreferences
    3333class OsmChangesetContentParserTest {
    34 
    35     /**
    36      * Setup rule
    37      */
    38     @RegisterExtension
    39     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    40     public JOSMTestRules test = new JOSMTestRules();
    41 
    4234    private static void shouldFail(Runnable r) {
    4335        try {
  • trunk/test/unit/org/openstreetmap/josm/io/OsmChangesetParserTest.java

    r17275 r18037  
    99import java.util.List;
    1010
    11 import org.junit.jupiter.api.extension.RegisterExtension;
    1211import org.junit.jupiter.api.Test;
    1312import org.openstreetmap.josm.data.osm.Changeset;
    1413import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    15 import org.openstreetmap.josm.testutils.JOSMTestRules;
    16 
    17 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     14import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1815
    1916/**
    2017 * Unit tests of {@link OsmChangesetParser} class.
    2118 */
     19@BasicPreferences
    2220class OsmChangesetParserTest {
    2321
     
    5553        "</osm>";
    5654
    57     /**
    58      * Setup test.
    59      */
    60     @RegisterExtension
    61     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    62     public JOSMTestRules test = new JOSMTestRules().preferences();
    63 
    6455    private static List<Changeset> parse(String cs) throws IllegalDataException {
    6556        return OsmChangesetParser.parse(new ByteArrayInputStream(cs.getBytes(StandardCharsets.UTF_8)), NullProgressMonitor.INSTANCE);
  • trunk/test/unit/org/openstreetmap/josm/io/OsmJsonReaderTest.java

    r17911 r18037  
    1212import java.util.Iterator;
    1313
    14 import org.junit.jupiter.api.Test;
    15 import org.junit.jupiter.api.extension.RegisterExtension;
    1614import org.openstreetmap.josm.data.coor.LatLon;
    1715import org.openstreetmap.josm.data.osm.DataSet;
     
    2119import org.openstreetmap.josm.data.osm.Way;
    2220import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    23 import org.openstreetmap.josm.testutils.JOSMTestRules;
    24 
    25 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     21import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     22
     23import org.junit.jupiter.api.Test;
    2624
    2725/**
    2826 * Unit tests of {@link OsmReader} class.
    2927 */
     28@BasicPreferences
    3029class OsmJsonReaderTest {
    31 
    32     /**
    33      * Setup rule
    34      */
    35     @RegisterExtension
    36     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    37     public JOSMTestRules test = new JOSMTestRules();
    38 
    3930    /**
    4031     * Parse JSON.
  • trunk/test/unit/org/openstreetmap/josm/io/OsmReaderTest.java

    r17275 r18037  
    1818import java.util.Arrays;
    1919
    20 import org.junit.jupiter.api.extension.RegisterExtension;
    21 import org.junit.jupiter.api.Test;
    2220import org.openstreetmap.josm.TestUtils;
    2321import org.openstreetmap.josm.data.osm.DataSet;
     
    2725import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    2826import org.openstreetmap.josm.io.OsmReader.Options;
    29 import org.openstreetmap.josm.testutils.JOSMTestRules;
    30 
    31 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     27import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     28
     29import org.junit.jupiter.api.Test;
    3230
    3331/**
    3432 * Unit tests of {@link OsmReader} class.
    3533 */
     34@BasicPreferences
    3635class OsmReaderTest {
    37 
    38     /**
    39      * Setup rule
    40      */
    41     @RegisterExtension
    42     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    43     public JOSMTestRules test = new JOSMTestRules();
    44 
    4536    private static Options[][] options() {
    4637        return new Options[][]{
  • trunk/test/unit/org/openstreetmap/josm/io/OsmWriterTest.java

    r17749 r18037  
    1717import java.util.List;
    1818
    19 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    20 import org.junit.jupiter.api.Test;
    21 import org.junit.jupiter.api.extension.RegisterExtension;
    2219import org.openstreetmap.josm.data.coor.LatLon;
    2320import org.openstreetmap.josm.data.osm.Changeset;
     
    2926import org.openstreetmap.josm.data.osm.UploadPolicy;
    3027import org.openstreetmap.josm.data.osm.User;
    31 import org.openstreetmap.josm.testutils.JOSMTestRules;
     28import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     29
     30import org.junit.jupiter.api.Test;
    3231
    3332/**
    3433 * Unit tests of {@link OsmWriter} class.
    3534 */
     35@BasicPreferences
    3636class OsmWriterTest {
    37 
    38     /**
    39      * Setup rule
    40      */
    41     @RegisterExtension
    42     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    43     public JOSMTestRules test = new JOSMTestRules();
    44 
    4537    /**
    4638     * Unit test of {@link OsmWriter#byIdComparator}.
  • trunk/test/unit/org/openstreetmap/josm/io/ParseWithChangesetReaderTest.java

    r17275 r18037  
    1111import java.nio.charset.StandardCharsets;
    1212
    13 import org.junit.jupiter.api.extension.RegisterExtension;
    14 import org.junit.jupiter.api.Test;
    1513import org.openstreetmap.josm.data.osm.DataSet;
    1614import org.openstreetmap.josm.data.osm.Node;
    1715import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1816import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
    19 import org.openstreetmap.josm.testutils.JOSMTestRules;
     17import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2018import org.openstreetmap.josm.tools.Logging;
    2119
    22 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     20import org.junit.jupiter.api.Test;
    2321
    2422/**
    2523 * Additional unit tests for {@link OsmReader}.
    2624 */
     25@BasicPreferences
    2726class ParseWithChangesetReaderTest {
    28 
    29     /**
    30      * Setup rule
    31      */
    32     @RegisterExtension
    33     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    34     public JOSMTestRules test = new JOSMTestRules();
    35 
    3627    private static DataSet getDataSet(String doc) throws IOException, IllegalDataException {
    3728        try (InputStream is = new ByteArrayInputStream(doc.getBytes(StandardCharsets.UTF_8))) {
  • trunk/test/unit/org/openstreetmap/josm/io/auth/CredentialsAgentExceptionTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertEquals;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
    76import org.junit.jupiter.api.Test;
    8 import org.openstreetmap.josm.testutils.JOSMTestRules;
    9 
    10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    117
    128/**
     
    1410 */
    1511class CredentialsAgentExceptionTest {
    16 
    17     /**
    18      * Setup test
    19      */
    20     @RegisterExtension
    21     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    22     public JOSMTestRules test = new JOSMTestRules();
    23 
    2412    /**
    2513     * Unit test of {@code CredentialsAgentException#CredentialsAgentException}
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/AddTagsDialogTest.java

    r17275 r18037  
    66import java.util.Map;
    77
    8 import org.junit.jupiter.api.extension.RegisterExtension;
    98import org.junit.jupiter.api.Test;
    10 import org.openstreetmap.josm.testutils.JOSMTestRules;
    11 
    12 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     9import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1310
    1411/**
    1512 * Unit tests for class {@link AddTagsDialog}.
    1613 */
     14@BasicPreferences
    1715class AddTagsDialogTest {
    18     /**
    19      * Setup test.
    20      */
    21     @RegisterExtension
    22     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    23     public JOSMTestRules test = new JOSMTestRules().preferences();
    24 
    2516    /**
    2617     * Unit test of {@link AddTagsDialog#parseUrlTagsToKeyValues}
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/AddWayHandlerTest.java

    r17275 r18037  
    66import static org.junit.jupiter.api.Assertions.assertThrows;
    77
    8 import org.junit.jupiter.api.extension.RegisterExtension;
    9 import org.junit.jupiter.api.Test;
    108import org.openstreetmap.josm.data.osm.DataSet;
    119import org.openstreetmap.josm.gui.MainApplication;
    1210import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    1311import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;
    14 import org.openstreetmap.josm.testutils.JOSMTestRules;
     12import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1513
    16 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     14import org.junit.jupiter.api.Test;
    1715
    1816/**
    1917 * Unit tests of {@link AddWayHandler} class.
    2018 */
     19@BasicPreferences
    2120class AddWayHandlerTest {
    22     /**
    23      * Setup test.
    24      */
    25     @RegisterExtension
    26     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    27     public JOSMTestRules test = new JOSMTestRules();
    28 
    2921    private static AddWayHandler newHandler(String url) throws RequestHandlerBadRequestException {
    3022        AddWayHandler req = new AddWayHandler();
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandlerTest.java

    r17655 r18037  
    44import static org.hamcrest.CoreMatchers.hasItem;
    55import static org.hamcrest.MatcherAssert.assertThat;
     6import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
    67import static org.junit.jupiter.api.Assertions.assertEquals;
    7 import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
    88import static org.junit.jupiter.api.Assertions.assertThrows;
    99
     
    1111import java.util.List;
    1212
    13 import org.junit.jupiter.api.extension.RegisterExtension;
    14 import org.junit.jupiter.api.Test;
    1513import org.openstreetmap.josm.data.imagery.ImageryInfo;
    1614import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;
    17 import org.openstreetmap.josm.testutils.JOSMTestRules;
     15import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1816
    19 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     17import org.junit.jupiter.api.Test;
    2018
    2119/**
    2220 * Unit tests of {@link ImageryHandler} class.
    2321 */
     22@BasicPreferences
    2423class ImageryHandlerTest {
    25     /**
    26      * Setup test.
    27      */
    28     @RegisterExtension
    29     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    30     public JOSMTestRules test = new JOSMTestRules();
    31 
    3224    private static ImageryHandler newHandler(String url) throws RequestHandlerBadRequestException {
    3325        ImageryHandler req = new ImageryHandler();
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandlerTest.java

    r17275 r18037  
    66import static org.junit.jupiter.api.Assertions.assertThrows;
    77
    8 import org.junit.jupiter.api.extension.RegisterExtension;
     8import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;
     9import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     10
    911import org.junit.jupiter.api.Test;
    10 import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;
    11 import org.openstreetmap.josm.testutils.JOSMTestRules;
    12 
    13 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1412
    1513/**
     
    1715 */
    1816class LoadAndZoomHandlerTest {
    19     /**
    20      * Setup test.
    21      */
    22     @RegisterExtension
    23     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    24     public JOSMTestRules test = new JOSMTestRules();
    25 
    2617    private static LoadAndZoomHandler newHandler(String url) throws RequestHandlerBadRequestException {
    2718        LoadAndZoomHandler req = new LoadAndZoomHandler();
     
    6657     */
    6758    @Test
     59    @BasicPreferences
    6860    void testNominalRequest() throws Exception {
    6961        assertDoesNotThrow(() -> newHandler("https://localhost?bottom=0&top=0&left=1&right=1").handle());
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/LoadObjectHandlerTest.java

    r17332 r18037  
    99import static org.junit.jupiter.api.Assertions.assertThrows;
    1010
    11 import org.junit.jupiter.api.Test;
    12 import org.junit.jupiter.api.extension.RegisterExtension;
    1311import org.openstreetmap.josm.TestUtils;
    1412import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;
    1513import org.openstreetmap.josm.spi.preferences.Config;
    16 import org.openstreetmap.josm.testutils.JOSMTestRules;
     14import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1715
    1816import com.github.tomakehurst.wiremock.WireMockServer;
    19 
    20 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     17import org.junit.jupiter.api.Test;
    2118
    2219/**
     
    2421 */
    2522class LoadObjectHandlerTest {
    26     /**
    27      * Setup test.
    28      */
    29     @RegisterExtension
    30     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    31     public JOSMTestRules test = new JOSMTestRules();
    32 
    3323    private static LoadObjectHandler newHandler(String url) throws RequestHandlerBadRequestException {
    3424        LoadObjectHandler req = new LoadObjectHandler();
     
    6959     */
    7060    @Test
     61    @BasicPreferences
    7162    void testNominalRequest() {
    7263        WireMockServer wiremock = TestUtils.getWireMockServer();
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandlerTest.java

    r17275 r18037  
    99import java.util.Map;
    1010
    11 import org.junit.jupiter.api.Test;
    12 import org.junit.jupiter.api.extension.RegisterExtension;
    1311import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault;
    1412import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;
    15 import org.openstreetmap.josm.testutils.JOSMTestRules;
    1613
    17 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     14import org.junit.jupiter.api.Test;
    1815
    1916/**
     
    2118 */
    2219class RequestHandlerTest {
    23 
    24     /**
    25      * Setup test.
    26      */
    27     @RegisterExtension
    28     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    29     public JOSMTestRules test = new JOSMTestRules();
    30 
    3120    Map<String, String> getRequestParameter(String url) throws RequestHandlerBadRequestException {
    3221        final RequestHandler req = new RequestHandler() {
  • trunk/test/unit/org/openstreetmap/josm/plugins/PluginDownloadExceptionTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertEquals;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
    76import org.junit.jupiter.api.Test;
    8 import org.openstreetmap.josm.testutils.JOSMTestRules;
    9 
    10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    117
    128/**
     
    1410 */
    1511class PluginDownloadExceptionTest {
    16 
    17     /**
    18      * Setup test.
    19      */
    20     @RegisterExtension
    21     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    22     public JOSMTestRules test = new JOSMTestRules();
    23 
    2412    /**
    2513     * Unit test of {@link PluginDownloadException#PluginDownloadException}.
  • trunk/test/unit/org/openstreetmap/josm/plugins/PluginExceptionTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertEquals;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
    76import org.junit.jupiter.api.Test;
    8 import org.openstreetmap.josm.testutils.JOSMTestRules;
    9 
    10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    117
    128/**
     
    1410 */
    1511class PluginExceptionTest {
    16 
    17     /**
    18      * Setup test.
    19      */
    20     @RegisterExtension
    21     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    22     public JOSMTestRules test = new JOSMTestRules();
    23 
    2412    /**
    2513     * Unit test of {@link PluginException#PluginException}.
  • trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTest.java

    r17573 r18037  
    1717import javax.swing.JScrollPane;
    1818
    19 import org.junit.jupiter.api.extension.RegisterExtension;
    20 import org.junit.jupiter.api.Test;
    2119import org.openstreetmap.josm.TestUtils;
    2220import org.openstreetmap.josm.gui.MainApplication;
     
    2523import org.openstreetmap.josm.plugins.PluginHandler.DeprecatedPlugin;
    2624import org.openstreetmap.josm.plugins.PluginHandler.PluginInformationAction;
    27 import org.openstreetmap.josm.testutils.JOSMTestRules;
     25import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    2826import org.openstreetmap.josm.testutils.mockers.HelpAwareOptionPaneMocker;
    2927import org.openstreetmap.josm.testutils.mockers.JOptionPaneSimpleMocker;
    3028
    31 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    3229import nl.jqno.equalsverifier.EqualsVerifier;
     30import org.junit.jupiter.api.Test;
    3331
    3432/**
    3533 * Unit tests of {@link PluginHandler} class.
    3634 */
     35@BasicPreferences
    3736class PluginHandlerTest {
    38 
    39     /**
    40      * Setup test.
    41      */
    42     @RegisterExtension
    43     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    44     public JOSMTestRules test = new JOSMTestRules();
    45 
    4637    /**
    4738     * Unit test of methods {@link DeprecatedPlugin#equals} and {@link DeprecatedPlugin#hashCode}.
  • trunk/test/unit/org/openstreetmap/josm/plugins/PluginListParseExceptionTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertEquals;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
    76import org.junit.jupiter.api.Test;
    8 import org.openstreetmap.josm.testutils.JOSMTestRules;
    9 
    10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    117
    128/**
     
    1410 */
    1511class PluginListParseExceptionTest {
    16 
    17     /**
    18      * Setup test.
    19      */
    20     @RegisterExtension
    21     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    22     public JOSMTestRules test = new JOSMTestRules();
    23 
    2412    /**
    2513     * Unit test of {@link PluginListParseException#PluginListParseException}.
  • trunk/test/unit/org/openstreetmap/josm/spi/preferences/ListListSettingTest.java

    r17275 r18037  
    22package org.openstreetmap.josm.spi.preferences;
    33
    4 import org.junit.jupiter.api.extension.RegisterExtension;
    54import org.junit.jupiter.api.Test;
    65import org.openstreetmap.josm.TestUtils;
    7 import org.openstreetmap.josm.testutils.JOSMTestRules;
     6import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    87
    9 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    108import nl.jqno.equalsverifier.EqualsVerifier;
    119
     
    1311 * Test {@link ListListSetting}.
    1412 */
     13// This is a preference test
     14@BasicPreferences
    1515class ListListSettingTest {
    16     /**
    17      * This is a preference test
    18      */
    19     @RegisterExtension
    20     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    21     public JOSMTestRules test = new JOSMTestRules().preferences();
    22 
    2316    /**
    2417     * Unit test of methods {@link ListListSetting#equals} and {@link ListListSetting#hashCode}.
  • trunk/test/unit/org/openstreetmap/josm/spi/preferences/ListSettingTest.java

    r17275 r18037  
    22package org.openstreetmap.josm.spi.preferences;
    33
    4 import org.junit.jupiter.api.extension.RegisterExtension;
    54import org.junit.jupiter.api.Test;
    65import org.openstreetmap.josm.TestUtils;
    7 import org.openstreetmap.josm.testutils.JOSMTestRules;
     6import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    87
    9 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    108import nl.jqno.equalsverifier.EqualsVerifier;
    119
     
    1311 * Test {@link ListSetting}.
    1412 */
     13// This is a preference test
     14@BasicPreferences
    1515class ListSettingTest {
    16     /**
    17      * This is a preference test
    18      */
    19     @RegisterExtension
    20     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    21     public JOSMTestRules test = new JOSMTestRules().preferences();
    22 
    2316    /**
    2417     * Unit test of methods {@link ListSetting#equals} and {@link ListSetting#hashCode}.
  • trunk/test/unit/org/openstreetmap/josm/spi/preferences/MapListSettingTest.java

    r17275 r18037  
    22package org.openstreetmap.josm.spi.preferences;
    33
    4 import org.junit.jupiter.api.extension.RegisterExtension;
    54import org.junit.jupiter.api.Test;
    65import org.openstreetmap.josm.TestUtils;
    7 import org.openstreetmap.josm.testutils.JOSMTestRules;
     6import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    87
    9 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    108import nl.jqno.equalsverifier.EqualsVerifier;
    119
     
    1311 * Test {@link MapListSetting}.
    1412 */
     13// This is a preference test
     14@BasicPreferences
    1515class MapListSettingTest {
    16     /**
    17      * This is a preference test
    18      */
    19     @RegisterExtension
    20     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    21     public JOSMTestRules test = new JOSMTestRules().preferences();
    22 
    2316    /**
    2417     * Unit test of methods {@link MapListSetting#equals} and {@link MapListSetting#hashCode}.
  • trunk/test/unit/org/openstreetmap/josm/spi/preferences/StringSettingTest.java

    r17275 r18037  
    22package org.openstreetmap.josm.spi.preferences;
    33
    4 import org.junit.jupiter.api.extension.RegisterExtension;
    54import org.junit.jupiter.api.Test;
    65import org.openstreetmap.josm.TestUtils;
    7 import org.openstreetmap.josm.testutils.JOSMTestRules;
     6import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    87
    9 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    108import nl.jqno.equalsverifier.EqualsVerifier;
    119
     
    1311 * Test {@link StringSetting}.
    1412 */
     13// This is a preference test
     14@BasicPreferences
    1515class StringSettingTest {
    16     /**
    17      * This is a preference test
    18      */
    19     @RegisterExtension
    20     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    21     public JOSMTestRules test = new JOSMTestRules().preferences();
    22 
    2316    /**
    2417     * Unit test of methods {@link StringSetting#equals} and {@link StringSetting#hashCode}.
  • trunk/test/unit/org/openstreetmap/josm/testutils/annotations/I18n.java

    r17914 r18037  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.testutils.annotations;
     3
     4import java.lang.annotation.Documented;
     5import java.lang.annotation.ElementType;
     6import java.lang.annotation.Retention;
     7import java.lang.annotation.RetentionPolicy;
     8import java.lang.annotation.Target;
    39
    410import org.junit.jupiter.api.extension.AfterEachCallback;
     
    814import org.junit.platform.commons.support.AnnotationSupport;
    915
    10 import java.lang.annotation.Documented;
    11 import java.lang.annotation.ElementType;
    12 import java.lang.annotation.Retention;
    13 import java.lang.annotation.RetentionPolicy;
    14 import java.lang.annotation.Target;
    15 
    1616/**
    1717 * Enables the i18n module for this test.
    1818 * @author Taylor Smock
    1919 * @see org.openstreetmap.josm.testutils.JOSMTestRules#i18n(String)
     20 * @since 17914
    2021 */
    2122@Documented
  • trunk/test/unit/org/openstreetmap/josm/tools/CheckParameterUtilTest.java

    r17275 r18037  
    22package org.openstreetmap.josm.tools;
    33
    4 import org.junit.jupiter.api.extension.RegisterExtension;
     4import net.trajano.commons.testing.UtilityClassTestUtil;
    55import 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;
    106
    117/**
     
    139 */
    1410class CheckParameterUtilTest {
    15 
    16     /**
    17      * Setup rule.
    18      */
    19     @RegisterExtension
    20     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    21     public JOSMTestRules test = new JOSMTestRules();
    22 
    2311    /**
    2412     * Tests that {@code CheckParameterUtil} satisfies utility class criteria.
  • trunk/test/unit/org/openstreetmap/josm/tools/FontsManagerTest.java

    r17275 r18037  
    77import java.awt.GraphicsEnvironment;
    88
    9 import org.junit.jupiter.api.extension.RegisterExtension;
     9import net.trajano.commons.testing.UtilityClassTestUtil;
    1010import org.junit.jupiter.api.Test;
    11 import org.openstreetmap.josm.testutils.JOSMTestRules;
    12 
    13 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    14 import net.trajano.commons.testing.UtilityClassTestUtil;
    1511
    1612/**
     
    1814 */
    1915class FontsManagerTest {
    20 
    21     /**
    22      * Setup test.
    23      */
    24     @RegisterExtension
    25     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    26     public JOSMTestRules test = new JOSMTestRules();
    27 
    2816    /**
    2917     * Test method for {@code FontsManager#initialize}
  • trunk/test/unit/org/openstreetmap/josm/tools/ImageResizeModeTest.java

    r17275 r18037  
    88import java.awt.Dimension;
    99
    10 import org.junit.jupiter.api.extension.RegisterExtension;
    1110import org.junit.jupiter.api.Test;
    12 import org.openstreetmap.josm.testutils.JOSMTestRules;
    13 
    14 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     11import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1512
    1613/**
    1714 * Unit tests of {@link ImageResizeMode} class.
    1815 */
     16@BasicPreferences
    1917class ImageResizeModeTest {
    20 
    21     /**
    22      * Setup test.
    23      */
    24     @RegisterExtension
    25     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    26     public JOSMTestRules test = new JOSMTestRules().preferences();
    27 
    2818    final Dimension image = new Dimension(64, 48);
    2919    final Dimension smallImage = new Dimension(14, 10);
  • trunk/test/unit/org/openstreetmap/josm/tools/KeyboardUtilsTest.java

    r17962 r18037  
    1414
    1515import org.junit.jupiter.api.Test;
    16 import org.junit.jupiter.api.extension.RegisterExtension;
    17 import org.openstreetmap.josm.testutils.JOSMTestRules;
    18 
    19 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    2016
    2117/**
     
    2319 */
    2420class KeyboardUtilsTest {
    25     /**
    26      * Initializes test.
    27      */
    28     @RegisterExtension
    29     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    30     public JOSMTestRules rules = new JOSMTestRules();
    31 
    3221    /**
    3322     * Checks that definition of extended characters is correct
  • trunk/test/unit/org/openstreetmap/josm/tools/ListenableWeakReferenceTest.java

    r17275 r18037  
    88import static org.junit.jupiter.api.Assertions.assertTrue;
    99
    10 import org.junit.jupiter.api.extension.RegisterExtension;
    1110import org.junit.jupiter.api.Test;
    12 import org.openstreetmap.josm.testutils.JOSMTestRules;
    13 
    14 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1511
    1612/**
     
    2016 */
    2117class ListenableWeakReferenceTest {
    22     /**
    23      * Default test rules.
    24      */
    25     @RegisterExtension
    26     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    27     public JOSMTestRules test = new JOSMTestRules();
    2818    private Object object;
    2919    private boolean called;
  • trunk/test/unit/org/openstreetmap/josm/tools/OptionParserTest.java

    r17275 r18037  
    44import static org.junit.jupiter.api.Assertions.assertEquals;
    55import static org.junit.jupiter.api.Assertions.assertFalse;
     6import static org.junit.jupiter.api.Assertions.assertThrows;
    67import static org.junit.jupiter.api.Assertions.assertTrue;
    7 import static org.junit.jupiter.api.Assertions.assertThrows;
    88
    99import java.util.ArrayList;
     
    1313import java.util.concurrent.atomic.AtomicReference;
    1414
    15 import org.junit.jupiter.api.extension.RegisterExtension;
    16 import org.junit.jupiter.api.Test;
    17 import org.openstreetmap.josm.testutils.JOSMTestRules;
     15import org.openstreetmap.josm.testutils.annotations.I18n;
    1816import org.openstreetmap.josm.tools.OptionParser.OptionCount;
    1917import org.openstreetmap.josm.tools.OptionParser.OptionParseException;
    2018
    21 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     19import org.junit.jupiter.api.Test;
    2220
    2321/**
     
    2523 * @author Michael Zangl
    2624 */
     25@I18n
    2726class OptionParserTest {
    28     /**
    29      * Setup test.
    30      */
    31     @RegisterExtension
    32     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    33     public JOSMTestRules test = new JOSMTestRules().i18n();
    34 
    3527    // A reason for moving to jupiter...
    3628    @Test
  • trunk/test/unit/org/openstreetmap/josm/tools/OsmUrlToBoundsTest.java

    r17275 r18037  
    22package org.openstreetmap.josm.tools;
    33
     4import org.openstreetmap.josm.data.Bounds;
     5
    46import org.junit.Assert;
    5 import org.junit.jupiter.api.extension.RegisterExtension;
    67import org.junit.jupiter.api.Test;
    7 import org.openstreetmap.josm.data.Bounds;
    8 import org.openstreetmap.josm.testutils.JOSMTestRules;
    9 
    10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    118
    129/**
     
    1411*/
    1512class OsmUrlToBoundsTest {
    16 
    17     /**
    18      * Setup test.
    19      */
    20     @RegisterExtension
    21     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    22     public JOSMTestRules test = new JOSMTestRules();
    23 
    2413    /**
    2514     * Test for {@link OsmUrlToBounds#positionToBounds}.
  • trunk/test/unit/org/openstreetmap/josm/tools/StreamUtilsTest.java

    r17275 r18037  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.tools;
    3 
    4 import org.junit.jupiter.api.extension.RegisterExtension;
    5 import org.junit.jupiter.api.Test;
    6 import org.openstreetmap.josm.testutils.JOSMTestRules;
    73
    84import static org.junit.jupiter.api.Assertions.assertEquals;
     
    117import java.util.stream.Collectors;
    128
    13 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    149import net.trajano.commons.testing.UtilityClassTestUtil;
     10import org.junit.jupiter.api.Test;
    1511
    1612/**
     
    1814 */
    1915class StreamUtilsTest {
    20 
    21     /**
    22      * Setup rule.
    23      */
    24     @RegisterExtension
    25     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    26     public JOSMTestRules test = new JOSMTestRules();
    27 
    2816    /**
    2917     * Tests that {@code StreamUtils} satisfies utility class criteria.
  • trunk/test/unit/org/openstreetmap/josm/tools/Tag2LinkTest.java

    r17909 r18037  
    77
    88import org.junit.Assert;
    9 import org.junit.jupiter.api.extension.RegisterExtension;
    109import org.junit.jupiter.api.Test;
    11 import org.openstreetmap.josm.testutils.JOSMTestRules;
    12 
    13 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     10import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1411
    1512/**
    1613 * Test {@link Tag2Link}
    1714 */
     15@BasicPreferences
    1816class Tag2LinkTest {
    1917
     
    2725        Assert.assertEquals(Arrays.asList(expected), links);
    2826    }
    29 
    30     /**
    31      * Setup test.
    32      */
    33     @RegisterExtension
    34     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    35     public JOSMTestRules test = new JOSMTestRules().preferences();
    3627
    3728    /**
  • trunk/test/unit/org/openstreetmap/josm/tools/TextTagParserTest.java

    r17275 r18037  
    1111import java.util.Map;
    1212
    13 import org.junit.jupiter.api.extension.RegisterExtension;
    1413import org.junit.jupiter.api.Test;
    15 import org.openstreetmap.josm.testutils.JOSMTestRules;
    16 
    17 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     14import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1815
    1916/**
    2017 * Unit tests of {@link TextTagParser} class.
    2118 */
     19// Some of this depends on preferences
     20@BasicPreferences
    2221class TextTagParserTest {
    23     /**
    24      * Some of this depends on preferences.
    25      */
    26     @RegisterExtension
    27     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    28     public JOSMTestRules test = new JOSMTestRules().preferences();
    29 
    3022    /**
    3123     * Test of {@link TextTagParser#unescape} method.
  • trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java

    r17275 r18037  
    2222import java.util.regex.Pattern;
    2323
     24import net.trajano.commons.testing.UtilityClassTestUtil;
    2425import org.junit.jupiter.api.Test;
    25 import org.junit.jupiter.api.extension.RegisterExtension;
    26 import org.openstreetmap.josm.testutils.JOSMTestRules;
    27 
    28 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    29 import net.trajano.commons.testing.UtilityClassTestUtil;
    3026
    3127/**
     
    3329 */
    3430class UtilsTest {
    35     /**
    36      * Use default, basic test rules.
    37      */
    38     @RegisterExtension
    39     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    40     public JOSMTestRules rules = new JOSMTestRules();
    41 
    4231    /**
    4332     * Tests that {@code Utils} satisfies utility class criteria.
  • trunk/test/unit/org/openstreetmap/josm/tools/XmlUtilsTest.java

    r17275 r18037  
    22package org.openstreetmap.josm.tools;
    33
    4 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    5 import org.junit.jupiter.api.extension.RegisterExtension;
    6 import org.junit.jupiter.api.Test;
    7 import org.openstreetmap.josm.TestUtils;
    8 import org.openstreetmap.josm.testutils.JOSMTestRules;
    9 import org.xml.sax.InputSource;
    10 import org.xml.sax.SAXException;
    11 import org.xml.sax.helpers.DefaultHandler;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertNotNull;
     6import static org.junit.jupiter.api.Assertions.fail;
     7
     8import java.io.FileInputStream;
     9import java.io.IOException;
     10import java.io.StringWriter;
    1211
    1312import javax.xml.parsers.ParserConfigurationException;
     
    1615import javax.xml.transform.stream.StreamResult;
    1716import javax.xml.transform.stream.StreamSource;
    18 import java.io.FileInputStream;
    19 import java.io.IOException;
    20 import java.io.StringWriter;
    2117
    22 import static org.junit.jupiter.api.Assertions.assertEquals;
    23 import static org.junit.jupiter.api.Assertions.assertNotNull;
    24 import static org.junit.jupiter.api.Assertions.fail;
     18import org.openstreetmap.josm.TestUtils;
     19
     20import org.junit.jupiter.api.Test;
     21import org.xml.sax.InputSource;
     22import org.xml.sax.SAXException;
     23import org.xml.sax.helpers.DefaultHandler;
    2524
    2625/**
     
    2827 */
    2928class XmlUtilsTest {
    30 
    31     /**
    32      * Use default, basic test rules.
    33      */
    34     @RegisterExtension
    35     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    36     public JOSMTestRules rules = new JOSMTestRules();
    37 
    3829    private static final String EXPECTED = "External Entity: Failed to read external document 'passwd', " +
    3930            "because 'file' access is not allowed due to restriction set by the accessExternalDTD property.";
  • trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportExceptionHandlerTest.java

    r17275 r18037  
    44import java.util.concurrent.CountDownLatch;
    55
    6 import org.junit.jupiter.api.extension.RegisterExtension;
    76import org.junit.jupiter.api.Test;
    8 import org.openstreetmap.josm.testutils.JOSMTestRules;
    9 
    10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    117
    128/**
     
    1410 */
    1511class BugReportExceptionHandlerTest {
    16     /**
    17      * No dependencies
    18      */
    19     @RegisterExtension
    20     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    21     public JOSMTestRules test = new JOSMTestRules();
    22 
    2312    /**
    2413     * Unit test for {@link BugReportExceptionHandler#handleException} method.
  • trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportTest.java

    r17275 r18037  
    1010import java.io.StringWriter;
    1111
    12 import org.junit.jupiter.api.extension.RegisterExtension;
    1312import org.junit.jupiter.api.Test;
    1413import org.openstreetmap.josm.actions.ShowStatusReportAction;
    15 import org.openstreetmap.josm.testutils.JOSMTestRules;
    16 
    17 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     14import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1815
    1916/**
     
    2118 * @author Michael Zangl
    2219 */
     20// Preferences for the report text
     21@BasicPreferences
    2322class BugReportTest {
    24     /**
    25      * Preferences for the report text
    26      */
    27     @RegisterExtension
    28     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    29     public JOSMTestRules test = new JOSMTestRules().preferences();
    30 
    3123    /**
    3224     * Test {@link BugReport#getReportText}
Note: See TracChangeset for help on using the changeset viewer.