org.quilt.frontend.ant
Class QuiltTask

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.Task
              |
              +--org.quilt.frontend.ant.QuiltTask

public class QuiltTask
extends org.apache.tools.ant.Task

Ant task for running Quilt and JUnit.

The Quilt Ant task is meant to be a plug-in replacement for the Ant JUnitTask. Whatever build.xml works with JUnitTask should behave identically with QuiltTask. The opposite is not true: using QuiltTask allows you to run coverage tests in addition to JUnit unit tests

Parameter names / build file options are compatible with the build.xml options for JUnitTask as of Ant 1.5.3-1, so that if <junit> and </junit> are replaced with <quilt> and </quilt> respectively in the build.xml file, test behavior should be the same.

Build file options either control the individual test and so are passed to Quilt and JUnit, or manage QuiltTask and the test process.

Most test options will go through Quilt to JUnit. All are set by Ant set* methods, where the name for the method setting the variable 'var' is 'setVar'. That is, the first letter of the variable name is capitalized, then the modified name is appended to 'set'.

Task control parameters are NOT passed through to Quilt or JUnit. These variables are modified by Ant add*, set*, and create* routines, where the names are determined as described above.

QuiltTest options can be set at three levels. First, then can be set as attributes to the <quilt&gr; element. In this case, they are the defaults for all tests.

Next, they can be set at the <batchtest> leve.. In this case, these attributes will be used for all files in the batch test.

Finally, they can be set at the <test> level, in which case they will override the defaults set higher up.

QuiltTask collects filesets from batch test elements and the names of individual tests. These are then passed to a Scheduler which unpacks the batch tests and schedules all tests for running.

It may be important to understand that under certain circumstances batches of tests will be run more than once result. This will normally be the result of an error in the way that dependencies are structured in build.xml.

See Also:
QuiltTest, Scheduler, TaskControl

Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
QuiltTask()
           
 
Method Summary
protected  void addClasspathEntry(java.lang.String resource)
           
 void addEnv(org.apache.tools.ant.types.Environment.Variable var)
           
 void addFormatter(FmtSelector fe)
           
 void addSysproperty(org.apache.tools.ant.types.Environment.Variable sysp)
           
 void addTest(QuiltTest qt)
           
 BatchTest createBatchTest()
           
 org.apache.tools.ant.types.Path createClasspath()
           
 org.apache.tools.ant.types.Commandline.Argument createJvmarg()
           
 void execute()
           
 void handleTheErrorFlush(java.lang.String line)
           
 void handleTheErrorOutput(java.lang.String line)
           
 void handleTheFlush(java.lang.String line)
           
 void handleTheOutput(java.lang.String line)
           
 void init()
           
 void setCheckCoverage(boolean b)
           
 void setCheckExcludes(java.lang.String s)
           
 void setCheckIncludes(java.lang.String s)
           
 void setDir(java.io.File dir)
           
 void setErrorProperty(java.lang.String propertyName)
           
 void setFailureProperty(java.lang.String propertyName)
           
 void setFiltertrace(boolean b)
           
 void setFork(boolean b)
           
 void setHaltOnError(boolean b)
           
 void setHaltOnFailure(boolean b)
           
 void setIncludeAntRuntime(boolean b)
           
 void setJvm(java.lang.String value)
           
 void setMaxmemory(java.lang.String max)
           
 void setMockExec(boolean b)
           
 void setMockTestRun(boolean b)
           
 void setNewenvironment(boolean b)
           
 void setPrintsummary(java.lang.String sValue)
           
 void setShowOutput(boolean b)
           
 void setTimeout(java.lang.Long t)
           
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorFlush, handleErrorOutput, handleFlush, handleOutput, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuiltTask

public QuiltTask()
          throws java.lang.Exception
Method Detail

setCheckCoverage

public void setCheckCoverage(boolean b)

setCheckExcludes

public void setCheckExcludes(java.lang.String s)

setCheckIncludes

public void setCheckIncludes(java.lang.String s)

setErrorProperty

public void setErrorProperty(java.lang.String propertyName)

setFailureProperty

public void setFailureProperty(java.lang.String propertyName)

setFiltertrace

public void setFiltertrace(boolean b)

setFork

public void setFork(boolean b)

setHaltOnError

public void setHaltOnError(boolean b)

setHaltOnFailure

public void setHaltOnFailure(boolean b)

setMockTestRun

public void setMockTestRun(boolean b)

setShowOutput

public void setShowOutput(boolean b)

createBatchTest

public BatchTest createBatchTest()

createClasspath

public org.apache.tools.ant.types.Path createClasspath()

setDir

public void setDir(java.io.File dir)

addEnv

public void addEnv(org.apache.tools.ant.types.Environment.Variable var)

addFormatter

public void addFormatter(FmtSelector fe)

setIncludeAntRuntime

public void setIncludeAntRuntime(boolean b)

setJvm

public void setJvm(java.lang.String value)

createJvmarg

public org.apache.tools.ant.types.Commandline.Argument createJvmarg()

setMaxmemory

public void setMaxmemory(java.lang.String max)

setMockExec

public void setMockExec(boolean b)

setNewenvironment

public void setNewenvironment(boolean b)

setPrintsummary

public void setPrintsummary(java.lang.String sValue)

addSysproperty

public void addSysproperty(org.apache.tools.ant.types.Environment.Variable sysp)

addTest

public void addTest(QuiltTest qt)

setTimeout

public void setTimeout(java.lang.Long t)

init

public void init()
Overrides:
init in class org.apache.tools.ant.Task

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Overrides:
execute in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException

addClasspathEntry

protected void addClasspathEntry(java.lang.String resource)

handleTheOutput

public void handleTheOutput(java.lang.String line)

handleTheFlush

public void handleTheFlush(java.lang.String line)

handleTheErrorOutput

public void handleTheErrorOutput(java.lang.String line)

handleTheErrorFlush

public void handleTheErrorFlush(java.lang.String line)


Copyright © 2001-2003 Apache Software Foundation. All Rights Reserved.