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 java.lang.String |
jvmExecutable |
private java.util.Properties |
modelProperties |
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,
java.lang.String jvmExecutable,
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) |
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 startupConfiguration,
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() |
java.io.File |
getTempDirectory() |
private java.io.File |
getWorkingDirectory(int threadNumber) |
boolean |
isDebug() |
boolean |
isReuseForks() |
private java.lang.String |
replacePropertyExpressions(java.lang.String argLine)
Replaces expressions
|
private java.lang.String |
replaceThreadNumberPlaceholder(java.lang.String argLine,
int threadNumber) |
java.lang.String |
stripNewLines(java.lang.String argline) |
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 java.lang.String jvmExecutable
private 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
public ForkConfiguration(Classpath bootClasspathConfiguration, java.io.File tmpDir, java.lang.String debugLine, java.lang.String jvmExecutable, 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)
public Classpath getBootClasspath()
public static java.lang.String getEffectiveForkMode(java.lang.String forkMode)
public OutputStreamFlushableCommandline createCommandLine(java.util.List<java.lang.String> classPath, StartupConfiguration startupConfiguration, int threadNumber) throws SurefireBooterForkException
classPath
- cla the classpath argumentsstartupConfiguration
- 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
SurefireBooterForkException
private java.io.File getWorkingDirectory(int threadNumber) throws SurefireBooterForkException
SurefireBooterForkException
private java.lang.String replaceThreadNumberPlaceholder(java.lang.String argLine, int threadNumber)
private java.lang.String replacePropertyExpressions(java.lang.String argLine)
@{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 stripNewLines(java.lang.String argline)
public java.lang.String getDebugLine()
public java.io.File getTempDirectory()
public int getForkCount()
public boolean isReuseForks()