Class ForkStarter
java.lang.Object
org.apache.maven.plugin.surefire.booterclient.ForkStarter
Starts the fork or runs in-process.
Lives only on the plugin-side (not present in remote vms)
Knows how to fork new vms and also how to delegate non-forking invocation to SurefireStarter directly
Lives only on the plugin-side (not present in remote vms)
Knows how to fork new vms and also how to delegate non-forking invocation to SurefireStarter directly
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate final classCloses stuff, with a shutdown hook to make sure things really get closed.private final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Queue<ForkClient>private final Collection<DefaultReporterFactory>private static final Stringprivate final ForkConfigurationprivate static final ThreadFactoryprivate final intprivate final ConsoleLoggerprivate static final longprivate final ScheduledExecutorServiceprivate final ProviderConfigurationprivate final ReportsMergerprivate static final ThreadFactoryprivate final StartupConfigurationprivate final StartupReportConfigurationprivate static final AtomicIntegerprivate static final intprivate final ScheduledExecutorService -
Constructor Summary
ConstructorsConstructorDescriptionForkStarter(ProviderConfiguration providerConfiguration, StartupConfiguration startupConfiguration, ForkConfiguration forkConfiguration, int forkedProcessTimeoutInSeconds, StartupReportConfiguration startupReportConfiguration, ConsoleLogger log) -
Method Summary
Modifier and TypeMethodDescriptionprivate static RunResultawaitResultsDone(Collection<Future<RunResult>> results, ExecutorService executorService) private static StoppablebindErrorStream(int forkNumber, CountdownCloseable countdownCloseable, CommandlineStreams streams, Object errorStreamLock) private voidcloseExecutor(ExecutorService executorService) private static ThreadcreateCachableShutdownHookThread(TestLessInputStream.TestLessInputStreamBuilder builder, Shutdown shutdownType) private static ThreadcreateImmediateShutdownHookThread(TestLessInputStream.TestLessInputStreamBuilder builder, Shutdown shutdownType) private static ScheduledExecutorServiceprivate static ThreadcreateShutdownHookThread(Iterable<TestProvidingInputStream> streams, Shutdown shutdownType) private static ScheduledExecutorServiceprivate RunResultfork(Object testSet, PropertiesWrapper providerProperties, ForkClient forkClient, SurefireProperties effectiveSystemProperties, int forkNumber, AbstractCommandReader commandReader, ForkNodeFactory forkNodeFactory, boolean readTestsFromInStream) private booleanprivate booleanvoidprivate static voidnotifyStreamsToSkipTests(Collection<? extends NotifiableTestStream> notifiableTestStreams) private RunResultrun(SurefireProperties effectiveSystemProperties) private RunResultrun(SurefireProperties effectiveSystemProps, Map<String, String> providerProperties) run(SurefireProperties effectiveSystemProperties, DefaultScanResult scanResult) private RunResultrunSuitesForkOnceMultiple(SurefireProperties effectiveSystemProps, int forkCount) private RunResultrunSuitesForkPerTestSet(SurefireProperties effectiveSystemProps, int forkCount) private ScheduledFuture<?>private ScheduledFuture<?>private ScheduledFuture<?>
-
Field Details
-
EXECUTION_EXCEPTION
- See Also:
-
PING_IN_SECONDS
private static final long PING_IN_SECONDS- See Also:
-
TIMEOUT_CHECK_PERIOD_MILLIS
private static final int TIMEOUT_CHECK_PERIOD_MILLIS- See Also:
-
FORKED_JVM_DAEMON_THREAD_FACTORY
-
SHUTDOWN_HOOK_THREAD_FACTORY
-
SYSTEM_PROPERTIES_FILE_COUNTER
-
logsAtEnd
-
pingThreadScheduler
-
timeoutCheckScheduler
-
currentForkClients
-
forkedProcessTimeoutInSeconds
private final int forkedProcessTimeoutInSeconds -
providerConfiguration
-
startupConfiguration
-
forkConfiguration
-
startupReportConfiguration
-
log
-
reportMerger
-
defaultReporterFactories
-
-
Constructor Details
-
ForkStarter
public ForkStarter(ProviderConfiguration providerConfiguration, StartupConfiguration startupConfiguration, ForkConfiguration forkConfiguration, int forkedProcessTimeoutInSeconds, StartupReportConfiguration startupReportConfiguration, ConsoleLogger log)
-
-
Method Details
-
run
public RunResult run(@Nonnull SurefireProperties effectiveSystemProperties, @Nonnull DefaultScanResult scanResult) throws SurefireBooterForkException - Throws:
SurefireBooterForkException
-
killOrphanForks
public void killOrphanForks() -
run
private RunResult run(SurefireProperties effectiveSystemProps, Map<String, String> providerProperties) throws SurefireBooterForkException- Throws:
SurefireBooterForkException
-
run
private RunResult run(SurefireProperties effectiveSystemProperties) throws SurefireBooterForkException - Throws:
SurefireBooterForkException
-
isForkOnce
private boolean isForkOnce() -
hasSuiteXmlFiles
private boolean hasSuiteXmlFiles() -
runSuitesForkOnceMultiple
private RunResult runSuitesForkOnceMultiple(SurefireProperties effectiveSystemProps, int forkCount) throws SurefireBooterForkException - Throws:
SurefireBooterForkException
-
notifyStreamsToSkipTests
private static void notifyStreamsToSkipTests(Collection<? extends NotifiableTestStream> notifiableTestStreams) -
runSuitesForkPerTestSet
private RunResult runSuitesForkPerTestSet(SurefireProperties effectiveSystemProps, int forkCount) throws SurefireBooterForkException - Throws:
SurefireBooterForkException
-
awaitResultsDone
private static RunResult awaitResultsDone(Collection<Future<RunResult>> results, ExecutorService executorService) throws SurefireBooterForkException - Throws:
SurefireBooterForkException
-
closeExecutor
- Throws:
SurefireBooterForkException
-
fork
private RunResult fork(Object testSet, PropertiesWrapper providerProperties, ForkClient forkClient, SurefireProperties effectiveSystemProperties, int forkNumber, AbstractCommandReader commandReader, ForkNodeFactory forkNodeFactory, boolean readTestsFromInStream) throws SurefireBooterForkException - Throws:
SurefireBooterForkException
-
bindErrorStream
private static Stoppable bindErrorStream(int forkNumber, CountdownCloseable countdownCloseable, CommandlineStreams streams, Object errorStreamLock) -
getSuitesIterator
- Throws:
SurefireBooterForkException
-
createImmediateShutdownHookThread
private static Thread createImmediateShutdownHookThread(TestLessInputStream.TestLessInputStreamBuilder builder, Shutdown shutdownType) -
createCachableShutdownHookThread
private static Thread createCachableShutdownHookThread(TestLessInputStream.TestLessInputStreamBuilder builder, Shutdown shutdownType) -
createShutdownHookThread
private static Thread createShutdownHookThread(Iterable<TestProvidingInputStream> streams, Shutdown shutdownType) -
createPingScheduler
-
createTimeoutCheckScheduler
-
triggerPingTimerForShutdown
private ScheduledFuture<?> triggerPingTimerForShutdown(TestLessInputStream.TestLessInputStreamBuilder builder) -
triggerPingTimerForShutdown
-
triggerTimeoutCheck
-