Package org.apache.maven.surefire.booter
Class ForkedBooter
java.lang.Object
org.apache.maven.surefire.booter.ForkedBooter
The part of the booter that is unique to a forked vm.
Deals with deserialization of the booter wire-level protocol
Deals with deserialization of the booter wire-level protocol
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CommandReader
private static final long
private MasterProcessChannelEncoder
private final Semaphore
private ForkingReporterFactory
private ScheduledThreadPoolExecutor
private static final String
private ConsoleLogger
private static final String
private static final long
private ForkedBooter.PingScheduler
private static final String
private static final String
private ProviderConfiguration
private StartupConfiguration
private long
private Object
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
private static boolean
acquireOnePermit
(Semaphore barrier) private void
private static boolean
canUseNewPingMechanism
(PpidChecker pluginProcessChecker) private void
private CommandListener
createExitHandler
(PpidChecker ppidChecker) private ForkingReporterFactory
private CommandListener
createPingHandler
(AtomicBoolean pingDone) private Runnable
createPingJob
(AtomicBoolean pingDone, PpidChecker pluginProcessChecker) private SurefireProvider
private static ScheduledExecutorService
createScheduler
(String threadName) private static InputStream
createSurefirePropertiesIfFileExists
(String tmpDir, String propFileName) private Object
createTestSet
(TypeEncodedValue forkedTestSet, boolean readTestsFromCommandReader, ClassLoader cl) private void
execute()
private void
exit1()
private void
Necessary for the Surefire817SystemExitIT.private static String
private ScheduledThreadPoolExecutor
private static String
private static boolean
private void
kill()
private void
kill
(int returnCode) private void
launchLastDitchDaemonShutdownThread
(int returnCode) private ForkedBooter.PingScheduler
private static MasterProcessChannelProcessorFactory
lookupDecoderFactory
(String channelConfig) static void
This method is invoked when Surefire is forked - this method parses and organizes the arguments passed to it and then calls the Surefire class' run method.private Runnable
processCheckerJob
(ForkedBooter.PingScheduler pingMechanism) private static void
run
(ForkedBooter booter, String[] args) created for testing purposes.private void
private void
setupBooter
(String tmpDir, String dumpFileName, String surefirePropsFileName, String effectiveSystemPropertiesFileName)
-
Field Details
-
DEFAULT_SYSTEM_EXIT_TIMEOUT_IN_SECONDS
private static final long DEFAULT_SYSTEM_EXIT_TIMEOUT_IN_SECONDS- See Also:
-
PING_TIMEOUT_IN_SECONDS
private static final long PING_TIMEOUT_IN_SECONDS- See Also:
-
LAST_DITCH_SHUTDOWN_THREAD
- See Also:
-
PING_THREAD
- See Also:
-
PROCESS_CHECKER_THREAD
- See Also:
-
PROCESS_PIPES_ERROR
- See Also:
-
exitBarrier
-
eventChannel
-
logger
-
channelProcessorFactory
-
commandReader
-
systemExitTimeoutInSeconds
private volatile long systemExitTimeoutInSeconds -
pingScheduler
-
jvmTerminator
-
providerConfiguration
-
forkingReporterFactory
-
startupConfiguration
-
testSet
-
-
Constructor Details
-
ForkedBooter
public ForkedBooter()
-
-
Method Details
-
setupBooter
private void setupBooter(String tmpDir, String dumpFileName, String surefirePropsFileName, String effectiveSystemPropertiesFileName) throws IOException - Throws:
IOException
-
execute
private void execute() -
createTestSet
private Object createTestSet(TypeEncodedValue forkedTestSet, boolean readTestsFromCommandReader, ClassLoader cl) -
cancelPingScheduler
private void cancelPingScheduler() -
closeForkChannel
private void closeForkChannel() -
listenToShutdownCommands
-
processCheckerJob
-
createPingHandler
-
createExitHandler
-
createPingJob
-
kill
private void kill() -
kill
private void kill(int returnCode) -
exit1
private void exit1() -
acknowledgedExit
private void acknowledgedExit() -
runSuitesInProcess
-
createForkingReporterFactory
-
getJvmTerminator
-
launchLastDitchDaemonShutdownThread
private void launchLastDitchDaemonShutdownThread(int returnCode) -
createProviderInCurrentClassloader
-
flushEventChannelOnExit
private void flushEventChannelOnExit()Necessary for the Surefire817SystemExitIT. -
lookupDecoderFactory
-
main
This method is invoked when Surefire is forked - this method parses and organizes the arguments passed to it and then calls the Surefire class' run method.
The system exit code will be 1 if an exception is thrown.- Parameters:
args
- Commandline arguments
-
run
created for testing purposes.- Parameters:
booter
- booter in JVMargs
- arguments passed to JVM
-
canUseNewPingMechanism
-
acquireOnePermit
-
createScheduler
-
createSurefirePropertiesIfFileExists
private static InputStream createSurefirePropertiesIfFileExists(String tmpDir, String propFileName) throws FileNotFoundException - Throws:
FileNotFoundException
-
isDebugging
private static boolean isDebugging() -
generateThreadDump
-
getProcessName
-