Ignore:
Timestamp:
2020-10-28T20:41:00+01:00 (11 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/io/session
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java

    r15070 r17275  
    22package org.openstreetmap.josm.io.session;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertNotNull;
    6 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertNotNull;
     6import static org.junit.jupiter.api.Assertions.assertTrue;
    77
    88import java.io.ByteArrayInputStream;
     
    1313import java.util.List;
    1414
    15 import org.junit.Rule;
    16 import org.junit.Test;
     15import org.junit.jupiter.api.extension.RegisterExtension;
     16import org.junit.jupiter.api.Test;
    1717import org.openstreetmap.josm.TestUtils;
    1818import org.openstreetmap.josm.data.coor.EastNorth;
     
    3333 * Unit tests for Session reading.
    3434 */
    35 public class SessionReaderTest {
     35class SessionReaderTest {
    3636
    3737    /**
    3838     * Setup tests.
    3939     */
    40     @Rule
     40    @RegisterExtension
    4141    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    4242    public JOSMTestRules test = new JOSMTestRules().projection();
     
    6060     */
    6161    @Test
    62     public void testReadEmpty() throws IOException, IllegalDataException {
     62    void testReadEmpty() throws IOException, IllegalDataException {
    6363        assertTrue(testRead("empty.jos").isEmpty());
    6464        assertTrue(testRead("empty.joz").isEmpty());
     
    7171     */
    7272    @Test
    73     public void testReadOsm() throws IOException, IllegalDataException {
     73    void testReadOsm() throws IOException, IllegalDataException {
    7474        for (String file : new String[]{"osm.jos", "osm.joz"}) {
    7575            List<Layer> layers = testRead(file);
     
    8787     */
    8888    @Test
    89     public void testReadGpx() throws IOException, IllegalDataException {
     89    void testReadGpx() throws IOException, IllegalDataException {
    9090        for (String file : new String[]{"gpx.jos", "gpx.joz", "nmea.jos"}) {
    9191            List<Layer> layers = testRead(file);
     
    103103     */
    104104    @Test
    105     public void testReadGpxAndMarker() throws IOException, IllegalDataException {
     105    void testReadGpxAndMarker() throws IOException, IllegalDataException {
    106106        List<Layer> layers = testRead("gpx_markers.joz");
    107107        assertEquals(layers.size(), 2);
     
    127127     */
    128128    @Test
    129     public void testReadImage() throws IOException, IllegalDataException {
     129    void testReadImage() throws IOException, IllegalDataException {
    130130        final List<Layer> layers = testRead("bing.jos");
    131131        assertEquals(layers.size(), 1);
     
    144144     */
    145145    @Test
    146     public void testReadNotes() throws IOException, IllegalDataException {
     146    void testReadNotes() throws IOException, IllegalDataException {
    147147        if (MainApplication.isDisplayingMapView()) {
    148148            for (NoteLayer nl : MainApplication.getLayerManager().getLayersOfType(NoteLayer.class)) {
     
    163163     */
    164164    @Test
    165     public void testTicket17701() throws Exception {
     165    void testTicket17701() throws Exception {
    166166        try (InputStream in = new ByteArrayInputStream(("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
    167167                "<josm-session version=\"0.1\">\n" +
  • trunk/test/unit/org/openstreetmap/josm/io/session/SessionWriterTest.java

    r14138 r17275  
    1010import java.util.Map;
    1111
    12 import org.junit.Before;
    13 import org.junit.Rule;
    14 import org.junit.Test;
     12import org.junit.jupiter.api.BeforeEach;
     13import org.junit.jupiter.api.Test;
     14import org.junit.jupiter.api.extension.RegisterExtension;
    1515import org.openstreetmap.josm.data.coor.LatLon;
    1616import org.openstreetmap.josm.data.gpx.GpxData;
     
    3838 * Unit tests for Session writing.
    3939 */
    40 public class SessionWriterTest {
     40class SessionWriterTest {
    4141
    4242    protected static final class OsmHeadlessJosExporter extends OsmDataSessionExporter {
     
    8787     * Setup tests.
    8888     */
    89     @Rule
     89    @RegisterExtension
    9090    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    9191    public JOSMTestRules test = new JOSMTestRules().projection().main();
     
    9494     * Setup tests.
    9595     */
    96     @Before
     96    @BeforeEach
    9797    public void setUp() {
    9898        MainApplication.getLayerManager().addLayer(createOsmLayer());
     
    157157     */
    158158    @Test
    159     public void testWriteEmptyJos() throws IOException {
     159    void testWriteEmptyJos() throws IOException {
    160160        testWrite(Collections.<Layer>emptyList(), false);
    161161    }
     
    166166     */
    167167    @Test
    168     public void testWriteEmptyJoz() throws IOException {
     168    void testWriteEmptyJoz() throws IOException {
    169169        testWrite(Collections.<Layer>emptyList(), true);
    170170    }
     
    175175     */
    176176    @Test
    177     public void testWriteOsmJos() throws IOException {
     177    void testWriteOsmJos() throws IOException {
    178178        testWrite(Collections.<Layer>singletonList(createOsmLayer()), false);
    179179    }
     
    184184     */
    185185    @Test
    186     public void testWriteOsmJoz() throws IOException {
     186    void testWriteOsmJoz() throws IOException {
    187187        testWrite(Collections.<Layer>singletonList(createOsmLayer()), true);
    188188    }
     
    193193     */
    194194    @Test
    195     public void testWriteGpxJos() throws IOException {
     195    void testWriteGpxJos() throws IOException {
    196196        testWrite(Collections.<Layer>singletonList(createGpxLayer()), false);
    197197    }
     
    202202     */
    203203    @Test
    204     public void testWriteGpxJoz() throws IOException {
     204    void testWriteGpxJoz() throws IOException {
    205205        testWrite(Collections.<Layer>singletonList(createGpxLayer()), true);
    206206    }
     
    211211     */
    212212    @Test
    213     public void testWriteGpxAndMarkerJoz() throws IOException {
     213    void testWriteGpxAndMarkerJoz() throws IOException {
    214214        GpxLayer gpx = createGpxLayer();
    215215        testWrite(Arrays.asList(gpx, createMarkerLayer(gpx)), true);
     
    221221     */
    222222    @Test
    223     public void testWriteImageryLayer() throws IOException {
     223    void testWriteImageryLayer() throws IOException {
    224224        final Layer layer = createImageryLayer();
    225225        testWrite(Collections.singletonList(layer), true);
     
    231231     */
    232232    @Test
    233     public void testWriteNoteLayer() throws IOException {
     233    void testWriteNoteLayer() throws IOException {
    234234        final Layer layer = createNoteLayer();
    235235        testWrite(Collections.singletonList(layer), true);
Note: See TracChangeset for help on using the changeset viewer.