org.apache.tools.ant.taskdefs.optional.junit
Class FormatterElement

java.lang.Object
  |
  +--org.apache.tools.ant.taskdefs.optional.junit.FormatterElement

public class FormatterElement
extends java.lang.Object

A wrapper for the implementations of JUnitResultFormatter. In particular, used as a nested <formatter> element in a <junit> task.

For example,

       <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.

Author:
Stefan Bodewig
See Also:
JUnitTask, XMLJUnitResultFormatter, BriefJUnitResultFormatter, PlainJUnitResultFormatter, JUnitResultFormatter

Nested Class Summary
static class FormatterElement.TypeAttribute
           Enumerated attribute with the values "plain", "xml" and "brief".
 
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 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 setUseFile(boolean useFile)
          Set whether the formatter should log to file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormatterElement

public FormatterElement()
Method Detail

setType

public void setType(FormatterElement.TypeAttribute type)

Quick way to use a standard formatter.

At the moment, there are three supported standard formatters.

Sets classname attribute - so you can't use that attribute if you use this one.


setClassname

public void setClassname(java.lang.String classname)

Set name of class to be used as the formatter.

This class must implement JUnitResultFormatter


getClassname

public java.lang.String getClassname()
Get name of class to be used as the formatter.


setExtension

public void setExtension(java.lang.String ext)

getExtension

public java.lang.String getExtension()

setOutput

public void setOutput(java.io.OutputStream out)

Set output stream for formatter to use.

Defaults to standard out.


setUseFile

public void setUseFile(boolean useFile)
Set whether the formatter should log to file.



Copyright 2000-2002 Apache Software Foundation. All Rights Reserved.