public class ForkStarter
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
ForkStarter.InputStreamCloser
Closes an InputStream
|
Modifier and Type | Field and Description |
---|---|
private java.util.Queue<ForkClient> |
currentForkClients |
private java.util.Collection<DefaultReporterFactory> |
defaultReporterFactories |
private DefaultReporterFactory |
defaultReporterFactory |
private ForkConfiguration |
forkConfiguration |
private static java.util.concurrent.ThreadFactory |
FORKED_JVM_DAEMON_THREAD_FACTORY |
private int |
forkedProcessTimeoutInSeconds |
private org.apache.maven.plugin.logging.Log |
log |
private static long |
PING_IN_SECONDS |
private java.util.concurrent.ScheduledExecutorService |
pingThreadScheduler |
private ProviderConfiguration |
providerConfiguration |
private static java.util.concurrent.ThreadFactory |
SHUTDOWN_HOOK_THREAD_FACTORY |
private StartupConfiguration |
startupConfiguration |
private StartupReportConfiguration |
startupReportConfiguration |
private static java.util.concurrent.atomic.AtomicInteger |
SYSTEM_PROPERTIES_FILE_COUNTER |
private static int |
TIMEOUT_CHECK_PERIOD_MILLIS |
private java.util.concurrent.ScheduledExecutorService |
timeoutCheckScheduler |
Constructor and Description |
---|
ForkStarter(ProviderConfiguration providerConfiguration,
StartupConfiguration startupConfiguration,
ForkConfiguration forkConfiguration,
int forkedProcessTimeoutInSeconds,
StartupReportConfiguration startupReportConfiguration,
org.apache.maven.plugin.logging.Log log) |
Modifier and Type | Method and Description |
---|---|
private static RunResult |
awaitResultsDone(java.util.Collection<java.util.concurrent.Future<RunResult>> results,
java.util.concurrent.ExecutorService executorService) |
private void |
closeExecutor(java.util.concurrent.ExecutorService executorService) |
private static java.lang.Thread |
createCachableShutdownHookThread(TestLessInputStream.TestLessInputStreamBuilder builder,
Shutdown shutdownType) |
private static java.lang.Thread |
createImmediateShutdownHookThread(TestLessInputStream.TestLessInputStreamBuilder builder,
Shutdown shutdownType) |
private static java.util.concurrent.ScheduledExecutorService |
createPingScheduler() |
private static java.lang.Thread |
createShutdownHookThread(java.lang.Iterable<TestProvidingInputStream> streams,
Shutdown shutdownType) |
private static java.util.concurrent.ScheduledExecutorService |
createTimeoutCheckScheduler() |
private RunResult |
fork(java.lang.Object testSet,
KeyValueSource providerProperties,
ForkClient forkClient,
SurefireProperties effectiveSystemProperties,
AbstractForkInputStream testProvidingInputStream,
boolean readTestsFromInStream) |
private RunResult |
fork(java.lang.Object testSet,
KeyValueSource providerProperties,
ForkClient forkClient,
SurefireProperties effectiveSystemProperties,
int forkNumber,
AbstractForkInputStream testProvidingInputStream,
boolean readTestsFromInStream) |
private java.lang.Iterable<java.lang.Class<?>> |
getSuitesIterator() |
private boolean |
hasSuiteXmlFiles() |
private boolean |
isForkOnce() |
private static void |
notifyStreamsToSkipTests(java.util.Collection<? extends NotifiableTestStream> notifiableTestStreams) |
private RunResult |
run(SurefireProperties effectiveSystemProperties) |
RunResult |
run(SurefireProperties effectiveSystemProperties,
DefaultScanResult scanResult) |
private RunResult |
run(SurefireProperties effectiveSystemProperties,
java.util.Map<java.lang.String,java.lang.String> providerProperties) |
private RunResult |
runSuitesForkOnceMultiple(SurefireProperties effectiveSystemProperties,
int forkCount) |
private RunResult |
runSuitesForkPerTestSet(SurefireProperties effectiveSystemProperties,
int forkCount) |
private java.util.concurrent.ScheduledFuture<?> |
triggerPingTimerForShutdown(java.lang.Iterable<TestProvidingInputStream> streams) |
private java.util.concurrent.ScheduledFuture<?> |
triggerPingTimerForShutdown(TestLessInputStream.TestLessInputStreamBuilder builder) |
private java.util.concurrent.ScheduledFuture<?> |
triggerTimeoutCheck() |
private static final long PING_IN_SECONDS
private static final int TIMEOUT_CHECK_PERIOD_MILLIS
private static final java.util.concurrent.ThreadFactory FORKED_JVM_DAEMON_THREAD_FACTORY
private static final java.util.concurrent.ThreadFactory SHUTDOWN_HOOK_THREAD_FACTORY
private static final java.util.concurrent.atomic.AtomicInteger SYSTEM_PROPERTIES_FILE_COUNTER
private final java.util.concurrent.ScheduledExecutorService pingThreadScheduler
private final java.util.concurrent.ScheduledExecutorService timeoutCheckScheduler
private final java.util.Queue<ForkClient> currentForkClients
private final int forkedProcessTimeoutInSeconds
private final ProviderConfiguration providerConfiguration
private final StartupConfiguration startupConfiguration
private final ForkConfiguration forkConfiguration
private final StartupReportConfiguration startupReportConfiguration
private final org.apache.maven.plugin.logging.Log log
private final DefaultReporterFactory defaultReporterFactory
private final java.util.Collection<DefaultReporterFactory> defaultReporterFactories
public ForkStarter(ProviderConfiguration providerConfiguration, StartupConfiguration startupConfiguration, ForkConfiguration forkConfiguration, int forkedProcessTimeoutInSeconds, StartupReportConfiguration startupReportConfiguration, org.apache.maven.plugin.logging.Log log)
public RunResult run(SurefireProperties effectiveSystemProperties, DefaultScanResult scanResult) throws SurefireBooterForkException, SurefireExecutionException
private RunResult run(SurefireProperties effectiveSystemProperties, java.util.Map<java.lang.String,java.lang.String> providerProperties) throws SurefireBooterForkException
SurefireBooterForkException
private RunResult run(SurefireProperties effectiveSystemProperties) throws SurefireBooterForkException
SurefireBooterForkException
private boolean isForkOnce()
private boolean hasSuiteXmlFiles()
private RunResult runSuitesForkOnceMultiple(SurefireProperties effectiveSystemProperties, int forkCount) throws SurefireBooterForkException
SurefireBooterForkException
private static void notifyStreamsToSkipTests(java.util.Collection<? extends NotifiableTestStream> notifiableTestStreams)
private RunResult runSuitesForkPerTestSet(SurefireProperties effectiveSystemProperties, int forkCount) throws SurefireBooterForkException
SurefireBooterForkException
private static RunResult awaitResultsDone(java.util.Collection<java.util.concurrent.Future<RunResult>> results, java.util.concurrent.ExecutorService executorService) throws SurefireBooterForkException
SurefireBooterForkException
private void closeExecutor(java.util.concurrent.ExecutorService executorService) throws SurefireBooterForkException
SurefireBooterForkException
private RunResult fork(java.lang.Object testSet, KeyValueSource providerProperties, ForkClient forkClient, SurefireProperties effectiveSystemProperties, AbstractForkInputStream testProvidingInputStream, boolean readTestsFromInStream) throws SurefireBooterForkException
SurefireBooterForkException
private RunResult fork(java.lang.Object testSet, KeyValueSource providerProperties, ForkClient forkClient, SurefireProperties effectiveSystemProperties, int forkNumber, AbstractForkInputStream testProvidingInputStream, boolean readTestsFromInStream) throws SurefireBooterForkException
SurefireBooterForkException
private java.lang.Iterable<java.lang.Class<?>> getSuitesIterator() throws SurefireBooterForkException
SurefireBooterForkException
private static java.lang.Thread createImmediateShutdownHookThread(TestLessInputStream.TestLessInputStreamBuilder builder, Shutdown shutdownType)
private static java.lang.Thread createCachableShutdownHookThread(TestLessInputStream.TestLessInputStreamBuilder builder, Shutdown shutdownType)
private static java.lang.Thread createShutdownHookThread(java.lang.Iterable<TestProvidingInputStream> streams, Shutdown shutdownType)
private static java.util.concurrent.ScheduledExecutorService createPingScheduler()
private static java.util.concurrent.ScheduledExecutorService createTimeoutCheckScheduler()
private java.util.concurrent.ScheduledFuture<?> triggerPingTimerForShutdown(TestLessInputStream.TestLessInputStreamBuilder builder)
private java.util.concurrent.ScheduledFuture<?> triggerPingTimerForShutdown(java.lang.Iterable<TestProvidingInputStream> streams)
private java.util.concurrent.ScheduledFuture<?> triggerTimeoutCheck()