java.lang.Cloneable
public class JUnitLauncherTask extends Task
Task
responsible for launching the JUnit platform for running tests.
This requires a minimum of JUnit 5, since that's the version in which the JUnit platform launcher
APIs were introduced.
This task in itself doesn't run the JUnit tests, instead the sole responsibility of this task is to setup the JUnit platform launcher, build requests, launch those requests and then parse the result of the execution to present in a way that's been configured on this Ant task.
Furthermore, this task allows users control over which classes to select for passing on to the JUnit 5 platform for test execution. It however, is solely the JUnit 5 platform, backed by test engines that decide and execute the tests.
description, location, project
Constructor | Description |
---|---|
JUnitLauncherTask() |
Modifier and Type | Method | Description |
---|---|---|
void |
addConfiguredClassPath(Path path) |
Adds the
Path to the classpath which will be used for execution of the tests |
void |
addConfiguredListener(ListenerDefinition listener) |
Adds a
listener which will be enrolled for listening to test
execution events |
void |
addConfiguredTest(SingleTestClass test) |
Adds a
SingleTestClass that will be passed on to the underlying JUnit platform
for possible execution of the test |
void |
addConfiguredTestClasses(TestClasses testClasses) |
Adds
TestClasses that will be passed on to the underlying JUnit platform for
possible execution of the tests |
void |
execute() |
Called by the project to let the task do its work.
|
void |
setFailureProperty(java.lang.String failureProperty) |
|
void |
setHaltonfailure(boolean haltonfailure) |
|
void |
setPrintSummary(boolean printSummary) |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
public void execute() throws BuildException
Task
execute
in class Task
BuildException
- if something goes wrong with the build.public void addConfiguredClassPath(Path path)
Path
to the classpath which will be used for execution of the testspath
- The classpathpublic void addConfiguredTest(SingleTestClass test)
SingleTestClass
that will be passed on to the underlying JUnit platform
for possible execution of the testtest
- The testpublic void addConfiguredTestClasses(TestClasses testClasses)
TestClasses
that will be passed on to the underlying JUnit platform for
possible execution of the teststestClasses
- The test classespublic void addConfiguredListener(ListenerDefinition listener)
listener
which will be enrolled for listening to test
execution eventslistener
- The listenerpublic void setHaltonfailure(boolean haltonfailure)
public void setFailureProperty(java.lang.String failureProperty)
public void setPrintSummary(boolean printSummary)