FileDocCategorySizeDatePackage
JUnitPerfDocletSubTask.javaAPI DocExample1952Tue Nov 26 19:49:32 GMT 2002com.oreilly.javaxp.xdoclet.perf

JUnitPerfDocletSubTask

public class JUnitPerfDocletSubTask extends xdoclet.TemplateSubTask
ant.element
name="junitperf" parent="xdoclet.DocletTask"
author
Brian M. Coyner
version
$Id: JUnitPerfDocletSubTask.java,v 1.9 2002/11/23 03:54:55 jepc Exp $

Fields Summary
public static final String
DEFAULT_TEMPLATE
public static final String
DEFAULT_JUNIT_PERF_PATTERN
Constructors Summary
public JUnitPerfDocletSubTask()
Constructs this subtask with a default 'destinationFile' and default template file.


                    
      
        setDestinationFile(DEFAULT_JUNIT_PERF_PATTERN);
        setTemplateURL(getClass().getResource(DEFAULT_TEMPLATE));
    
Methods Summary
public java.lang.StringgetJUnitPerfPattern()
Used by {@link JUnitPerfTagHandler} to generate the new class name. Before returning the '.java. extension is stripped off.

return
the JUnitPerf file pattern with the '.java' extension removed.

        return getDestinationFile().
                substring(0, getDestinationFile().indexOf(".java"));
    
public voidvalidateOptions()
Overridden to validate the 'destinationFile' attribute. This attribute must include a '{0}', which serves as a place holder for the JUnit test name.

        super.validateOptions();

        if (getDestinationFile().indexOf("{0}") == -1) {
            throw new XDocletException(
                    "The '" + getSubTaskName() +
                    "' Ant Doclet Subtask attribute 'destinationFile' " +
                    "must contain the substring '{0}', which serves as a " +
                    "place holder JUnit Test name.");
        }