Ignore:
Timestamp:
2020-10-28T20:41:00+01:00 (4 years ago)
Author:
Don-vip
Message:

see #16567 - upgrade almost all tests to JUnit 5, except those depending on WiremockRule

See https://github.com/tomakehurst/wiremock/issues/684

Location:
trunk/test/unit/org/openstreetmap/josm/gui/tagging
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/TagEditorModelTest.java

    r9816 r17275  
    22package org.openstreetmap.josm.gui.tagging;
    33
    4 import static org.junit.Assert.assertEquals;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
    55
    6 import org.junit.Test;
     6import org.junit.jupiter.api.Test;
    77
    88/**
    99 * Unit tests of {@link TagEditorModel} class.
    1010 */
    11 public class TagEditorModelTest {
     11class TagEditorModelTest {
    1212
    1313    /**
     
    1515     */
    1616    @Test
    17     public void testTagEditorModel() {
     17    void testTagEditorModel() {
    1818        TagEditorModel tem = new TagEditorModel();
    1919        tem.add(null, null);
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/TagModelTest.java

    r9816 r17275  
    22package org.openstreetmap.josm.gui.tagging;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertTrue;
    66
    7 import org.junit.Test;
     7import org.junit.jupiter.api.Test;
    88
    99/**
    1010 * Unit tests of {@link TagModel} class.
    1111 */
    12 public class TagModelTest {
     12class TagModelTest {
    1313
    1414    /**
     
    1616     */
    1717    @Test
    18     public void testTagModelSingleValue() {
     18    void testTagModelSingleValue() {
    1919        TagModel tm = new TagModel();
    2020        assertEquals("", tm.getName());
     
    4343     */
    4444    @Test
    45     public void testTagModelMultipleValues() {
     45    void testTagModelMultipleValues() {
    4646        TagModel tm = new TagModel("key2", "val2");
    4747        assertEquals("key2", tm.getName());
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManagerTest.java

    r14503 r17275  
    22package org.openstreetmap.josm.gui.tagging.ac;
    33
    4 import org.junit.Rule;
    5 import org.junit.Test;
     4import org.junit.jupiter.api.extension.RegisterExtension;
     5import org.junit.jupiter.api.Test;
    66import org.openstreetmap.josm.TestUtils;
    77import org.openstreetmap.josm.data.osm.DataSet;
     
    1717 * Unit tests of {@link AutoCompletionManager} class.
    1818 */
    19 public class AutoCompletionManagerTest {
     19class AutoCompletionManagerTest {
    2020
    2121    /**
    2222     * Setup rule
    2323     */
    24     @Rule
     24    @RegisterExtension
    2525    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    2626    public JOSMTestRules test = new JOSMTestRules();
     
    3030     */
    3131    @Test
    32     public void testTicket17064() {
     32    void testTicket17064() {
    3333        DataSet ds = new DataSet();
    3434        OsmDataLayer layer = new OsmDataLayer(ds, "testTicket17064", null);
     
    4242     */
    4343    @Test
    44     public void testEqualsContract() {
     44    void testEqualsContract() {
    4545        TestUtils.assumeWorkingEqualsVerifier();
    4646        EqualsVerifier.forClass(UserInputTag.class).usingGetClass()
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/PresetClassificationsTest.java

    r10638 r17275  
    22package org.openstreetmap.josm.gui.tagging.presets;
    33
    4 import static org.junit.Assert.assertFalse;
    5 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertFalse;
     5import static org.junit.jupiter.api.Assertions.assertTrue;
    66
    77import java.io.IOException;
     
    1212import java.util.stream.Collectors;
    1313
    14 import org.junit.BeforeClass;
    15 import org.junit.Test;
     14import org.junit.jupiter.api.BeforeAll;
     15import org.junit.jupiter.api.Test;
    1616import org.openstreetmap.josm.JOSMFixture;
    1717import org.openstreetmap.josm.data.osm.Node;
     
    2626 * Unit tests of {@link PresetClassifications} class.
    2727 */
    28 public class PresetClassificationsTest {
     28class PresetClassificationsTest {
    2929
    3030    static final PresetClassifications classifications = new PresetClassifications();
     
    3535     * @throws IOException if any I/O error occurs
    3636     */
    37     @BeforeClass
     37    @BeforeAll
    3838    public static void setUp() throws IOException, SAXException {
    3939        JOSMFixture.createUnitTestFixture().init();
     
    5555     */
    5656    @Test
    57     public void testBuilding() {
     57    void testBuilding() {
    5858        final Way w = new Way();
    5959        final Node n1 = new Node();
     
    6161        w.addNode(new Node());
    6262        w.addNode(new Node());
    63         assertFalse("unclosed way should not match building preset", getMatchingPresetNames("building", w).contains("Building"));
     63        assertFalse(getMatchingPresetNames("building", w).contains("Building"), "unclosed way should not match building preset");
    6464        w.addNode(n1);
    65         assertTrue("closed way should match building preset", getMatchingPresetNames("building", w).contains("Building"));
     65        assertTrue(getMatchingPresetNames("building", w).contains("Building"), "closed way should match building preset");
    6666    }
    6767
     
    7070     */
    7171    @Test
    72     public void testRelationsForTram() {
     72    void testRelationsForTram() {
    7373        final OsmPrimitive tram = OsmUtils.createPrimitive("way railway=tram");
    74         assertTrue("railway=tram should match 'Railway Route' for relation creation", getMatchingPresetNames("route", tram)
    75                 .contains("Railway Route"));
    76         assertTrue("railway=tram should match 'Public Transport Route (Rail)' for relation creation", getMatchingPresetNames("route", tram)
    77                 .contains("Public Transport Route (Rail)"));
    78         assertFalse("railway=tram should not match 'Bus'", getMatchingPresetNames("route", tram).toString().contains("Bus"));
     74        assertTrue(getMatchingPresetNames("route", tram).contains("Railway Route"),
     75                "railway=tram should match 'Railway Route' for relation creation");
     76        assertTrue(getMatchingPresetNames("route", tram).contains("Public Transport Route (Rail)"),
     77                "railway=tram should match 'Public Transport Route (Rail)' for relation creation");
     78        assertFalse(getMatchingPresetNames("route", tram).toString().contains("Bus"),
     79                "railway=tram should not match 'Bus'");
    7980    }
    8081}
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReaderTest.java

    r16618 r17275  
    44import static org.CustomMatchers.hasSize;
    55import static org.hamcrest.MatcherAssert.assertThat;
    6 import static org.junit.Assert.assertEquals;
    7 import static org.junit.Assert.assertTrue;
    8 import static org.junit.Assert.fail;
     6import static org.junit.jupiter.api.Assertions.assertEquals;
     7import static org.junit.jupiter.api.Assertions.assertTrue;
     8import static org.junit.jupiter.api.Assertions.fail;
    99
    1010import java.io.IOException;
     
    1414
    1515import org.junit.Assert;
    16 import org.junit.Rule;
    17 import org.junit.Test;
     16import org.junit.jupiter.api.Test;
     17import org.junit.jupiter.api.extension.RegisterExtension;
    1818import org.openstreetmap.josm.TestUtils;
    1919import org.openstreetmap.josm.gui.tagging.presets.items.Check;
     
    2727 * Unit tests of {@link TaggingPresetReader} class.
    2828 */
    29 public class TaggingPresetReaderTest {
     29class TaggingPresetReaderTest {
    3030
    3131    /**
    3232     * Setup rule
    3333     */
    34     @Rule
     34    @RegisterExtension
    3535    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    3636    public JOSMTestRules test = new JOSMTestRules();
     
    4242     */
    4343    @Test
    44     public void testTicket8954() throws SAXException, IOException {
     44    void testTicket8954() throws SAXException, IOException {
    4545        String presetfile = TestUtils.getRegressionDataFile(8954, "preset.xml");
    4646        final Collection<TaggingPreset> presets = TaggingPresetReader.readAll(presetfile, false);
     
    5858     */
    5959    @Test
    60     public void testNestedChunks() throws SAXException, IOException {
     60    void testNestedChunks() throws SAXException, IOException {
    6161        final Collection<TaggingPreset> presets = TaggingPresetReader.readAll(TestUtils.getTestDataRoot() + "preset_chunk.xml", true);
    6262        assertThat(presets, hasSize(1));
     
    7070     * Test external entity resolving.
    7171     * See #19286
     72     * @throws IOException in case of I/O error
    7273     */
    7374    @Test
    74     public void testExternalEntityResolving() throws IOException {
     75    void testExternalEntityResolving() throws IOException {
    7576        try {
    7677            TaggingPresetReader.readAll(TestUtils.getTestDataRoot() + "preset_external_entity.xml", true);
     
    8990     */
    9091    @Test
    91     public void testReadDefaulPresets() throws SAXException, IOException {
     92    void testReadDefaulPresets() throws SAXException, IOException {
    9293        String presetfile = "resource://data/defaultpresets.xml";
    9394        final Collection<TaggingPreset> presets = TaggingPresetReader.readAll(presetfile, true);
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSelectorTest.java

    r13836 r17275  
    22package org.openstreetmap.josm.gui.tagging.presets;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertTrue;
    66
    7 import org.junit.Rule;
    8 import org.junit.Test;
     7import org.junit.jupiter.api.extension.RegisterExtension;
     8import org.junit.jupiter.api.Test;
    99import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetSelector.PresetClassification;
    1010import org.openstreetmap.josm.testutils.JOSMTestRules;
     
    1515 * Unit tests of {@link TaggingPresetSelector} class.
    1616 */
    17 public class TaggingPresetSelectorTest {
     17class TaggingPresetSelectorTest {
    1818
    1919    /**
    2020     * Setup rule
    2121     */
    22     @Rule
     22    @RegisterExtension
    2323    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    2424    public JOSMTestRules test = new JOSMTestRules();
     
    2828     */
    2929    @Test
    30     public void testIsMatching() {
     30    void testIsMatching() {
    3131        TaggingPreset preset = new TaggingPreset();
    3232        preset.name = "estação de bombeiros"; // fire_station in brazilian portuguese
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetsTest.java

    r16768 r17275  
    88import java.util.concurrent.TimeoutException;
    99
    10 import org.junit.Rule;
    11 import org.junit.Test;
     10import org.junit.jupiter.api.Test;
     11import org.junit.jupiter.api.extension.RegisterExtension;
    1212import org.openstreetmap.josm.testutils.JOSMTestRules;
    1313import org.openstreetmap.josm.tools.Logging;
     
    2424     * Setup rule
    2525     */
    26     @Rule
     26    @RegisterExtension
    2727    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    2828    public JOSMTestRules test = new JOSMTestRules();
     
    3333     */
    3434    @Test
    35     public void testUtilityClass() throws ReflectiveOperationException {
     35    void testUtilityClass() throws ReflectiveOperationException {
    3636        UtilityClassTestUtil.assertUtilityClassWellDefined(TaggingPresets.class);
    3737    }
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/CheckGroupTest.java

    r16042 r17275  
    22package org.openstreetmap.josm.gui.tagging.presets.items;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertFalse;
    6 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertFalse;
     6import static org.junit.jupiter.api.Assertions.assertTrue;
    77
    88import java.util.Collections;
     
    1010import javax.swing.JPanel;
    1111
    12 import org.junit.BeforeClass;
    13 import org.junit.Test;
     12import org.junit.jupiter.api.BeforeAll;
     13import org.junit.jupiter.api.Test;
    1414import org.openstreetmap.josm.JOSMFixture;
    1515import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    1818 * Unit tests of {@link CheckGroup} class.
    1919 */
    20 public class CheckGroupTest {
     20class CheckGroupTest {
    2121
    2222    /**
    2323     * Setup test.
    2424     */
    25     @BeforeClass
     25    @BeforeAll
    2626    public static void setUp() {
    2727        JOSMFixture.createUnitTestFixture().init();
     
    3232     */
    3333    @Test
    34     public void testAddToPanel() {
     34    void testAddToPanel() {
    3535        CheckGroup cg = new CheckGroup();
    3636        JPanel p = new JPanel();
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/CheckTest.java

    r16282 r17275  
    22package org.openstreetmap.josm.gui.tagging.presets.items;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertTrue;
    66
    77import java.util.Collections;
     
    99import javax.swing.JPanel;
    1010
    11 import org.junit.Rule;
    12 import org.junit.Test;
     11import org.junit.jupiter.api.extension.RegisterExtension;
     12import org.junit.jupiter.api.Test;
    1313import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1414import org.openstreetmap.josm.testutils.JOSMTestRules;
     
    1919 * Unit tests of {@link Check} class.
    2020 */
    21 public class CheckTest {
     21class CheckTest {
    2222
    2323    /**
    2424     * Setup test.
    2525     */
    26     @Rule
     26    @RegisterExtension
    2727    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    2828    public JOSMTestRules test = new JOSMTestRules().main();
     
    3232     */
    3333    @Test
    34     public void testAddToPanel() {
     34    void testAddToPanel() {
    3535        JPanel p = new JPanel();
    3636        assertEquals(0, p.getComponentCount());
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/ComboTest.java

    r16693 r17275  
    22package org.openstreetmap.josm.gui.tagging.presets.items;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertTrue;
    66
    77import java.awt.Color;
     
    1111import javax.swing.JPanel;
    1212
    13 import org.junit.Rule;
    14 import org.junit.Test;
     13import org.junit.jupiter.api.extension.RegisterExtension;
     14import org.junit.jupiter.api.Test;
    1515import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1616import org.openstreetmap.josm.data.osm.OsmUtils;
     
    2222 * Unit tests of {@link Combo} class.
    2323 */
    24 public class ComboTest {
     24class ComboTest {
    2525
    2626    /**
    2727     * Setup test.
    2828     */
    29     @Rule
     29    @RegisterExtension
    3030    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    3131    public JOSMTestRules test = new JOSMTestRules().main().i18n("de");
     
    3535     */
    3636    @Test
    37     public void testAddToPanel() {
     37    void testAddToPanel() {
    3838        JPanel p = new JPanel();
    3939        assertEquals(0, p.getComponentCount());
     
    4646     */
    4747    @Test
    48     public void testUseLastAsDefault() {
     48    void testUseLastAsDefault() {
    4949        Combo combo = new Combo();
    5050        combo.key = "addr:country";
     
    8383
    8484    @Test
    85     public void testColor() {
     85    void testColor() {
    8686        Combo combo = new Combo();
    8787        combo.key = "colour";
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/ItemSeparatorTest.java

    r9996 r17275  
    22package org.openstreetmap.josm.gui.tagging.presets.items;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertFalse;
    6 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertFalse;
     6import static org.junit.jupiter.api.Assertions.assertTrue;
    77
    88import java.util.Collections;
     
    1010import javax.swing.JPanel;
    1111
    12 import org.junit.BeforeClass;
    13 import org.junit.Test;
     12import org.junit.jupiter.api.BeforeAll;
     13import org.junit.jupiter.api.Test;
    1414import org.openstreetmap.josm.JOSMFixture;
    1515import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    1818 * Unit tests of {@link ItemSeparator} class.
    1919 */
    20 public class ItemSeparatorTest {
     20class ItemSeparatorTest {
    2121
    2222    /**
    2323     * Setup test.
    2424     */
    25     @BeforeClass
     25    @BeforeAll
    2626    public static void setUp() {
    2727        JOSMFixture.createUnitTestFixture().init();
     
    3232     */
    3333    @Test
    34     public void testAddToPanel() {
     34    void testAddToPanel() {
    3535        JPanel p = new JPanel();
    3636        assertEquals(0, p.getComponentCount());
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/KeyTest.java

    r9996 r17275  
    22package org.openstreetmap.josm.gui.tagging.presets.items;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertFalse;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertFalse;
    66
    77import java.util.Collections;
     
    99import javax.swing.JPanel;
    1010
    11 import org.junit.BeforeClass;
    12 import org.junit.Test;
     11import org.junit.jupiter.api.BeforeAll;
     12import org.junit.jupiter.api.Test;
    1313import org.openstreetmap.josm.JOSMFixture;
    1414import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    1717 * Unit tests of {@link Key} class.
    1818 */
    19 public class KeyTest {
     19class KeyTest {
    2020
    2121    /**
    2222     * Setup test.
    2323     */
    24     @BeforeClass
     24    @BeforeAll
    2525    public static void setUp() {
    2626        JOSMFixture.createUnitTestFixture().init();
     
    3131     */
    3232    @Test
    33     public void testAddToPanel() {
     33    void testAddToPanel() {
    3434        JPanel p = new JPanel();
    3535        assertEquals(0, p.getComponentCount());
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/LabelTest.java

    r9996 r17275  
    22package org.openstreetmap.josm.gui.tagging.presets.items;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertTrue;
    66
    77import java.util.Collections;
     
    99import javax.swing.JPanel;
    1010
    11 import org.junit.BeforeClass;
    12 import org.junit.Test;
     11import org.junit.jupiter.api.BeforeAll;
     12import org.junit.jupiter.api.Test;
    1313import org.openstreetmap.josm.JOSMFixture;
    1414import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    1717 * Unit tests of {@link Label} class.
    1818 */
    19 public class LabelTest {
     19class LabelTest {
    2020
    2121    /**
    2222     * Setup test.
    2323     */
    24     @BeforeClass
     24    @BeforeAll
    2525    public static void setUp() {
    2626        JOSMFixture.createUnitTestFixture().init();
     
    3131     */
    3232    @Test
    33     public void testAddToPanel() {
     33    void testAddToPanel() {
    3434        JPanel p = new JPanel();
    3535        assertEquals(0, p.getComponentCount());
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/LinkTest.java

    r14119 r17275  
    22package org.openstreetmap.josm.gui.tagging.presets.items;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertFalse;
    6 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertFalse;
     6import static org.junit.jupiter.api.Assertions.assertTrue;
    77
    88import java.util.Collections;
     
    1010import javax.swing.JPanel;
    1111
    12 import org.junit.BeforeClass;
    13 import org.junit.Test;
     12import org.junit.jupiter.api.BeforeAll;
     13import org.junit.jupiter.api.Test;
    1414import org.openstreetmap.josm.JOSMFixture;
    1515import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    1919 * Unit tests of {@link Link} class.
    2020 */
    21 public class LinkTest {
     21class LinkTest {
    2222
    2323    /**
    2424     * Setup test.
    2525     */
    26     @BeforeClass
     26    @BeforeAll
    2727    public static void setUp() {
    2828        JOSMFixture.createUnitTestFixture().init();
     
    3333     */
    3434    @Test
    35     public void testAddToPanel() {
     35    void testAddToPanel() {
    3636        Link l = new Link();
    3737        JPanel p = new JPanel();
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/MultiSelectTest.java

    r9996 r17275  
    22package org.openstreetmap.josm.gui.tagging.presets.items;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertTrue;
    66
    77import java.util.Collections;
     
    99import javax.swing.JPanel;
    1010
    11 import org.junit.BeforeClass;
    12 import org.junit.Test;
     11import org.junit.jupiter.api.BeforeAll;
     12import org.junit.jupiter.api.Test;
    1313import org.openstreetmap.josm.JOSMFixture;
    1414import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    1717 * Unit tests of {@link MultiSelect} class.
    1818 */
    19 public class MultiSelectTest {
     19class MultiSelectTest {
    2020
    2121    /**
    2222     * Setup test.
    2323     */
    24     @BeforeClass
     24    @BeforeAll
    2525    public static void setUp() {
    2626        JOSMFixture.createUnitTestFixture().init();
     
    3131     */
    3232    @Test
    33     public void testAddToPanel() {
     33    void testAddToPanel() {
    3434        JPanel p = new JPanel();
    3535        assertEquals(0, p.getComponentCount());
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/OptionalTest.java

    r9996 r17275  
    22package org.openstreetmap.josm.gui.tagging.presets.items;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertFalse;
    6 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertFalse;
     6import static org.junit.jupiter.api.Assertions.assertTrue;
    77
    88import java.util.Collections;
     
    1010import javax.swing.JPanel;
    1111
    12 import org.junit.BeforeClass;
    13 import org.junit.Test;
     12import org.junit.jupiter.api.BeforeAll;
     13import org.junit.jupiter.api.Test;
    1414import org.openstreetmap.josm.JOSMFixture;
    1515import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    1818 * Unit tests of {@link Optional} class.
    1919 */
    20 public class OptionalTest {
     20class OptionalTest {
    2121
    2222    /**
    2323     * Setup test.
    2424     */
    25     @BeforeClass
     25    @BeforeAll
    2626    public static void setUp() {
    2727        JOSMFixture.createUnitTestFixture().init();
     
    3232     */
    3333    @Test
    34     public void testAddToPanel() {
     34    void testAddToPanel() {
    3535        JPanel p = new JPanel();
    3636        assertEquals(0, p.getComponentCount());
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/PresetLinkTest.java

    r12568 r17275  
    22package org.openstreetmap.josm.gui.tagging.presets.items;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertFalse;
    6 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertFalse;
     6import static org.junit.jupiter.api.Assertions.assertTrue;
    77
    88import java.util.Collections;
     
    1010import javax.swing.JPanel;
    1111
    12 import org.junit.Rule;
    13 import org.junit.Test;
     12import org.junit.jupiter.api.extension.RegisterExtension;
     13import org.junit.jupiter.api.Test;
    1414import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1515import org.openstreetmap.josm.testutils.JOSMTestRules;
     
    2020 * Unit tests of {@link PresetLink} class.
    2121 */
    22 public class PresetLinkTest {
     22class PresetLinkTest {
    2323
    2424    /**
    2525     * Setup test.
    2626     */
    27     @Rule
     27    @RegisterExtension
    2828    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    2929    public JOSMTestRules rule = new JOSMTestRules().presets();
     
    3333     */
    3434    @Test
    35     public void testAddToPanel() {
     35    void testAddToPanel() {
    3636        PresetLink l = new PresetLink();
    3737        l.preset_name = "River";
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/PresetListEntryTest.java

    r16690 r17275  
    22package org.openstreetmap.josm.gui.tagging.presets.items;
    33
    4 import static org.junit.Assert.assertEquals;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
    55
    6 import org.junit.BeforeClass;
    7 import org.junit.Test;
     6import org.junit.jupiter.api.BeforeAll;
     7import org.junit.jupiter.api.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    99
     
    1111 * Unit tests of {@link PresetListEntry} class.
    1212 */
    13 public class PresetListEntryTest {
     13class PresetListEntryTest {
    1414
    1515    /**
    1616     * Setup test.
    1717     */
    18     @BeforeClass
     18    @BeforeAll
    1919    public static void setUp() {
    2020        JOSMFixture.createUnitTestFixture().init();
     
    2525     */
    2626    @Test
    27     public void testTicket12416() {
     27    void testTicket12416() {
    2828        assertEquals("&nbsp;", new PresetListEntry("").getListDisplay());
    2929    }
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/RolesTest.java

    r9996 r17275  
    22package org.openstreetmap.josm.gui.tagging.presets.items;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertFalse;
    6 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertFalse;
     6import static org.junit.jupiter.api.Assertions.assertTrue;
    77
    88import java.util.Collections;
     
    1010import javax.swing.JPanel;
    1111
    12 import org.junit.BeforeClass;
    13 import org.junit.Test;
     12import org.junit.jupiter.api.BeforeAll;
     13import org.junit.jupiter.api.Test;
    1414import org.openstreetmap.josm.JOSMFixture;
    1515import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    1818 * Unit tests of {@link Roles} class.
    1919 */
    20 public class RolesTest {
     20class RolesTest {
    2121
    2222    /**
    2323     * Setup test.
    2424     */
    25     @BeforeClass
     25    @BeforeAll
    2626    public static void setUp() {
    2727        JOSMFixture.createUnitTestFixture().init();
     
    3232     */
    3333    @Test
    34     public void testAddToPanel() {
     34    void testAddToPanel() {
    3535        JPanel p = new JPanel();
    3636        assertEquals(0, p.getComponentCount());
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/SpaceTest.java

    r9996 r17275  
    22package org.openstreetmap.josm.gui.tagging.presets.items;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertFalse;
    6 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertFalse;
     6import static org.junit.jupiter.api.Assertions.assertTrue;
    77
    88import java.util.Collections;
     
    1010import javax.swing.JPanel;
    1111
    12 import org.junit.BeforeClass;
    13 import org.junit.Test;
     12import org.junit.jupiter.api.BeforeAll;
     13import org.junit.jupiter.api.Test;
    1414import org.openstreetmap.josm.JOSMFixture;
    1515import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    1818 * Unit tests of {@link Space} class.
    1919 */
    20 public class SpaceTest {
     20class SpaceTest {
    2121
    2222    /**
    2323     * Setup test.
    2424     */
    25     @BeforeClass
     25    @BeforeAll
    2626    public static void setUp() {
    2727        JOSMFixture.createUnitTestFixture().init();
     
    3232     */
    3333    @Test
    34     public void testAddToPanel() {
     34    void testAddToPanel() {
    3535        JPanel p = new JPanel();
    3636        assertEquals(0, p.getComponentCount());
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/TextTest.java

    r16282 r17275  
    22package org.openstreetmap.josm.gui.tagging.presets.items;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertTrue;
    66
    77import java.util.Collections;
     
    99import javax.swing.JPanel;
    1010
    11 import org.junit.Rule;
    12 import org.junit.Test;
     11import org.junit.jupiter.api.extension.RegisterExtension;
     12import org.junit.jupiter.api.Test;
    1313import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1414import org.openstreetmap.josm.testutils.JOSMTestRules;
     
    1919 * Unit tests of {@link Text} class.
    2020 */
    21 public class TextTest {
     21class TextTest {
    2222
    2323    /**
    2424     * Setup test.
    2525     */
    26     @Rule
     26    @RegisterExtension
    2727    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    2828    public JOSMTestRules test = new JOSMTestRules().main();
     
    3232     */
    3333    @Test
    34     public void testAddToPanel() {
     34    void testAddToPanel() {
    3535        JPanel p = new JPanel();
    3636        assertEquals(0, p.getComponentCount());
Note: See TracChangeset for help on using the changeset viewer.