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
           
 
Constructor Summary
ForkConfiguration(Classpath bootClasspathConfiguration, String forkMode, File tmpDir)
           
 
Method Summary
 Commandline createCommandLine(List classPath, boolean useJar, boolean shadefire)
           
 Commandline createCommandLine(List classPath, ClassLoaderConfiguration classpathConfiguration, boolean shadefire)
           
 File createJar(List 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()
           
 String getForkMode()
           
 Properties getSystemProperties()
           
 File getTempDirectory()
           
 boolean isDebug()
           
 boolean isForking()
           
 void setArgLine(String argLine)
           
 void setDebug(boolean debug)
           
 void setDebugLine(String debugLine)
           
 void setEnvironmentVariables(Map environmentVariables)
           
 void setJvmExecutable(String jvmExecutable)
           
 void setSystemProperties(Properties systemProperties)
           
 void setTempDirectory(File tempDirectory)
           
 void setWorkingDirectory(File workingDirectory)
           
 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
Constructor Detail

ForkConfiguration

public ForkConfiguration(Classpath bootClasspathConfiguration,
                         String forkMode,
                         File tmpDir)
Method Detail

getBootClasspath

public Classpath getBootClasspath()

isForking

public boolean isForking()

setSystemProperties

public void setSystemProperties(Properties systemProperties)

setJvmExecutable

public void setJvmExecutable(String jvmExecutable)

setArgLine

public void setArgLine(String argLine)

setDebugLine

public void setDebugLine(String debugLine)

setEnvironmentVariables

public void setEnvironmentVariables(Map environmentVariables)

setWorkingDirectory

public void setWorkingDirectory(File workingDirectory)

setTempDirectory

public void setTempDirectory(File tempDirectory)

getForkMode

public String getForkMode()

getSystemProperties

public Properties getSystemProperties()

createCommandLine

public Commandline createCommandLine(List classPath,
                                     ClassLoaderConfiguration classpathConfiguration,
                                     boolean shadefire)
                              throws SurefireBooterForkException
Parameters:
classPath - cla the classpath arguments
classpathConfiguration - the classpath configuration
shadefire - true if running shadefire
Returns:
A commandline
Throws:
SurefireBooterForkException - when unable to perform the fork

createCommandLine

public Commandline createCommandLine(List classPath,
                                     boolean useJar,
                                     boolean shadefire)
                              throws SurefireBooterForkException
Throws:
SurefireBooterForkException

createJar

public File createJar(List 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.

setDebug

public void setDebug(boolean debug)

isDebug

public boolean isDebug()

stripNewLines

public String stripNewLines(String argline)

getDebugLine

public String getDebugLine()

getTempDirectory

public File getTempDirectory()


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