in surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java [103:158]
private void setupBooter(
String tmpDir, String dumpFileName, String surefirePropsFileName, String effectiveSystemPropertiesFileName)
throws IOException {
BooterDeserializer booterDeserializer =
new BooterDeserializer(createSurefirePropertiesIfFileExists(tmpDir, surefirePropsFileName));
setSystemProperties(new File(tmpDir, effectiveSystemPropertiesFileName));
providerConfiguration = booterDeserializer.deserialize();
DumpErrorSingleton.getSingleton()
.init(providerConfiguration.getReporterConfiguration().getReportsDirectory(), dumpFileName);
int forkNumber = booterDeserializer.getForkNumber();
if (isDebugging()) {
DumpErrorSingleton.getSingleton()
.dumpText("Found Maven process ID " + booterDeserializer.getPluginPid() + " for the fork "
+ forkNumber + ".");
}
startupConfiguration = booterDeserializer.getStartupConfiguration();
String channelConfig = booterDeserializer.getConnectionString();
channelProcessorFactory = lookupDecoderFactory(channelConfig);
channelProcessorFactory.connect(channelConfig);
boolean isDebugging = isDebugging();
boolean debug = isDebugging || providerConfiguration.getMainCliOptions().contains(LOGGING_LEVEL_DEBUG);
ForkNodeArguments args = new ForkedNodeArg(forkNumber, debug);
eventChannel = channelProcessorFactory.createEncoder(args);
MasterProcessChannelDecoder decoder = channelProcessorFactory.createDecoder(args);
flushEventChannelOnExit();
forkingReporterFactory = createForkingReporterFactory();
logger = forkingReporterFactory.createTestReportListener();
commandReader = new CommandReader(decoder, providerConfiguration.getShutdown(), logger);
pingScheduler = isDebugging ? null : listenToShutdownCommands(booterDeserializer.getPluginPid());
systemExitTimeoutInSeconds = providerConfiguration.systemExitTimeout(DEFAULT_SYSTEM_EXIT_TIMEOUT_IN_SECONDS);
AbstractPathConfiguration classpathConfiguration = startupConfiguration.getClasspathConfiguration();
if (classpathConfiguration.isClassPathConfig()) {
if (startupConfiguration.isManifestOnlyJarRequestedAndUsable()) {
classpathConfiguration
.toRealPath(ClasspathConfiguration.class)
.trickClassPathWhenManifestOnlyClasspath();
}
startupConfiguration.writeSurefireTestClasspathProperty();
}
ClassLoader classLoader = currentThread().getContextClassLoader();
classLoader.setDefaultAssertionStatus(classpathConfiguration.isEnableAssertions());
boolean readTestsFromCommandReader = providerConfiguration.isReadTestsFromInStream();
testSet = createTestSet(providerConfiguration.getTestForFork(), readTestsFromCommandReader, classLoader);
}