Ticket #16567: 16567.fixup1.1.patch
File 16567.fixup1.1.patch, 2.3 KB (added by , 4 years ago) |
---|
-
build.xml
462 462 <jvmarg value="${jacocoagent@{testfamily}@{testITsuffix}}" if:set="jacocoagent@{testfamily}@{testITsuffix}" /> 463 463 <jvmarg value="-Dfile.encoding=UTF-8"/> 464 464 <jvmarg value="-javaagent:${test.dir}/lib/jmockit.jar"/> 465 <jvmarg value="-Djunit.jupiter.extensions.autodetection.enabled=true"/> 465 466 <jvmarg value="--add-modules" if:set="isJava9" unless:set="isJava11" /> 466 467 <jvmarg value="java.activation,java.se.ee" if:set="isJava9" unless:set="isJava11" /> 467 468 <jvmarg value="--add-exports" if:set="isJava9" unless:set="noJavaFX" /> -
test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java
103 103 private boolean territories; 104 104 private boolean metric; 105 105 private boolean main; 106 /** 107 * This boolean is only used to indicate if JUnit5 is used in a test. If it is, 108 * we must not call after in {@link JOSMTestRules.CreateJosmEnvironment#evaluate}. 109 * TODO: Remove JUnit4 as a whole sometime after 2021-01-01 (~6 month lead time for plugins) 110 */ 111 private boolean junit5; 106 112 107 113 /** 108 114 * Disable the default timeout for this test. Use with care. … … 437 443 438 444 @Override 439 445 public void beforeEach(ExtensionContext context) throws Exception { 446 this.junit5 = true; 440 447 Statement temporaryStatement = new Statement() { 441 448 @Override 442 449 public void evaluate() throws Throwable { … … 454 461 455 462 @Override 456 463 public void afterEach(ExtensionContext context) throws Exception { 457 // do nothing for now464 after(); 458 465 } 459 466 460 467 /** … … 689 696 try { 690 697 base.evaluate(); 691 698 } finally { 692 after(); 699 if (!junit5) { 700 after(); 701 } 693 702 } 694 703 } 695 704 }