Package de.hybris.ant.taskdefs.yunit
Class JUnitTest
java.lang.Object
de.hybris.ant.taskdefs.yunit.BaseTest
de.hybris.ant.taskdefs.yunit.JUnitTest
- All Implemented Interfaces:
Cloneable
Run a single JUnit test.
The JUnit test is actually run by JUnitTestRunner. So read the doc comments for that class :)
- Since:
- Ant 1.2
- See Also:
-
Field Summary
Fields inherited from class de.hybris.ant.taskdefs.yunit.BaseTest
destDir, errorProperty, failureProperty, filtertrace, fork, formatters, haltOnError, haltOnFail, ifProperty, suppressJunitTenant, unlessProperty -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()longGet the number of errors.longGet the number of failures.Get the formatters set for this test.getName()Get the name of the test class.Get the name of the output fileGet the properties used in the test.longGet the run time.longrunCount()Get the number of runs.voidsetCounts(long runs, long failures, long errors) Set the number of runs, failures and errors.voidSet the name of the test class.voidsetOutfile(String value) Set the name of the output file.voidSet the properties to be used in the test.voidsetRunTime(long runTime) Set the runtime.voidsetWebClasspaths(String webClasspath) booleanshouldRun(org.apache.tools.ant.Project p) Check if this test should run based on the if and unless attributes.toString()Methods inherited from class de.hybris.ant.taskdefs.yunit.BaseTest
addFormatter, getErrorProperty, getFailureProperty, getFiltertrace, getFork, getHaltonerror, getHaltonfailure, getTodir, isSuppressJunitTenant, setErrorProperty, setFailureProperty, setFiltertrace, setFork, setHaltonerror, setHaltonfailure, setIf, setSuppressJunitTenant, setTodir, setUnless
-
Constructor Details
-
JUnitTest
public JUnitTest()No arg constructor. -
JUnitTest
Constructor with name.- Parameters:
name- the name of the test.
-
JUnitTest
Constructor with options.- Parameters:
name- the name of the test.haltOnError- if true halt the tests if there is an error.haltOnFailure- if true halt the tests if there is a failure.filtertrace- if true filter stack traces.
-
-
Method Details
-
getWebClasspath
-
setWebClasspaths
-
setName
Set the name of the test class.- Parameters:
value- the name to use.
-
setOutfile
Set the name of the output file.- Parameters:
value- the name of the output file to use.
-
getName
Get the name of the test class.- Returns:
- the name of the test.
-
getOutfile
Get the name of the output file- Returns:
- the name of the output file.
-
setCounts
public void setCounts(long runs, long failures, long errors) Set the number of runs, failures and errors.- Parameters:
runs- the number of runs.failures- the number of failures.errors- the number of errors.
-
setRunTime
public void setRunTime(long runTime) Set the runtime.- Parameters:
runTime- the time in milliseconds.
-
runCount
public long runCount()Get the number of runs.- Returns:
- the number of runs.
-
failureCount
public long failureCount()Get the number of failures.- Returns:
- the number of failures.
-
errorCount
public long errorCount()Get the number of errors.- Returns:
- the number of errors.
-
getRunTime
public long getRunTime()Get the run time.- Returns:
- the run time in milliseconds.
-
getProperties
Get the properties used in the test.- Returns:
- the properties.
-
setProperties
Set the properties to be used in the test.- Parameters:
p- the properties. This is a copy of the projects ant properties.
-
shouldRun
public boolean shouldRun(org.apache.tools.ant.Project p) Check if this test should run based on the if and unless attributes.- Parameters:
p- the project to use to check if the if and unless properties exist in.- Returns:
- true if this test or testsuite should be run.
-
getFormatters
Get the formatters set for this test.- Returns:
- the formatters as an array.
-
clone
-
toString
-