Package org.apache.ant.antunit
Class AntUnitScriptRunner
- java.lang.Object
-
- org.apache.ant.antunit.AntUnitScriptRunner
-
public class AntUnitScriptRunner extends java.lang.Object
Run antunit tests suites. This AntUnitScriptRunner is responsible for the management of the ant project and the correct invocation the target (taking into account properly the [case]setUp and [case]tearDown targets). The user can however provide the order of the test targets and or can filter the list of test targets to execute. The user must also provide its ProjectFactory and an AntUnitExecutionNotifier.- Since:
- 1.2
-
-
Constructor Summary
Constructors Constructor Description AntUnitScriptRunner(ProjectFactory prjFactory)
Create a new AntScriptRunner on the given environment.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.tools.ant.Project
getCurrentProject()
Get the project currently in use.java.lang.String
getName()
Provides the name of the active script.java.util.List
getTestTartgets()
void
runSuite(java.util.List suiteTargets, AntUnitExecutionNotifier notifier)
Executes the suite.
-
-
-
Constructor Detail
-
AntUnitScriptRunner
public AntUnitScriptRunner(ProjectFactory prjFactory) throws org.apache.tools.ant.BuildException
Create a new AntScriptRunner on the given environment.- Parameters:
prjFactory
- A factory for the ant project that will contains the antunit test to execute. The factory might be invoked multiple time in order to provide test isolation.- Throws:
org.apache.tools.ant.BuildException
- The project can not be parsed
-
-
Method Detail
-
getCurrentProject
public final org.apache.tools.ant.Project getCurrentProject() throws org.apache.tools.ant.BuildException
Get the project currently in use. The caller is not allowed to invoke a target or do anything that would break the isolation of the test targets.- Returns:
- the current project
- Throws:
org.apache.tools.ant.BuildException
- The project can not be parsed
-
getTestTartgets
public java.util.List getTestTartgets()
- Returns:
- List<String> List of test targets of the script file
-
getName
public java.lang.String getName()
Provides the name of the active script.- Returns:
- name of the project
-
runSuite
public void runSuite(java.util.List suiteTargets, AntUnitExecutionNotifier notifier)
Executes the suite.- Parameters:
suiteTargets
- An ordered list of test targets. It must be a sublist of getTestTargetsnotifier
- is notified on test progress
-
-