org.apache.maven.surefire.booter
Class SurefireBooter

java.lang.Object
  extended by org.apache.maven.surefire.booter.SurefireBooter

public class SurefireBooter
extends Object

Version:
$Id: SurefireBooter.java 980568 2010-07-29 20:56:29Z krosenvold $
Author:
Jason van Zyl, Emmanuel Venisse

Field Summary
static int NO_TESTS_EXIT_CODE
           
static int TESTS_FAILED_EXIT_CODE
           
static int TESTS_SUCCEEDED_EXIT_CODE
           
 
Constructor Summary
SurefireBooter()
           
 
Method Summary
 void addClassPathUrl(String path)
           
 void addReport(String report)
           
 void addReport(String report, Object[] constructorParams)
           
 void addSurefireBootClassPathUrl(String path)
           
 void addSurefireClassPathUrl(String path)
           
 void addTestSuite(String suiteClassName, Object[] constructorParams)
           
 File getReportsDirectory()
          Get the directory where reports will be saved
 boolean isForking()
           
static void main(String[] args)
          This method is invoked when Surefire is forked - this method parses and organizes the arguments passed to it and then calls the Surefire class' run method.
 int run()
           
 void setChildDelegation(boolean childDelegation)
           
 void setEnableAssertions(boolean enableAssertions)
           
 void setFailIfNoTests(boolean failIfNoTests)
          Setting this to true will cause a failure if there are no tests to run
 void setForkConfiguration(ForkConfiguration forkConfiguration)
           
 void setForkedProcessTimeoutInSeconds(int forkedProcessTimeoutInSeconds)
           
 void setRedirectTestOutputToFile(boolean redirectTestOutputToFile)
          When forking, setting this to true will make the test output to be saved in a file instead of showing it on the standard output
 void setReportsDirectory(File reportsDirectory)
          Set the directory where reports will be saved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TESTS_SUCCEEDED_EXIT_CODE

public static final int TESTS_SUCCEEDED_EXIT_CODE
See Also:
Constant Field Values

TESTS_FAILED_EXIT_CODE

public static final int TESTS_FAILED_EXIT_CODE
See Also:
Constant Field Values

NO_TESTS_EXIT_CODE

public static final int NO_TESTS_EXIT_CODE
See Also:
Constant Field Values
Constructor Detail

SurefireBooter

public SurefireBooter()
Method Detail

addReport

public void addReport(String report)

addReport

public void addReport(String report,
                      Object[] constructorParams)

addTestSuite

public void addTestSuite(String suiteClassName,
                         Object[] constructorParams)

addClassPathUrl

public void addClassPathUrl(String path)

addSurefireClassPathUrl

public void addSurefireClassPathUrl(String path)

addSurefireBootClassPathUrl

public void addSurefireBootClassPathUrl(String path)

setFailIfNoTests

public void setFailIfNoTests(boolean failIfNoTests)
Setting this to true will cause a failure if there are no tests to run

Parameters:
redirectTestOutputToFile -

setRedirectTestOutputToFile

public void setRedirectTestOutputToFile(boolean redirectTestOutputToFile)
When forking, setting this to true will make the test output to be saved in a file instead of showing it on the standard output

Parameters:
redirectTestOutputToFile -

setReportsDirectory

public void setReportsDirectory(File reportsDirectory)
Set the directory where reports will be saved

Parameters:
reportsDirectory - the directory

getReportsDirectory

public File getReportsDirectory()
Get the directory where reports will be saved


setForkConfiguration

public void setForkConfiguration(ForkConfiguration forkConfiguration)

isForking

public boolean isForking()

run

public int run()
        throws SurefireBooterForkException,
               SurefireExecutionException
Throws:
SurefireBooterForkException
SurefireExecutionException

main

public static void main(String[] args)
                 throws Throwable
This method is invoked when Surefire is forked - this method parses and organizes the arguments passed to it and then calls the Surefire class' run method.

The system exit code will be 1 if an exception is thrown.

Parameters:
args -
Throws:
Throwable

setChildDelegation

public void setChildDelegation(boolean childDelegation)

setEnableAssertions

public void setEnableAssertions(boolean enableAssertions)

setForkedProcessTimeoutInSeconds

public void setForkedProcessTimeoutInSeconds(int forkedProcessTimeoutInSeconds)


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