-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor chgs wrt Jupiter: Extension_Mats handling @nested, and determin…
…ing test instances * Extension_Mats: Use ExtensionContext to determine if we are in a nested class: Go up the ExtensionContext hierachy to find Extension_Mats * Extension_MatsAnnotatedClass: Use ExtensionContext to find test instances, both @nested and enclosing test class instances. * Changed init for Extension_Mats a tad: Using context.getRoot() directly. (Original changes by Ståle Undheim)
- Loading branch information
Showing
9 changed files
with
143 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ | |
import org.junit.rules.TestRule; | ||
import org.junit.runner.Description; | ||
import org.junit.runners.model.Statement; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import io.mats3.impl.jms.JmsMatsFactory; | ||
import io.mats3.serial.MatsSerializer; | ||
|
@@ -51,11 +53,11 @@ | |
* } | ||
* </pre> | ||
* | ||
* | ||
* @author Endre Stølsvik - 2015 - http://endre.stolsvik.com | ||
* @author Kevin Mc Tiernan, 2020-10-18, [email protected] | ||
*/ | ||
public class Rule_Mats extends AbstractMatsTest implements TestRule { | ||
protected static final Logger log = LoggerFactory.getLogger(Rule_Mats.class); | ||
|
||
protected Rule_Mats(MatsSerializer<?> matsSerializer) { | ||
super(matsSerializer); | ||
|
@@ -107,12 +109,16 @@ public Statement apply(Statement base, Description description) { | |
} | ||
return new Statement() { | ||
public void evaluate() throws Throwable { | ||
log.info(LOG_PREFIX+"INIT: beforeAll on JUnit @ClassRule " + idThis() + "."); | ||
beforeAll(); | ||
log.info(LOG_PREFIX+"-- init done: beforeAll on JUnit @ClassRule " + idThis() + "."); | ||
try { | ||
base.evaluate(); | ||
} | ||
finally { | ||
log.info(LOG_PREFIX+"CLEANUP: afterAll on JUnit @ClassRule " + idThis() + "."); | ||
afterAll(); | ||
log.info(LOG_PREFIX+"-- cleanup done: afterAll on JUnit @ClassRule " + idThis() + "."); | ||
} | ||
} | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.