Ignore:
Timestamp:
2020-10-28T20:41:00+01:00 (3 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

File:
1 edited

Legend:

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

    r15924 r17275  
    22package org.openstreetmap.josm.gui.layer;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertFalse;
    6 import static org.junit.Assert.assertNull;
    7 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.assertNull;
     7import static org.junit.jupiter.api.Assertions.assertTrue;
     8import static org.junit.jupiter.api.Assertions.assertThrows;
    89
    910import java.awt.Color;
     
    1617import javax.swing.JScrollPane;
    1718
    18 import org.junit.Rule;
    19 import org.junit.Test;
     19import org.junit.jupiter.api.Test;
     20import org.junit.jupiter.api.extension.RegisterExtension;
    2021import org.openstreetmap.josm.TestUtils;
    2122import org.openstreetmap.josm.data.gpx.GpxData;
     
    4142     * Setup tests
    4243     */
    43     @Rule
     44    @RegisterExtension
    4445    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    4546    public JOSMTestRules test = new JOSMTestRules().main().projection().i18n().metricSystem();
     
    7475     */
    7576    @Test
    76     public void testGpxLayer() throws Exception {
     77    void testGpxLayer() throws Exception {
    7778        GpxLayer layer = new GpxLayer(new GpxData(), "foo", false);
    7879        GpxTrack trk = new GpxTrack(new ArrayList<IGpxTrackSegment>(), new HashMap<>());
     
    105106     */
    106107    @Test
    107     public void testGetInfoComponent() throws Exception {
     108    void testGetInfoComponent() throws Exception {
    108109        assertEquals("<html>\n"+
    109110                     "  <head>\n" +
     
    192193     */
    193194    @Test
    194     public void testGetTimespanForTrack() throws Exception {
     195    void testGetTimespanForTrack() throws Exception {
    195196        assertEquals("", GpxLayer.getTimespanForTrack(
    196197                new GpxTrack(new ArrayList<Collection<WayPoint>>(), new HashMap<String, Object>())));
     
    207208     */
    208209    @Test
    209     public void testMergeFrom() throws Exception {
     210    void testMergeFrom() throws Exception {
    210211        GpxLayer layer = new GpxLayer(new GpxData());
    211212        assertTrue(layer.data.isEmpty());
     
    219220     * Test that {@link GpxLayer#mergeFrom} throws IAE for invalid arguments
    220221     */
    221     @Test(expected = IllegalArgumentException.class)
    222     public void testMergeFromIAE() {
    223         new GpxLayer(new GpxData()).mergeFrom(new OsmDataLayer(new DataSet(), "", null));
     222    @Test
     223    void testMergeFromIAE() {
     224        assertThrows(IllegalArgumentException.class, () -> new GpxLayer(new GpxData()).mergeFrom(new OsmDataLayer(new DataSet(), "", null)));
    224225    }
    225226
     
    229230     */
    230231    @Test
    231     public void testPaint() throws Exception {
     232    void testPaint() throws Exception {
    232233        GpxLayer layer = getMinimalGpxLayer();
    233234        try {
     
    244245     */
    245246    @Test
    246     public void testGetChangesetSourceTag() {
     247    void testGetChangesetSourceTag() {
    247248        assertEquals("survey", new GpxLayer(new GpxData(), "", true).getChangesetSourceTag());
    248249        assertNull(new GpxLayer(new GpxData(), "", false).getChangesetSourceTag());
Note: See TracChangeset for help on using the changeset viewer.