org.apache.tools.ant.taskdefs.optional.junit
Class JUnitTask
java.lang.Object
|
+--org.apache.tools.ant.Task
|
+--org.apache.tools.ant.taskdefs.optional.junit.JUnitTask
- public class JUnitTask
- extends Task
Ant task to run JUnit tests.
JUnit is a framework to create unit test. It has been initially
created by Erich Gamma and Kent Beck. JUnit can be found at http://www.junit.org.
To spawn a new Java VM to prevent interferences between
different testcases, you need to enable fork
.
- Author:
- Thomas Haas, Stefan Bodewig
Constructor Summary |
JUnitTask()
Creates a new JUnitRunner and enables fork of a new Java VM. |
Methods inherited from class org.apache.tools.ant.Task |
getDescription, getLocation, getOwningTarget, getProject, getRuntimeConfigurableWrapper, getTaskName, init, log, log, maybeConfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JUnitTask
public JUnitTask()
throws java.lang.Exception
- Creates a new JUnitRunner and enables fork of a new Java VM.
setHaltonerror
public void setHaltonerror(boolean value)
setHaltonfailure
public void setHaltonfailure(boolean value)
setPrintsummary
public void setPrintsummary(boolean value)
setMaxmemory
public void setMaxmemory(java.lang.String max)
setTimeout
public void setTimeout(java.lang.Integer value)
setFork
public void setFork(boolean value)
setJvm
public void setJvm(java.lang.String value)
createJvmarg
public Commandline.Argument createJvmarg()
createClasspath
public Path createClasspath()
addTest
public void addTest(JUnitTest test)
createBatchTest
public BatchTest createBatchTest()
addFormatter
public void addFormatter(FormatterElement fe)
setDir
public void setDir(java.io.File dir)
- The directory to invoke the VM in.
Ignored if fork=false.
execute
public void execute()
throws BuildException
- Runs the testcase.
- Overrides:
execute
in class Task
- Following copied from class:
org.apache.tools.ant.Task
- Throws:
BuildException
- if someting goes wrong with the build
createWatchdog
protected ExecuteWatchdog createWatchdog()
throws BuildException
allTests
protected java.util.Enumeration allTests()
Copyright © 2000 Apache Software Foundation. All Rights Reserved.