Class FormatterElement
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.
       <junit printsummary="no" haltonfailure="yes" fork="false">
           <formatter type="plain" usefile="false" />
           <test name="org.apache.ecs.InternationalCharTest" />
       </junit>
 adds a plain type implementation
 (PlainJUnitResultFormatter) to display the results of the test.
 Either the type or the classname attribute
 must be set.
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classEnumerated attribute with the values "plain", "xml", "brief" and "failure".
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionGet name of class to be used as the formatter.Get the extension used for the report file.voidsetClassname(String classname) Set name of class to be used as the formatter.voidsetExtension(String ext) Set the extension to use for the report file.voidSet whether this formatter should be used.voidSet whether this formatter should be used.voidsetOutput(OutputStream out) Set output stream for formatter to use.voidsetProject(Project project) Store the project reference for passing it to nested components.voidQuick way to use a standard formatter.voidSet whether this formatter should NOT be used.voidSet whether this formatter should NOT be used.voidsetUseFile(boolean useFile) Set whether the formatter should log to file.booleanEnsures that the selector passes the conditions placed on it withifandunlessproperties.
- 
Field Details- 
XML_FORMATTER_CLASS_NAME
- 
BRIEF_FORMATTER_CLASS_NAME
- 
PLAIN_FORMATTER_CLASS_NAME
- 
FAILURE_RECORDER_CLASS_NAME
 
- 
- 
Constructor Details- 
FormatterElementpublic FormatterElement()
 
- 
- 
Method Details- 
setTypeQuick way to use a standard formatter. At the moment, there are three supported standard formatters. - The xmltype uses aXMLJUnitResultFormatter.
- The brieftype uses aBriefJUnitResultFormatter.
- The plaintype (the default) uses aPlainJUnitResultFormatter.
- The failuretype uses aFailureRecorder.
 Sets classnameattribute - so you can't use that attribute if you use this one.- Parameters:
- type- the enumerated value to use.
 
- The 
- 
setClassnameSet name of class to be used as the formatter.This class must implement JUnitResultFormatter- Parameters:
- classname- the name of the formatter class.
 
- 
getClassnameGet name of class to be used as the formatter.- Returns:
- the name of the class.
 
- 
setExtensionSet the extension to use for the report file.- Parameters:
- ext- the extension to use.
 
- 
getExtension
- 
setOutputSet output stream for formatter to use.Defaults to standard out. - Parameters:
- out- the output stream to use.
 
- 
setUseFilepublic void setUseFile(boolean useFile) Set whether the formatter should log to file.- Parameters:
- useFile- if true use a file, if false send to standard out.
 
- 
setIfSet whether this formatter should be used. It will be used if the expression evaluates to true or the name of a property which has been set, otherwise it won't.- Parameters:
- ifCond- name of property
- Since:
- Ant 1.8.0
 
- 
setIfSet whether this formatter should be used. It will be used if the expression evaluates to true or the name of a property which has been set, otherwise it won't.- Parameters:
- ifCond- name of property
 
- 
setUnlessSet whether this formatter should NOT be used. It will be used if the expression evaluates to false or the name of a property which has not been set, otherwise it will not be used.- Parameters:
- unlessCond- name of property
- Since:
- Ant 1.8.0
 
- 
setUnlessSet whether this formatter should NOT be used. It will be used if the expression evaluates to false or the name of a property which has not been set, otherwise it will not be used.- Parameters:
- unlessCond- name of property
 
- 
shouldUseEnsures that the selector passes the conditions placed on it withifandunlessproperties.- Parameters:
- t- the task the this formatter is used in.
- Returns:
- true if the formatter should be used.
 
- 
setProjectStore the project reference for passing it to nested components.- Parameters:
- project- the reference
- Since:
- Ant 1.8
 
 
-