Ignore:
Timestamp:
2020-10-28T20:41:00+01:00 (14 months 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/dialogs/properties
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/properties/PropertiesCellRendererTest.java

    r16319 r17275  
    22package org.openstreetmap.josm.gui.dialogs.properties;
    33
    4 import static org.junit.Assert.assertEquals;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
    55
    66import java.util.function.IntFunction;
     
    1010import javax.swing.table.DefaultTableModel;
    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.testutils.JOSMTestRules;
    1515
     
    1919 * Unit tests of {@link PropertiesCellRenderer} class.
    2020 */
    21 public class PropertiesCellRendererTest {
     21class PropertiesCellRendererTest {
    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().preferences();
     
    3232     */
    3333    @Test
    34     public void testColorRendering() {
     34    void testColorRendering() {
    3535        PropertiesCellRenderer renderer = new PropertiesCellRenderer();
    3636        DefaultTableModel tableModel = new DefaultTableModel(new Object[][]{
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialogTest.java

    r15822 r17275  
    22package org.openstreetmap.josm.gui.dialogs.properties;
    33
    4 import static org.junit.Assert.assertEquals;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
    55
    66import java.util.ArrayList;
    77import java.util.List;
    88
    9 import org.junit.Rule;
    10 import org.junit.Test;
     9import org.junit.jupiter.api.extension.RegisterExtension;
     10import org.junit.jupiter.api.Test;
    1111import org.openstreetmap.josm.data.coor.LatLon;
    1212import org.openstreetmap.josm.data.osm.Node;
     
    2020 * Unit tests of {@link PropertiesDialog} class.
    2121 */
    22 public class PropertiesDialogTest {
     22class PropertiesDialogTest {
    2323
    2424    /**
    2525     * Setup tests
    2626     */
    27     @Rule
     27    @RegisterExtension
    2828    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    2929    public JOSMTestRules test = new JOSMTestRules();
     
    3737     */
    3838    @Test
    39     public void testTicket12504() {
     39    void testTicket12504() {
    4040        List<OsmPrimitive> sel = new ArrayList<>();
    4141        // 160 objects with foo=bar, 400 objects without foo
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/properties/RecentTagCollectionTest.java

    r12842 r17275  
    22package org.openstreetmap.josm.gui.dialogs.properties;
    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.Arrays;
    99import java.util.Collections;
    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.Tag;
    1414import org.openstreetmap.josm.data.osm.search.SearchParseError;
     
    2222 * Unit tests of {@link RecentTagCollection} class.
    2323 */
    24 public class RecentTagCollectionTest {
     24class RecentTagCollectionTest {
    2525
    2626    /**
    2727     * Setup tests
    2828     */
    29     @Rule
     29    @RegisterExtension
    3030    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    3131    public JOSMTestRules test = new JOSMTestRules().preferences();
     
    3737     */
    3838    @Test
    39     public void testVarious() throws SearchParseError {
     39    void testVarious() throws SearchParseError {
    4040        final RecentTagCollection recentTags = new RecentTagCollection(2);
    4141        assertTrue(recentTags.isEmpty());
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelperTest.java

    r16321 r17275  
    22package org.openstreetmap.josm.gui.dialogs.properties;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertFalse;
    6 import static org.junit.Assert.assertNotNull;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertFalse;
     6import static org.junit.jupiter.api.Assertions.assertNotNull;
    77
    88import java.awt.GraphicsEnvironment;
     
    2121import javax.swing.table.DefaultTableModel;
    2222
    23 import org.junit.Rule;
    24 import org.junit.Test;
     23import org.junit.jupiter.api.extension.RegisterExtension;
     24import org.junit.jupiter.api.Test;
    2525import org.openstreetmap.josm.TestUtils;
    2626import org.openstreetmap.josm.data.coor.LatLon;
     
    4444 * Unit tests of {@link TagEditHelper} class.
    4545 */
    46 public class TagEditHelperTest {
     46class TagEditHelperTest {
    4747
    4848    /**
    4949     * Setup tests
    5050     */
    51     @Rule
     51    @RegisterExtension
    5252    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    5353    public JOSMTestRules test = new JOSMTestRules().territories().projection();
     
    6464     */
    6565    @Test
    66     public void testAcItemComparator() {
     66    void testAcItemComparator() {
    6767        List<AutoCompletionItem> list = new ArrayList<>();
    6868        list.add(new AutoCompletionItem("Bing Sat"));
     
    8181     */
    8282    @Test
    83     public void testContainsDataKey() {
     83    void testContainsDataKey() {
    8484        assertFalse(newTagEditHelper().containsDataKey("foo"));
    8585        // TODO: complete test
     
    9292     */
    9393    @Test
    94     public void testTicket18764() throws Exception {
     94    void testTicket18764() throws Exception {
    9595        testIcon("*[building] ⧉ *[highway] { text: tr(\"Building crossing highway\"); }", ds -> {
    9696            Way way = TestUtils.newWay("", new Node(LatLon.NORTH_POLE), new Node(LatLon.SOUTH_POLE));
     
    106106     */
    107107    @Test
    108     public void testTicket18798() throws Exception {
     108    void testTicket18798() throws Exception {
    109109        testIcon("node:righthandtraffic[junction=roundabout] { text: tr(\"Roundabout node\"); }", ds -> {
    110110            Node node = new Node(LatLon.NORTH_POLE);
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/properties/TaginfoActionTest.java

    r16606 r17275  
    22package org.openstreetmap.josm.gui.dialogs.properties;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertNull;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertNull;
    66
    77import javax.swing.Action;
    88
    9 import org.junit.Rule;
    10 import org.junit.Test;
     9import org.junit.jupiter.api.Test;
     10import org.junit.jupiter.api.extension.RegisterExtension;
    1111import org.openstreetmap.josm.data.osm.Tag;
    1212import org.openstreetmap.josm.testutils.JOSMTestRules;
     
    1414import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1515
    16 public class TaginfoActionTest {
     16class TaginfoActionTest {
    1717
    1818    /**
    1919     * Setup test.
    2020     */
    21     @Rule
     21    @RegisterExtension
    2222    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    2323    public JOSMTestRules test = new JOSMTestRules();
     
    2727     */
    2828    @Test
    29     public void testTaginfoUrls() {
     29    void testTaginfoUrls() {
    3030        TaginfoAction action = new TaginfoAction(() -> null, () -> null);
    3131        assertEquals("https://taginfo.openstreetmap.org/keys/railway", action.getTaginfoUrlForTag(new Tag("railway")));
     
    4040     */
    4141    @Test
    42     public void testCustomInstance() {
     42    void testCustomInstance() {
    4343        TaginfoAction action = new TaginfoAction(() -> null, () -> null).withTaginfoUrl("example.com", "https://taginfo.example.com////");
    4444        assertEquals("example.com", action.getValue(Action.NAME));
     
    5050     */
    5151    @Test
    52     public void testTagHistoryUrls() throws Exception {
     52    void testTagHistoryUrls() {
    5353        TaginfoAction action = new TaginfoAction(() -> null, () -> null).toTagHistoryAction();
    5454        assertEquals("https://taghistory.raifer.tech/#***/railway/", action.getTaginfoUrlForTag(new Tag("railway")));
Note: See TracChangeset for help on using the changeset viewer.