public class ForkConfiguration
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
argLine |
private Classpath |
bootClasspathConfiguration |
private boolean |
debug |
private java.lang.String |
debugLine |
private java.util.Map<java.lang.String,java.lang.String> |
environmentVariables |
static java.lang.String |
FORK_ALWAYS |
static java.lang.String |
FORK_NEVER |
static java.lang.String |
FORK_ONCE |
static java.lang.String |
FORK_PERTHREAD |
private int |
forkCount |
private JdkAttributes |
jdk |
private java.util.Properties |
modelProperties |
private Platform |
pluginPlatform |
private boolean |
reuseForks |
private java.io.File |
tempDirectory |
private java.io.File |
workingDirectory |
| Constructor and Description |
|---|
ForkConfiguration(Classpath bootClasspathConfiguration,
java.io.File tmpDir,
java.lang.String debugLine,
JdkAttributes jdk,
java.io.File workingDirectory,
java.util.Properties modelProperties,
java.lang.String argLine,
java.util.Map<java.lang.String,java.lang.String> environmentVariables,
boolean debugEnabled,
int forkCount,
boolean reuseForks,
Platform pluginPlatform) |
| Modifier and Type | Method and Description |
|---|---|
(package private) OutputStreamFlushableCommandline |
createCommandLine(java.util.List<java.lang.String> classPath,
boolean useJar,
boolean shadefire,
java.lang.String providerThatHasMainMethod,
int threadNumber) |
OutputStreamFlushableCommandline |
createCommandLine(java.util.List<java.lang.String> classPath,
StartupConfiguration config,
int threadNumber) |
private java.io.File |
createJar(java.util.List<java.lang.String> classPath,
java.lang.String startClassName)
Create a jar with just a manifest containing a Main-Class entry for BooterConfiguration and a Class-Path entry
for all classpath elements.
|
Classpath |
getBootClasspath() |
java.lang.String |
getDebugLine() |
static java.lang.String |
getEffectiveForkMode(java.lang.String forkMode) |
int |
getForkCount() |
Platform |
getPluginPlatform() |
java.io.File |
getTempDirectory() |
private java.io.File |
getWorkingDirectory(int threadNumber) |
boolean |
isDebug() |
boolean |
isReuseForks() |
private java.lang.String |
replacePropertyExpressions()
Replaces expressions
|
private java.lang.String |
replaceThreadNumberPlaceholder(java.lang.String argLine,
int threadNumber) |
private static java.lang.String |
stripNewLines(java.lang.String argLine) |
private static <K,V> java.util.Map<K,V> |
toImmutable(java.util.Map<K,V> map)
Immutable map.
|
public static final java.lang.String FORK_ONCE
public static final java.lang.String FORK_ALWAYS
public static final java.lang.String FORK_NEVER
public static final java.lang.String FORK_PERTHREAD
private final int forkCount
private final boolean reuseForks
private final Classpath bootClasspathConfiguration
private final JdkAttributes jdk
private final java.util.Properties modelProperties
private final java.lang.String argLine
private final java.util.Map<java.lang.String,java.lang.String> environmentVariables
private final java.io.File workingDirectory
private final java.io.File tempDirectory
private final boolean debug
private final java.lang.String debugLine
private final Platform pluginPlatform
public ForkConfiguration(Classpath bootClasspathConfiguration, java.io.File tmpDir, java.lang.String debugLine, JdkAttributes jdk, java.io.File workingDirectory, java.util.Properties modelProperties, java.lang.String argLine, java.util.Map<java.lang.String,java.lang.String> environmentVariables, boolean debugEnabled, int forkCount, boolean reuseForks, Platform pluginPlatform)
public Classpath getBootClasspath()
public static java.lang.String getEffectiveForkMode(java.lang.String forkMode)
public OutputStreamFlushableCommandline createCommandLine(java.util.List<java.lang.String> classPath, StartupConfiguration config, int threadNumber) throws SurefireBooterForkException
classPath - cli the classpath argumentsconfig - The startup configurationthreadNumber - the thread number, to be the replacement in the argLine @return A commandlineSurefireBooterForkException - when unable to perform the forkOutputStreamFlushableCommandline createCommandLine(java.util.List<java.lang.String> classPath, boolean useJar, boolean shadefire, java.lang.String providerThatHasMainMethod, int threadNumber) throws SurefireBooterForkException
SurefireBooterForkExceptionprivate java.io.File getWorkingDirectory(int threadNumber)
throws SurefireBooterForkException
SurefireBooterForkExceptionprivate java.lang.String replaceThreadNumberPlaceholder(java.lang.String argLine,
int threadNumber)
private java.lang.String replacePropertyExpressions()
@{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.private java.io.File createJar(java.util.List<java.lang.String> classPath,
java.lang.String startClassName)
throws java.io.IOException
classPath - List<String> of all classpath elements.startClassName - The classname to start (main-class)java.io.IOException - When a file operation fails.public boolean isDebug()
public java.lang.String getDebugLine()
public java.io.File getTempDirectory()
public int getForkCount()
public boolean isReuseForks()
public Platform getPluginPlatform()
private static java.lang.String stripNewLines(java.lang.String argLine)
private static <K,V> java.util.Map<K,V> toImmutable(java.util.Map<K,V> map)
K - key typeV - value typemap - immutable map copies elements from map