Class SuiteLauncherDiscoveryRequestBuilder

java.lang.Object
org.junit.platform.suite.commons.SuiteLauncherDiscoveryRequestBuilder

@API(status=INTERNAL, since="1.8", consumers={"org.junit.platform.suite.engine","org.junit.platform.runner"}) public final class SuiteLauncherDiscoveryRequestBuilder extends Object
The SuiteLauncherDiscoveryRequestBuilder provides a light-weight DSL for generating a LauncherDiscoveryRequest specifically tailored for suite execution.

Example


 SuiteLauncherDiscoveryRequestBuilder.request()
   .selectors(
        selectPackage("org.example.user"),
        selectClass("org.example.payment.PaymentTests"),
        selectClass(ShippingTests.class),
        selectMethod("org.example.order.OrderTests#test1"),
        selectMethod("org.example.order.OrderTests#test2()"),
        selectMethod("org.example.order.OrderTests#test3(java.lang.String)"),
        selectMethod("org.example.order.OrderTests", "test4"),
        selectMethod(OrderTests.class, "test5"),
        selectMethod(OrderTests.class, testMethod),
        selectClasspathRoots(Collections.singleton(Paths.get("/my/local/path1"))),
        selectUniqueId("unique-id-1"),
        selectUniqueId("unique-id-2")
   )
   .filters(
        includeEngines("junit-jupiter", "spek"),
        // excludeEngines("junit-vintage"),
        includeTags("fast"),
        // excludeTags("slow"),
        includeClassNamePatterns(".*Test[s]?")
        // includeClassNamePatterns("org\.example\.tests.*")
   )
   .configurationParameter("key", "value")
   .enableImplicitConfigurationParameters(true)
   .applyConfigurationParametersFromSuite(MySuite.class)
   .applySelectorsAndFiltersFromSuite(MySuite.class)
   .build();
 
Since:
1.8
See Also: