Changeset 18551 in josm for trunk/test


Ignore:
Timestamp:
2022-09-08T01:44:00+02:00 (2 years ago)
Author:
taylor.smock
Message:

Fix test failures due to StackOverflowError

This occurs due to JMockit not cleaning up mocks in JUnit4 vintage.
This means that EDTAssertionMocker, WindowlessMapViewStateMocker, and
WindowlessNavigatableComponentMocker are all present after a JUnit4
test is run.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java

    r17693 r18551  
    2727import java.util.logging.Level;
    2828
     29import mockit.internal.state.SavePoint;
    2930import org.awaitility.Awaitility;
    3031import org.junit.jupiter.api.extension.AfterAllCallback;
     
    729730        @Override
    730731        public void evaluate() throws Throwable {
     732            // Needed since JMockit doesn't clean up JUnit4 vintage tests. We really shouldn't have to touch JMockit internal classes. :(
     733            SavePoint savePoint = new SavePoint();
    731734            before();
    732735            try {
     
    735738                if (!junit5) {
    736739                    after();
     740                    savePoint.rollback();
    737741                }
    738742            }
Note: See TracChangeset for help on using the changeset viewer.