Class JUnit5ModuleTestExecutor
- java.lang.Object
-
- org.hl7.fhir.utilities.tests.execution.ModuleTestExecutor
-
- org.hl7.fhir.utilities.tests.execution.junit5.JUnit5ModuleTestExecutor
-
public class JUnit5ModuleTestExecutor extends ModuleTestExecutor
This class allows JUnit 5 tests to be run in Java runtime. JUnit 4 tests ARE NOT SUPPORTED. This mimics for the most part the output of the Maven Surefire plugin, with additional summaries and unique IDs for diagnosing failing tests.
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_CLASSNAME_FILTER
-
Constructor Summary
Constructors Constructor Description JUnit5ModuleTestExecutor(String moduleName, List<String> packageNames)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CliTestSummaryexecuteTests(PrintStream out, String classNameFilter)Execute all tests defined in this module and return a TestExecutionSummary.static JUnit5ModuleTestExecutorgetStandardModuleTestExecutor(String moduleName)Create a ModuleTestExecutor for the standard case where the module name maps to the package name of the root package containing tests.-
Methods inherited from class org.hl7.fhir.utilities.tests.execution.ModuleTestExecutor
getModuleName, printSummmary, printTestFailed, printTestFinished, printTestStarted
-
-
-
-
Field Detail
-
DEFAULT_CLASSNAME_FILTER
public static final String DEFAULT_CLASSNAME_FILTER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JUnit5ModuleTestExecutor
public JUnit5ModuleTestExecutor(String moduleName, List<String> packageNames)
-
-
Method Detail
-
executeTests
public CliTestSummary executeTests(PrintStream out, String classNameFilter)
Execute all tests defined in this module and return a TestExecutionSummary. Any stack traces required to diagnose test failures will be output at this stage, along with a unique test ID.- Specified by:
executeTestsin classModuleTestExecutor- Parameters:
out- the PrintStream to log execution or test failure.classNameFilter- a Regex to use to select tests. If null, this will default to the JUnit console filter.- Returns:
- The test execution summary.
- See Also:
ClassNameFilter
-
getStandardModuleTestExecutor
public static JUnit5ModuleTestExecutor getStandardModuleTestExecutor(String moduleName)
Create a ModuleTestExecutor for the standard case where the module name maps to the package name of the root package containing tests. For example the module "org.hl7.fhir.r5" will be assumed to have all its tests in the "org.hl7.fhir.r5" package or its child packages.- Parameters:
moduleName- The name of the module and root package containing tests.- Returns:
- the ModuleTestExecutor for the module
-
-