Ignore:
Timestamp:
2023-10-16T15:19:07+02:00 (21 months ago)
Author:
taylor.smock
Message:

See #16567: Update to JUnit 5

This converts most tests to use @Annotations. There are also some performance
improvements as it relates to tests.

Location:
trunk/test/unit/org/openstreetmap/josm/data/coor
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java

    r18494 r18870  
    1111
    1212import org.junit.jupiter.api.Test;
    13 import org.junit.jupiter.api.extension.RegisterExtension;
    1413import org.openstreetmap.josm.TestUtils;
    1514import org.openstreetmap.josm.data.Bounds;
    16 import org.openstreetmap.josm.testutils.JOSMTestRules;
     15import org.openstreetmap.josm.testutils.annotations.Projection;
    1716
    1817import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     
    2221 * Unit tests for class {@link LatLon}.
    2322 */
     23@Projection
    2424public class LatLonTest {
    25 
    26     /**
    27      * Setup test.
    28      */
    29     @RegisterExtension
    30     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    31     public JOSMTestRules test = new JOSMTestRules().projection();
    32 
    3325    private static final double EPSILON = 1e-6;
    3426
     
    156148
    157149    /**
    158      * Unit test of {@link LatLon#LatLon(LatLon)}.
     150     * Unit test of {@link LatLon#LatLon(ILatLon)}.
    159151     */
    160152    @Test
  • trunk/test/unit/org/openstreetmap/josm/data/coor/PolarCoorTest.java

    r17275 r18870  
    77import java.text.DecimalFormat;
    88
    9 import org.junit.jupiter.api.extension.RegisterExtension;
    109import org.junit.jupiter.api.Test;
    1110import org.openstreetmap.josm.TestUtils;
    12 import org.openstreetmap.josm.testutils.JOSMTestRules;
     11import org.openstreetmap.josm.testutils.annotations.Projection;
    1312
    14 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1513import nl.jqno.equalsverifier.EqualsVerifier;
    1614
     
    1816 * Test the {@link PolarCoor} class.
    1917 */
     18@Projection
    2019class PolarCoorTest {
    21 
    22     /**
    23      * Setup test.
    24      */
    25     @RegisterExtension
    26     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    27     public JOSMTestRules test = new JOSMTestRules().projection();
    28 
    2920    /**
    3021     * Test {@link PolarCoor#PolarCoor}
  • trunk/test/unit/org/openstreetmap/josm/data/coor/conversion/ICoordinateFormatTest.java

    r17275 r18870  
    44import static org.junit.jupiter.api.Assertions.assertEquals;
    55
    6 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    7 
    8 import org.junit.jupiter.api.extension.RegisterExtension;
    96import org.junit.jupiter.api.Test;
    107import org.openstreetmap.josm.data.coor.ILatLon;
    118import org.openstreetmap.josm.data.coor.LatLon;
    12 import org.openstreetmap.josm.testutils.JOSMTestRules;
     9import org.openstreetmap.josm.testutils.annotations.Projection;
    1310
    1411/**
    1512 * Test for {@link ICoordinateFormat} implementations.
    1613 */
     14@Projection
    1715class ICoordinateFormatTest {
    18     /**
    19      * Setup test.
    20      */
    21     @RegisterExtension
    22     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    23     public JOSMTestRules test = new JOSMTestRules().projection();
    24 
    2516    /**
    2617     * Tests {@link ICoordinateFormat#latToString(org.openstreetmap.josm.data.coor.ILatLon)}
  • trunk/test/unit/org/openstreetmap/josm/data/coor/conversion/LatLonParserTest.java

    r17275 r18870  
    66
    77import org.junit.jupiter.api.Test;
    8 import org.junit.jupiter.api.extension.RegisterExtension;
    98import org.openstreetmap.josm.data.coor.LatLon;
    10 import org.openstreetmap.josm.testutils.JOSMTestRules;
    11 
    12 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     9import org.openstreetmap.josm.testutils.annotations.Projection;
    1310
    1411/**
    1512 * Unit tests for class {@link LatLonParser}.
    1613 */
     14@Projection
    1715class LatLonParserTest {
    18 
    19     /**
    20      * Setup test.
    21      */
    22     @RegisterExtension
    23     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    24     public JOSMTestRules test = new JOSMTestRules().projection();
    25 
    2616    /**
    2717     * Unit test of {@link LatLonParser#parse} method.
Note: See TracChangeset for help on using the changeset viewer.