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 CommandReaderprivate static final longprivate MasterProcessChannelEncoderprivate final Semaphoreprivate ForkingReporterFactoryprivate ScheduledThreadPoolExecutorprivate static final Stringprivate ConsoleLoggerprivate static final Stringprivate static final longprivate ForkedBooter.PingSchedulerprivate static final Stringprivate static final Stringprivate ProviderConfigurationprivate StartupConfigurationprivate longprivate Object -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate static booleanacquireOnePermit(Semaphore barrier) private voidprivate static booleancanUseNewPingMechanism(PpidChecker pluginProcessChecker) private voidprivate CommandListenercreateExitHandler(PpidChecker ppidChecker) private ForkingReporterFactoryprivate CommandListenercreatePingHandler(AtomicBoolean pingDone) private RunnablecreatePingJob(AtomicBoolean pingDone, PpidChecker pluginProcessChecker) private SurefireProviderprivate static ScheduledExecutorServicecreateScheduler(String threadName) private static InputStreamcreateSurefirePropertiesIfFileExists(String tmpDir, String propFileName) private ObjectcreateTestSet(TypeEncodedValue forkedTestSet, boolean readTestsFromCommandReader, ClassLoader cl) private voidexecute()private voidexit1()private voidNecessary for the Surefire817SystemExitIT.private static Stringprivate ScheduledThreadPoolExecutorprivate static Stringprivate static booleanprivate voidkill()private voidkill(int returnCode) private voidlaunchLastDitchDaemonShutdownThread(int returnCode) private ForkedBooter.PingSchedulerprivate static MasterProcessChannelProcessorFactorylookupDecoderFactory(String channelConfig) static voidThis 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 RunnableprocessCheckerJob(ForkedBooter.PingScheduler pingMechanism) private static voidrun(ForkedBooter booter, String[] args) created for testing purposes.private voidprivate voidsetupBooter(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
-