org.apache.maven.plugin.surefire.booterclient
Class ForkConfiguration

java.lang.Object
  extended by org.apache.maven.plugin.surefire.booterclient.ForkConfiguration

public class ForkConfiguration
extends Object

Configuration for forking tests.

Author:
Brett Porter, Kenney Westerhof, Kristian Rosenvold

Field Summary
static String FORK_ALWAYS
           
static String FORK_NEVER
           
static String FORK_ONCE
           
static String FORK_PERTHREAD
           
 
Constructor Summary
ForkConfiguration(Classpath bootClasspathConfiguration, File tmpDir, String debugLine, String jvmExecutable, File workingDirectory, String argLine, Map<String,String> environmentVariables, boolean debugEnabled, int forkCount, boolean reuseForks)
           
 
Method Summary
 OutputStreamFlushableCommandline createCommandLine(List<String> classPath, boolean useJar, boolean shadefire, int threadNumber)
           
 OutputStreamFlushableCommandline createCommandLine(List<String> classPath, ClassLoaderConfiguration classpathConfiguration, boolean shadefire, int threadNumber)
           
 File createJar(List<String> classPath)
          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()
           
 String getDebugLine()
           
static String getEffectiveForkMode(String forkMode)
           
 int getForkCount()
           
 File getTempDirectory()
           
 boolean isDebug()
           
 boolean isReuseForks()
           
 String stripNewLines(String argline)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FORK_ONCE

public static final String FORK_ONCE
See Also:
Constant Field Values

FORK_ALWAYS

public static final String FORK_ALWAYS
See Also:
Constant Field Values

FORK_NEVER

public static final String FORK_NEVER
See Also:
Constant Field Values

FORK_PERTHREAD

public static final String FORK_PERTHREAD
See Also:
Constant Field Values
Constructor Detail

ForkConfiguration

public ForkConfiguration(Classpath bootClasspathConfiguration,
                         File tmpDir,
                         String debugLine,
                         String jvmExecutable,
                         File workingDirectory,
                         String argLine,
                         Map<String,String> environmentVariables,
                         boolean debugEnabled,
                         int forkCount,
                         boolean reuseForks)
Method Detail

getBootClasspath

public Classpath getBootClasspath()

getEffectiveForkMode

public static String getEffectiveForkMode(String forkMode)

createCommandLine

public OutputStreamFlushableCommandline createCommandLine(List<String> classPath,
                                                          ClassLoaderConfiguration classpathConfiguration,
                                                          boolean shadefire,
                                                          int threadNumber)
                                                   throws SurefireBooterForkException
Parameters:
classPath - cla the classpath arguments
classpathConfiguration - the classpath configuration
shadefire - true if running shadefire
threadNumber - the thread number, to be the replacement in the argLine
Returns:
A commandline
Throws:
SurefireBooterForkException - when unable to perform the fork

createCommandLine

public OutputStreamFlushableCommandline createCommandLine(List<String> classPath,
                                                          boolean useJar,
                                                          boolean shadefire,
                                                          int threadNumber)
                                                   throws SurefireBooterForkException
Throws:
SurefireBooterForkException

createJar

public File createJar(List<String> classPath)
               throws IOException
Create a jar with just a manifest containing a Main-Class entry for BooterConfiguration and a Class-Path entry for all classpath elements.

Parameters:
classPath - List<String> of all classpath elements.
Returns:
The file pointint to the jar
Throws:
IOException - When a file operation fails.

isDebug

public boolean isDebug()

stripNewLines

public String stripNewLines(String argline)

getDebugLine

public String getDebugLine()

getTempDirectory

public File getTempDirectory()

getForkCount

public int getForkCount()

isReuseForks

public boolean isReuseForks()


Copyright © 2004-2013 The Apache Software Foundation. All Rights Reserved.