Skip to content

Commit

Permalink
see #21476 - fix non-regression test in CI environment (patch by tayl…
Browse files Browse the repository at this point in the history
…or.smock)

git-svn-id: https://josm.openstreetmap.de/svn/trunk@18306 0c6e7542-c601-0410-84e7-c038aed88b3b
  • Loading branch information
don-vip committed Nov 3, 2021
1 parent 9a1d6e6 commit c9ac057
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/unit/org/openstreetmap/josm/actions/UploadActionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import java.util.Collections;
import java.util.concurrent.TimeUnit;

import org.junit.Ignore;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.openstreetmap.josm.TestUtils;
Expand All @@ -26,6 +26,7 @@
import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
import org.openstreetmap.josm.testutils.mockers.WindowMocker;
import org.openstreetmap.josm.tools.Logging;
import org.openstreetmap.josm.tools.Territories;

import mockit.Invocation;
import mockit.Mock;
Expand All @@ -38,14 +39,23 @@
@BasicPreferences
class UploadActionTest {
// Only needed for layer cleanup. And user identity cleanup. And ensuring that data isn't accidentally uploaded.
// Note that the setUp method can be replaced by the @Territories extension, when that is merged.
@RegisterExtension
JOSMTestRules josmTestRules = new JOSMTestRules().main().projection().fakeAPI();

@BeforeAll
static void setUp() {
// Territories is needed due to test pollution. One of the listeners
// that may get registered on SelectionEventManager requires
// Territories. Rather unfortunately, we also need the external data to
// avoid the NPE.
Territories.initialize();
}

/**
* Non-regression test for JOSM #21476.
*/
@Test
@Ignore("doesn't work on CI")
void testNonRegression21476() {
TestUtils.assumeWorkingJMockit();
Logging.clearLastErrorAndWarnings();
Expand Down

0 comments on commit c9ac057

Please sign in to comment.