Ignore:
Timestamp:
2023-10-04T00:03:40+02:00 (16 months ago)
Author:
taylor.smock
Message:

See #16567: Update to JUnit 5

This removes new JOSMTestRules() with no additional setup and most
JOSMFixture calls.

Removing the bare JOSMTestRules speeds up the test suite since there are two
fewer System.gc() calls per test.

File:
1 edited

Legend:

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

    r17275 r18853  
    44import static org.junit.jupiter.api.Assertions.assertEquals;
    55import static org.junit.jupiter.api.Assertions.assertFalse;
     6import static org.junit.jupiter.api.Assertions.assertThrows;
    67import static org.junit.jupiter.api.Assertions.assertTrue;
    7 import static org.junit.jupiter.api.Assertions.fail;
    88
    99import java.util.List;
    1010
    11 import org.junit.jupiter.api.extension.RegisterExtension;
    1211import org.junit.jupiter.api.Test;
    1312import org.openstreetmap.josm.data.conflict.ConflictCollection;
     
    1918import org.openstreetmap.josm.data.osm.RelationMember;
    2019import org.openstreetmap.josm.data.osm.Way;
    21 import org.openstreetmap.josm.testutils.JOSMTestRules;
    22 
    23 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    2420
    2521/**
     
    2723 */
    2824class APIDataSetTest {
    29 
    30     /**
    31      * Setup test.
    32      */
    33     @RegisterExtension
    34     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    35     public JOSMTestRules test = new JOSMTestRules();
    36 
    3725    @Test
    3826    void testOneNewRelationOnly() throws CyclicUploadDependencyException {
     
    250238        APIDataSet apiDataSet = new APIDataSet();
    251239        apiDataSet.init(ds);
    252         try {
    253             apiDataSet.adjustRelationUploadOrder();
    254             fail("expected cyclic upload dependency exception not thrown");
    255         } catch (CyclicUploadDependencyException e) {
    256             System.out.println(e);
    257         }
     240        assertThrows(CyclicUploadDependencyException.class, apiDataSet::adjustRelationUploadOrder);
    258241    }
    259242}
Note: See TracChangeset for help on using the changeset viewer.