Class LauncherFactory
- java.lang.Object
-
- org.junit.platform.launcher.core.LauncherFactory
-
@API(status=STABLE, since="1.0") public class LauncherFactory extends java.lang.ObjectFactory for creatingLauncherinstances by invokingcreate()orcreate(LauncherConfig).By default, test engines are discovered at runtime using the
ServiceLoadermechanism. For that purpose, a text file namedMETA-INF/services/org.junit.platform.engine.TestEnginehas to be added to the engine's JAR file in which the fully qualified name of the implementation class of theTestEngineinterface is declared.By default, test execution listeners are discovered at runtime via the
ServiceLoadermechanism and are automatically registered with theLaunchercreated by this factory. Users may register additional listeners using theLauncher.registerTestExecutionListeners(TestExecutionListener...)method on the created launcher instance.For full control over automatic registration and programmatic registration of test engines and listeners, supply an instance of
LauncherConfigtocreate(LauncherConfig).- Since:
- 1.0
- See Also:
Launcher,LauncherConfig
-
-
Constructor Summary
Constructors Modifier Constructor Description privateLauncherFactory()
-
Method Summary
-
-
-
Method Detail
-
openSession
@API(status=STABLE, since="1.10") public static LauncherSession openSession() throws org.junit.platform.commons.PreconditionViolationException- Throws:
org.junit.platform.commons.PreconditionViolationException- if no test engines are detected- Since:
- 1.8
- See Also:
openSession(LauncherConfig)
-
openSession
@API(status=STABLE, since="1.10") public static LauncherSession openSession(LauncherConfig config) throws org.junit.platform.commons.PreconditionViolationExceptionFactory method for opening a newLauncherSessionusing the suppliedLauncherConfig.- Parameters:
config- the configuration for the session and the launcher; nevernull- Throws:
org.junit.platform.commons.PreconditionViolationException- if the supplied configuration isnull, or if no test engines are detected- Since:
- 1.8
- See Also:
openSession()
-
create
public static Launcher create() throws org.junit.platform.commons.PreconditionViolationException
- Throws:
org.junit.platform.commons.PreconditionViolationException- if no test engines are detected- See Also:
create(LauncherConfig)
-
create
@API(status=STABLE, since="1.10") public static Launcher create(LauncherConfig config) throws org.junit.platform.commons.PreconditionViolationExceptionFactory method for creating a newLauncherusing the suppliedLauncherConfig.- Parameters:
config- the configuration for the launcher; nevernull- Throws:
org.junit.platform.commons.PreconditionViolationException- if the supplied configuration isnull, or if no test engines are detected registered- Since:
- 1.3
- See Also:
create()
-
createDefaultLauncher
private static DefaultLauncher createDefaultLauncher(LauncherConfig config, LauncherConfigurationParameters configurationParameters, NamespacedHierarchicalStore<Namespace> sessionLevelStore)
-
collectLauncherInterceptors
private static java.util.List<LauncherInterceptor> collectLauncherInterceptors(LauncherConfigurationParameters configurationParameters)
-
collectTestEngines
private static java.util.Set<TestEngine> collectTestEngines(LauncherConfig config)
-
createLauncherSessionListener
private static LauncherSessionListener createLauncherSessionListener(LauncherConfig config)
-
collectPostDiscoveryFilters
private static java.util.List<PostDiscoveryFilter> collectPostDiscoveryFilters(LauncherConfig config)
-
registerLauncherDiscoveryListeners
private static void registerLauncherDiscoveryListeners(LauncherConfig config, Launcher launcher)
-
registerTestExecutionListeners
private static void registerTestExecutionListeners(LauncherConfig config, Launcher launcher, LauncherConfigurationParameters configurationParameters)
-
loadAndFilterTestExecutionListeners
private static java.lang.Iterable<TestExecutionListener> loadAndFilterTestExecutionListeners(ConfigurationParameters configurationParameters)
-
-