|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tools.ant.taskdefs.optional.junit.FormatterElement
A wrapper for the implementations of JUnitResultFormatter
.
In particular, used as a nested <formatter>
element in
a <junit>
task.
For example,
adds a
<junit printsummary="no" haltonfailure="yes" fork="false">
<formatter type="plain" usefile="false" />
<test name="org.apache.ecs.InternationalCharTest" />
</junit>
plain
type implementation
(PlainJUnitResultFormatter
) to display the results of the test.
Either the type
or the classname
attribute
must be set.
JUnitTask
,
XMLJUnitResultFormatter
,
BriefJUnitResultFormatter
,
PlainJUnitResultFormatter
,
JUnitResultFormatter
Nested Class Summary | |
static class |
FormatterElement.TypeAttribute
Enumerated attribute with the values "plain", "xml" and "brief". |
Field Summary | |
static java.lang.String |
BRIEF_FORMATTER_CLASS_NAME
|
static java.lang.String |
PLAIN_FORMATTER_CLASS_NAME
|
static java.lang.String |
XML_FORMATTER_CLASS_NAME
|
Constructor Summary | |
FormatterElement()
|
Method Summary | |
java.lang.String |
getClassname()
Get name of class to be used as the formatter. |
java.lang.String |
getExtension()
|
void |
setClassname(java.lang.String classname)
Set name of class to be used as the formatter. |
void |
setExtension(java.lang.String ext)
|
void |
setIf(java.lang.String ifProperty)
Set whether this formatter should be used. |
void |
setOutput(java.io.OutputStream out)
Set output stream for formatter to use. |
void |
setType(FormatterElement.TypeAttribute type)
Quick way to use a standard formatter. |
void |
setUnless(java.lang.String unlessProperty)
Set whether this formatter should NOT be used. |
void |
setUseFile(boolean useFile)
Set whether the formatter should log to file. |
boolean |
shouldUse(Task t)
Ensures that the selector passes the conditions placed on it with if and unless properties. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String XML_FORMATTER_CLASS_NAME
public static final java.lang.String BRIEF_FORMATTER_CLASS_NAME
public static final java.lang.String PLAIN_FORMATTER_CLASS_NAME
Constructor Detail |
public FormatterElement()
Method Detail |
public void setType(FormatterElement.TypeAttribute type)
Quick way to use a standard formatter.
At the moment, there are three supported standard formatters.
xml
type uses a XMLJUnitResultFormatter
.
brief
type uses a BriefJUnitResultFormatter
.
plain
type (the default) uses a PlainJUnitResultFormatter
.
Sets classname
attribute - so you can't use that
attribute if you use this one.
public void setClassname(java.lang.String classname)
Set name of class to be used as the formatter.
This class must implement JUnitResultFormatter
public java.lang.String getClassname()
public void setExtension(java.lang.String ext)
public java.lang.String getExtension()
public void setOutput(java.io.OutputStream out)
Set output stream for formatter to use.
Defaults to standard out.
public void setUseFile(boolean useFile)
public void setIf(java.lang.String ifProperty)
ifProperty
- name of propertypublic void setUnless(java.lang.String unlessProperty)
unlessProperty
- name of propertypublic boolean shouldUse(Task t)
if
and unless
properties.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |