protoj.lang.internal.ant
Class JunitTask

java.lang.Object
  extended by protoj.lang.internal.ant.JunitTask

public final class JunitTask
extends java.lang.Object

A convenience class for running junit tests. Use the constructors to specify the minimal and most widely anticipated configuration and the initXXX methods for the less common configuration options.

Author:
Ashley Williams

Field Summary
static java.lang.String ERROR
           
 
Constructor Summary
JunitTask(java.io.File junitReportsDir, java.io.File javaDir, ArgRunnable<org.apache.tools.ant.types.Path> classpathConfig, java.lang.String maxMemory, java.lang.String includes, java.lang.String excludes)
          Accepts the information required for running junit tests.
 
Method Summary
 void captureError()
           
 void execute()
           
 java.lang.String getError()
           
 org.apache.tools.ant.taskdefs.optional.junit.JUnitTask getJunit()
           
 void initDebug(int port, boolean suspend)
          Invoke if debugging is required.
 void initJvmargs(java.util.List<java.lang.String> jvmargs)
          Invoke if any virtual machine arguments are required.
 void initJvmargs(java.lang.String... jvmargs)
          Invoke if any virtual machine arguments are required.
 void initLogging(java.io.File logFile)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERROR

public static final java.lang.String ERROR
See Also:
Constant Field Values
Constructor Detail

JunitTask

public JunitTask(java.io.File junitReportsDir,
                 java.io.File javaDir,
                 ArgRunnable<org.apache.tools.ant.types.Path> classpathConfig,
                 java.lang.String maxMemory,
                 java.lang.String includes,
                 java.lang.String excludes)
Accepts the information required for running junit tests.

Parameters:
junitReportsDir - the directory where the reports should be created
javaDir - the directory to search for junit tests
classpathConfig -
maxMemory - the maximum memory to be given to junit
includes - which tests to include, can be null
excludes - which tests to exclude, can be null
Method Detail

initDebug

public void initDebug(int port,
                      boolean suspend)
Invoke if debugging is required.

Parameters:
port - the port that will accept a debugger connection
suspend - whether or not the virtual machine will suspend until a debugger connection is made

initJvmargs

public void initJvmargs(java.lang.String... jvmargs)
Invoke if any virtual machine arguments are required.

Parameters:
jvmargs -

initJvmargs

public void initJvmargs(java.util.List<java.lang.String> jvmargs)
Invoke if any virtual machine arguments are required.

Parameters:
jvmargs -

captureError

public void captureError()

getError

public java.lang.String getError()

initLogging

public void initLogging(java.io.File logFile)

execute

public void execute()

getJunit

public org.apache.tools.ant.taskdefs.optional.junit.JUnitTask getJunit()