public abstract class DefaultForkConfiguration extends ForkConfiguration
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
argLine |
private Classpath |
booterClasspath |
private boolean |
debug |
private java.lang.String |
debugLine |
private java.util.Map<java.lang.String,java.lang.String> |
environmentVariables |
private int |
forkCount |
private ConsoleLogger |
log |
private java.util.Properties |
modelProperties |
private Platform |
pluginPlatform |
private boolean |
reuseForks |
private java.io.File |
tempDirectory |
private java.io.File |
workingDirectory |
DEFAULT_PROVIDER_CLASS
Modifier | Constructor and Description |
---|---|
protected |
DefaultForkConfiguration(Classpath booterClasspath,
java.io.File tempDirectory,
java.lang.String debugLine,
java.io.File workingDirectory,
java.util.Properties modelProperties,
java.lang.String argLine,
java.util.Map<java.lang.String,java.lang.String> environmentVariables,
boolean debug,
int forkCount,
boolean reuseForks,
Platform pluginPlatform,
ConsoleLogger log) |
Modifier and Type | Method and Description |
---|---|
OutputStreamFlushableCommandline |
createCommandLine(StartupConfiguration config,
int forkNumber) |
protected java.lang.String |
extendJvmArgLine(java.lang.String jvmArgLine) |
private static java.lang.String |
findStartClass(StartupConfiguration config) |
protected java.lang.String |
getArgLine() |
protected Classpath |
getBooterClasspath() |
protected java.lang.String |
getDebugLine() |
protected java.util.Map<java.lang.String,java.lang.String> |
getEnvironmentVariables() |
protected int |
getForkCount() |
protected JdkAttributes |
getJdkForTests() |
protected java.util.Properties |
getModelProperties() |
protected Platform |
getPluginPlatform() |
java.io.File |
getTempDirectory() |
protected java.io.File |
getWorkingDirectory() |
private java.io.File |
getWorkingDirectory(int forkNumber) |
private java.lang.String |
interpolateArgLineWithPropertyExpressions()
Replaces expressions
|
protected boolean |
isDebug() |
protected boolean |
isReuseForks() |
private java.lang.String |
newJvmArgLine(int forks) |
private static java.lang.String |
replaceThreadNumberPlaceholder(java.lang.String argLine,
int threadNumber) |
protected abstract void |
resolveClasspath(OutputStreamFlushableCommandline cli,
java.lang.String booterThatHasMainMethod,
StartupConfiguration config) |
private static java.lang.String |
stripNewLines(java.lang.String argLine) |
protected java.util.List<java.lang.String> |
toCompleteClasspath(StartupConfiguration conf) |
private static <K,V> java.util.Map<K,V> |
toImmutable(java.util.Map<K,V> map)
Immutable map.
|
@Nonnull private final Classpath booterClasspath
@Nonnull private final java.io.File tempDirectory
@Nullable private final java.lang.String debugLine
@Nonnull private final java.io.File workingDirectory
@Nonnull private final java.util.Properties modelProperties
@Nullable private final java.lang.String argLine
@Nonnull private final java.util.Map<java.lang.String,java.lang.String> environmentVariables
private final boolean debug
private final int forkCount
private final boolean reuseForks
@Nonnull private final Platform pluginPlatform
@Nonnull private final ConsoleLogger log
protected DefaultForkConfiguration(@Nonnull Classpath booterClasspath, @Nonnull java.io.File tempDirectory, @Nullable java.lang.String debugLine, @Nonnull java.io.File workingDirectory, @Nonnull java.util.Properties modelProperties, @Nullable java.lang.String argLine, @Nonnull java.util.Map<java.lang.String,java.lang.String> environmentVariables, boolean debug, int forkCount, boolean reuseForks, @Nonnull Platform pluginPlatform, @Nonnull ConsoleLogger log)
protected abstract void resolveClasspath(@Nonnull OutputStreamFlushableCommandline cli, @Nonnull java.lang.String booterThatHasMainMethod, @Nonnull StartupConfiguration config) throws SurefireBooterForkException
SurefireBooterForkException
@Nonnull protected java.lang.String extendJvmArgLine(@Nonnull java.lang.String jvmArgLine)
@Nonnull public OutputStreamFlushableCommandline createCommandLine(@Nonnull StartupConfiguration config, int forkNumber) throws SurefireBooterForkException
createCommandLine
in class ForkConfiguration
config
- The startup configurationforkNumber
- index of forked JVM, to be the replacement in the argLineSurefireBooterForkException
- when unable to perform the fork@Nonnull protected java.util.List<java.lang.String> toCompleteClasspath(StartupConfiguration conf) throws SurefireBooterForkException
SurefireBooterForkException
@Nonnull private java.io.File getWorkingDirectory(int forkNumber) throws SurefireBooterForkException
SurefireBooterForkException
@Nonnull private static java.lang.String replaceThreadNumberPlaceholder(@Nonnull java.lang.String argLine, int threadNumber)
@Nonnull private java.lang.String interpolateArgLineWithPropertyExpressions()
@{property-name}with the corresponding properties from the model. This allows late evaluation of property values when the plugin is executed (as compared to evaluation when the pom is parsed as is done with
${property-name}expressions). This allows other plugins to modify or set properties with the changes getting picked up by surefire.
@Nonnull private static java.lang.String stripNewLines(@Nonnull java.lang.String argLine)
@Nonnull private static <K,V> java.util.Map<K,V> toImmutable(@Nullable java.util.Map<K,V> map)
K
- key typeV
- value typemap
- immutable map copies elements from map
@Nonnull public java.io.File getTempDirectory()
getTempDirectory
in class ForkConfiguration
@Nullable protected java.lang.String getDebugLine()
getDebugLine
in class ForkConfiguration
@Nonnull protected java.io.File getWorkingDirectory()
getWorkingDirectory
in class ForkConfiguration
@Nonnull protected java.util.Properties getModelProperties()
getModelProperties
in class ForkConfiguration
@Nullable protected java.lang.String getArgLine()
getArgLine
in class ForkConfiguration
@Nonnull protected java.util.Map<java.lang.String,java.lang.String> getEnvironmentVariables()
getEnvironmentVariables
in class ForkConfiguration
protected boolean isDebug()
isDebug
in class ForkConfiguration
protected int getForkCount()
getForkCount
in class ForkConfiguration
protected boolean isReuseForks()
isReuseForks
in class ForkConfiguration
@Nonnull protected Platform getPluginPlatform()
getPluginPlatform
in class ForkConfiguration
@Nonnull protected JdkAttributes getJdkForTests()
getJdkForTests
in class ForkConfiguration
@Nonnull protected Classpath getBooterClasspath()
getBooterClasspath
in class ForkConfiguration
@Nonnull private java.lang.String newJvmArgLine(int forks)
@Nonnull private static java.lang.String findStartClass(StartupConfiguration config)