net.sourceforge.basher.booter
Class BasherBooter

java.lang.Object
  extended by net.sourceforge.basher.booter.BasherBooter

public class BasherBooter
extends java.lang.Object

Helper class to help boot Basher in a clean JVM. The original functionality of this plugin was copied from the Maven SureFire plugin.

Author:
Johan Lindquist

Field Summary
static int BASHER_FAILED_EXIT_CODE
           
static int BASHER_SUCCEEDED_EXIT_CODE
           
static int NO_TASKS_EXIT_CODE
           
 
Constructor Summary
BasherBooter()
           
 
Method Summary
 void addBasherBootClassPathUrl(java.lang.String path)
           
 void addBasherClassPathUrl(java.lang.String path)
           
 void addClassPathUrl(java.lang.String path)
           
 void addReport(java.lang.String report)
           
 void addReport(java.lang.String report, java.lang.Object[] constructorParams)
           
 java.io.File getReportsDirectory()
          Get the directory where reports will be saved
 boolean isForking()
           
static void main(java.lang.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()
          Executes the Basher run.
 void serializeBasherContexts(java.util.Properties properties)
           
 void setActiveBasherContext(java.lang.String activeBasherContext)
           
 void setBasherContexts(java.util.List<net.sourceforge.basher.BasherContext> basherContexts)
           
 void setEnableAssertions(boolean enableAssertions)
           
 void setFailIfNoTasks(boolean failIfNoTasks)
          Setting this to true will cause a failure if there are no tasks to run
 void setForkConfiguration(BasherForkConfiguration forkConfiguration)
          Sets the forking configuration to use.
 void setForkedProcessTimeoutInSeconds(int forkedProcessTimeoutInSeconds)
           
 void setRedirectTasksOutputToFile(boolean redirectTasksOutputToFile)
          When forking, setting this to true will make the task output to be saved in a file instead of showing it on the standard output
 void setReportsDirectory(java.io.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

BASHER_SUCCEEDED_EXIT_CODE

public static final int BASHER_SUCCEEDED_EXIT_CODE
See Also:
Constant Field Values

BASHER_FAILED_EXIT_CODE

public static final int BASHER_FAILED_EXIT_CODE
See Also:
Constant Field Values

NO_TASKS_EXIT_CODE

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

BasherBooter

public BasherBooter()
Method Detail

run

public int run()
        throws org.apache.maven.surefire.booter.SurefireBooterForkException,
               org.apache.maven.surefire.booter.SurefireExecutionException
Executes the Basher run.

Returns:
0 if successful, otherwise non-zero.
Throws:
org.apache.maven.surefire.booter.SurefireBooterForkException
org.apache.maven.surefire.booter.SurefireExecutionException

serializeBasherContexts

public void serializeBasherContexts(java.util.Properties properties)

main

public static void main(java.lang.String[] args)
                 throws java.lang.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:
java.lang.Throwable

addReport

public void addReport(java.lang.String report)

addReport

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

addClassPathUrl

public void addClassPathUrl(java.lang.String path)

addBasherClassPathUrl

public void addBasherClassPathUrl(java.lang.String path)

addBasherBootClassPathUrl

public void addBasherBootClassPathUrl(java.lang.String path)

setFailIfNoTasks

public void setFailIfNoTasks(boolean failIfNoTasks)
Setting this to true will cause a failure if there are no tasks to run

Parameters:
failIfNoTasks - If true and no tasks are found, Basher will fail

setRedirectTasksOutputToFile

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

Parameters:
redirectTasksOutputToFile - If true, any output will be redirected to a file

setReportsDirectory

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

Parameters:
reportsDirectory - The directory where reports will be saved

getReportsDirectory

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

Returns:
The file representing the directory where files are saved

setForkConfiguration

public void setForkConfiguration(BasherForkConfiguration forkConfiguration)
Sets the forking configuration to use.

Parameters:
forkConfiguration - The fork configuration

setEnableAssertions

public void setEnableAssertions(boolean enableAssertions)

setForkedProcessTimeoutInSeconds

public void setForkedProcessTimeoutInSeconds(int forkedProcessTimeoutInSeconds)

setBasherContexts

public void setBasherContexts(java.util.List<net.sourceforge.basher.BasherContext> basherContexts)

setActiveBasherContext

public void setActiveBasherContext(java.lang.String activeBasherContext)

isForking

public boolean isForking()


Copyright © 2008-2010 Basher Team. All Rights Reserved.