Ignore:
Timestamp:
2020-10-28T20:41:00+01:00 (15 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/layer/gpx
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityActionTest.java

    r15516 r17275  
    22package org.openstreetmap.josm.gui.layer.gpx;
    33
    4 import static org.junit.Assert.assertEquals;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
    55
    66import javax.swing.JLabel;
    77import javax.swing.JPanel;
    88
    9 import org.junit.Ignore;
    10 import org.junit.Rule;
    11 import org.junit.Test;
     9import org.junit.jupiter.api.Disabled;
     10import org.junit.jupiter.api.Test;
     11import org.junit.jupiter.api.extension.RegisterExtension;
    1212import org.openstreetmap.josm.TestUtils;
    1313import org.openstreetmap.josm.gui.ExtendedDialog;
     
    2121 * Unit tests of {@link ChooseTrackVisibilityAction} class.
    2222 */
    23 public class ChooseTrackVisibilityActionTest {
     23class ChooseTrackVisibilityActionTest {
    2424
    2525    /**
    2626     * Setup test.
    2727     */
    28     @Rule
     28    @RegisterExtension
    2929    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    3030    public JOSMTestRules test = new JOSMTestRules();
     
    3535     */
    3636    @Test
    37     @Ignore("broken, see #16796")
    38     public void testAction() throws Exception {
     37    @Disabled("broken, see #16796")
     38    void testAction() throws Exception {
    3939        TestUtils.assumeWorkingJMockit();
    4040        final ExtendedDialogMocker edMocker = new ExtendedDialogMocker() {
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ConvertToDataLayerActionTest.java

    r16953 r17275  
    22package org.openstreetmap.josm.gui.layer.gpx;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertNotNull;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertNotNull;
    66
    77import java.io.IOException;
     
    1515import java.util.stream.Collectors;
    1616
    17 import org.junit.Rule;
    18 import org.junit.Test;
     17import org.junit.jupiter.api.Test;
     18import org.junit.jupiter.api.extension.RegisterExtension;
    1919import org.openstreetmap.josm.TestUtils;
    2020import org.openstreetmap.josm.data.coor.LatLon;
     
    4242     * Setup test.
    4343     */
    44     @Rule
     44    @RegisterExtension
    4545    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    4646    public JOSMTestRules test = new JOSMTestRules();
     
    5151     */
    5252    @Test
    53     public void testFromMarkerLayer() throws Exception {
     53    void testFromMarkerLayer() throws Exception {
    5454        final GpxData data = GpxReaderTest.parseGpxData(TestUtils.getTestDataRoot() + "minimal.gpx");
    5555        final MarkerLayer markers = new MarkerLayer(data, "Markers", data.storageFile, null);
     
    6565     */
    6666    @Test
    67     public void testFromTrack() throws Exception {
     67    void testFromTrack() throws Exception {
    6868        Config.getPref().put("gpx.convert-tags", "no");
    6969        testFromTrack("tracks.gpx", "tracks.osm");
     
    138138                .collect(Collectors.toList());
    139139
    140         assertEquals("Conversion " + originalGpx + " -> " + expectedOsm + " didn't match!", nodesExpected, nodes);
     140        assertEquals(nodesExpected, nodes, "Conversion " + originalGpx + " -> " + expectedOsm + " didn't match!");
    141141
    142142        List<String> ways = osm.getWays().stream()
     
    152152                .collect(Collectors.toList());
    153153
    154         assertEquals("Conversion " + originalGpx + " -> " + expectedOsm + " didn't match!", waysExpected, ways);
     154        assertEquals(waysExpected, ways, "Conversion " + originalGpx + " -> " + expectedOsm + " didn't match!");
    155155
    156         assertEquals("Conversion " + originalGpx + " -> " + expectedOsm + " didn't match!", osmExpected.allPrimitives().size(),
    157                 osm.allPrimitives().size());
     156        assertEquals(osmExpected.allPrimitives().size(), osm.allPrimitives().size(),
     157                "Conversion " + originalGpx + " -> " + expectedOsm + " didn't match!");
    158158    }
    159159
     
    164164     */
    165165    @Test
    166     public void testTicket14275() throws IOException, SAXException {
     166    void testTicket14275() throws IOException, SAXException {
    167167        assertNotNull(GpxReaderTest.parseGpxData(TestUtils.getRegressionDataFile(14275, "1485101437.8189685.gpx")));
    168168    }
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackActionTest.java

    r16850 r17275  
    22package org.openstreetmap.josm.gui.layer.gpx;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertNotNull;
    6 import static org.junit.Assert.assertNull;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertNotNull;
     6import static org.junit.jupiter.api.Assertions.assertNull;
    77
    88import java.util.Collections;
    99
    10 import org.junit.Rule;
    11 import org.junit.Test;
     10import org.junit.jupiter.api.extension.RegisterExtension;
     11import org.junit.jupiter.api.Test;
    1212import org.openstreetmap.josm.TestUtils;
    1313import org.openstreetmap.josm.data.gpx.GpxData;
     
    2525 * Unit tests of {@link DownloadAlongTrackAction} class.
    2626 */
    27 public class DownloadAlongTrackActionTest {
     27class DownloadAlongTrackActionTest {
    2828
    2929    /**
    3030     * The test rules for this test
    3131     */
    32     @Rule
     32    @RegisterExtension
    3333    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    3434    public JOSMTestRules test = new JOSMTestRules().preferences();
     
    7272     */
    7373    @Test
    74     public void testDownload() throws Exception {
     74    void testDownload() throws Exception {
    7575        assertNotNull(createTask("minimal.gpx"));
    7676    }
     
    8181     */
    8282    @Test
    83     public void testDownloadEmpty() throws Exception {
     83    void testDownloadEmpty() throws Exception {
    8484        assertNull(createTask("empty.gpx"));
    8585    }
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelperTest.java

    r16160 r17275  
    22package org.openstreetmap.josm.gui.layer.gpx;
    33
    4 import static org.junit.Assert.assertEquals;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
    55
    66import java.io.FileNotFoundException;
     
    1212import java.util.stream.Collectors;
    1313
    14 import org.junit.Rule;
    15 import org.junit.Test;
     14import org.junit.jupiter.api.extension.RegisterExtension;
     15import org.junit.jupiter.api.Test;
    1616import org.openstreetmap.josm.TestUtils;
    1717import org.openstreetmap.josm.data.gpx.GpxData;
     
    2828 * Unit tests of {@link GpxDrawHelper} class.
    2929 */
    30 public class GpxDrawHelperTest {
     30class GpxDrawHelperTest {
    3131
    3232    /**
    3333     * Setup test.
    3434     */
    35     @Rule
     35    @RegisterExtension
    3636    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    3737    public JOSMTestRules test = new JOSMTestRules();
     
    4444     */
    4545    @Test
    46     public void testTicket12312() throws FileNotFoundException, IOException, SAXException {
     46    void testTicket12312() throws FileNotFoundException, IOException, SAXException {
    4747        final Map<String, String> prefs = new HashMap<String, String>() {{
    4848            put("colormode.dynamic-range", "true");
     
    6060     */
    6161    @Test
    62     public void testNone() throws IOException, SAXException {
     62    void testNone() throws IOException, SAXException {
    6363        final List<String> colors = calculateColors("nodist/data/2094047.gpx", Collections.emptyMap(), 10);
    6464        assertEquals("[#000000, #000000, #000000, #000000, #000000, #000000, #000000, #000000, #000000, #000000]", colors.toString());
     
    7272     */
    7373    @Test
    74     public void testVelocity() throws IOException, SAXException {
     74    void testVelocity() throws IOException, SAXException {
    7575        final Map<String, String> prefs = Collections.singletonMap("colormode", Integer.toString(ColorMode.VELOCITY.toIndex()));
    7676        final List<String> colors = calculateColors("nodist/data/2094047.gpx", prefs, 10);
     
    8585     */
    8686    @Test
    87     public void testVelocityDynamic() throws IOException, SAXException {
     87    void testVelocityDynamic() throws IOException, SAXException {
    8888        final Map<String, String> prefs = new HashMap<String, String>() {{
    8989            put("colormode.dynamic-range", "true");
     
    101101     */
    102102    @Test
    103     public void testDirection() throws IOException, SAXException {
     103    void testDirection() throws IOException, SAXException {
    104104        final Map<String, String> prefs = Collections.singletonMap("colormode", Integer.toString(ColorMode.DIRECTION.toIndex()));
    105105        final List<String> colors = calculateColors("nodist/data/2094047.gpx", prefs, 10);
     
    114114     */
    115115    @Test
    116     public void testTime() throws IOException, SAXException {
     116    void testTime() throws IOException, SAXException {
    117117        final Map<String, String> prefs = Collections.singletonMap("colormode", Integer.toString(ColorMode.TIME.toIndex()));
    118118        final List<String> colors = calculateColors("nodist/data/2094047.gpx", prefs, 10);
Note: See TracChangeset for help on using the changeset viewer.