Class 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.
    • 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:
        executeTests in class ModuleTestExecutor
        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