public class AntUnitSuite
extends junit.framework.TestSuite
Constructor and Description |
---|
AntUnitSuite(File scriptFile,
Class rootClass)
Create a JUnit TestSuite that when executed will run the given ant
script.
|
Modifier and Type | Method and Description |
---|---|
org.apache.tools.ant.BuildException |
getAntInitialisationException() |
boolean |
hasAntInitError() |
void |
run(junit.framework.TestResult testResult) |
void |
runInContainer(List targetList,
AntUnitExecutionNotifier notifier)
Execute the test suite in a 'container' similar to the ant 'container'.
|
void |
runTest(junit.framework.Test test,
junit.framework.TestResult result) |
public AntUnitSuite(File scriptFile, Class rootClass)
Note that it is the responsibility of the caller to give the correct File reference. Namely, if the File is a relative file, it will be resolve relatively to the execution directory (which might be different different from the project root directory).
scriptFile
- AntUnit script filerootClass
- The test class that creates this suite. This is used to give
a name to the suite so that an IDE can reexecute this suite.public void run(junit.framework.TestResult testResult)
Run the full AntUnit suite.
run
in interface junit.framework.Test
run
in class junit.framework.TestSuite
public void runTest(junit.framework.Test test, junit.framework.TestResult result)
Run a single test target of the AntUnit suite. suiteSetUp, setUp, tearDown and suiteTearDown are executed around it.
runTest
in class junit.framework.TestSuite
public void runInContainer(List targetList, AntUnitExecutionNotifier notifier)
When ant executes a project it redirect the input and the output. In this context we will only redirect output (unit test are not supposed to be interactive).
targetList
- The list of test target to executenotifier
- The AntUnit notifier that will receive execution notificationspublic boolean hasAntInitError()
public org.apache.tools.ant.BuildException getAntInitialisationException()
Copyright © 2022 The Apache Software Foundation. All rights reserved.