Search in sources :

Example 26 with Launcher

use of org.junit.platform.launcher.Launcher in project Mindroid.java by Himmele.

the class Main method main.

public static void main(String[] args) {
    LogManager.getLogManager().getLogger(Logger.GLOBAL_LOGGER_NAME).setLevel(Level.INFO);
    LauncherDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request().selectors(selectPackage("mindroid.tests")).filters(includeClassNamePatterns(".*")).build();
    Launcher launcher = LauncherFactory.create();
    TestExecutionListener listener = LoggingListener.forJavaUtilLogging(Level.INFO);
    launcher.registerTestExecutionListeners(listener);
    launcher.execute(request);
    System.exit(0);
}
Also used : LauncherDiscoveryRequest(org.junit.platform.launcher.LauncherDiscoveryRequest) TestExecutionListener(org.junit.platform.launcher.TestExecutionListener) Launcher(org.junit.platform.launcher.Launcher)

Aggregations

Launcher (org.junit.platform.launcher.Launcher)26 LauncherDiscoveryRequest (org.junit.platform.launcher.LauncherDiscoveryRequest)16 TestExecutionSummary (org.junit.platform.launcher.listeners.TestExecutionSummary)8 SummaryGeneratingListener (org.junit.platform.launcher.listeners.SummaryGeneratingListener)7 TestExecutionListener (org.junit.platform.launcher.TestExecutionListener)6 TestPlan (org.junit.platform.launcher.TestPlan)6 Test (org.junit.jupiter.api.Test)5 ProviderParameters (org.apache.maven.surefire.providerapi.ProviderParameters)3 TestIdentifier (org.junit.platform.launcher.TestIdentifier)3 PrintStream (java.io.PrintStream)2 PrintWriter (java.io.PrintWriter)2 ArrayList (java.util.ArrayList)2 Set (java.util.Set)2 RunListener (org.apache.maven.surefire.report.RunListener)2 SimpleReportEntry (org.apache.maven.surefire.report.SimpleReportEntry)2 TestListResolver (org.apache.maven.surefire.testset.TestListResolver)2 TestsToRun (org.apache.maven.surefire.util.TestsToRun)2 TestExecutionResult (org.junit.platform.engine.TestExecutionResult)2 IOException (java.io.IOException)1 StringWriter (java.io.StringWriter)1