Cactus Jelly Tag that scans Ant FileSets and return a list of
qualified class name that are Cactus TestCases (i.e.
ServletTestCase, JspTestCase or FilterTestCase) or subclasses
of Cactus TestCases.
Note: This is useful when used with the <junit> Ant
task for example, in order to find out the list of tests to
execute.
| Method from org.apache.cactus.integration.maven.CactusScannerTag Detail: |
public void addFileset(FileSet theSet) {
log.debug("Adding fileset");
this.fileset = theSet;
}
Adds a set of files (nested fileset attribute). This method is called
dynamically by #setTaskProperty . |
public Path createClasspath() {
log.debug("Creating classpath");
if (this.classpath == null)
{
this.classpath = new Path(AntTagLibrary.getProject(context));
}
return this.classpath.createPath();
}
|
public void doTag(XMLOutput theXmlOutput) throws JellyTagException {
this.cactusScanner.setProject(AntTagLibrary.getProject(context));
this.cactusScanner.clear();
// run the body first to configure the task via nested tags
invokeBody(theXmlOutput);
// Process the fileset to extract Cactus test cases. We need to pass
// the project dependency classpath as the CactusScanner will need
// to load the cactus test classes to decide whether they are Cactus
// test case or not and that needs the dependent jars to be in the
// classpath.
Path cp = this.classpath;
if (this.classpathref != null)
{
cp = (Path) AntTagLibrary.getProject(
context).getReference(this.classpathref);
}
this.cactusScanner.processFileSet(this.fileset, cp);
// output the cactusScanner
if (var == null)
{
throw new MissingAttributeException("var");
}
context.setVariable(var, cactusScanner);
}
|
public CactusScanner getCactusScanner() {
return this.cactusScanner;
}
|
public Path getClasspath() {
return this.classpath;
}
|
public Object getTaskObject() {
return this;
}
|
public void setClasspath(Path theClasspath) {
log.debug("Setting classpath [" + theClasspath + "]");
if (this.classpath == null)
{
this.classpath = theClasspath;
}
else
{
this.classpath.append(theClasspath);
}
}
Sets the classapth in which we will look for Cactus test cases. |
public void setClasspathRef(Reference theReference) {
createClasspath().setRefid(theReference);
}
Sets the classpath in which we will look for Cactus test cases, using
a reference. |
public void setClasspathref(String theClasspathref) {
this.classpathref = theClasspathref;
}
Sets the classpath in which we will look for Cactus test cases, using
a String reference. |
public void setTaskProperty(String theName,
Object theValue) throws JellyTagException {
try
{
BeanUtils.setProperty(this, theName, theValue);
}
catch (IllegalAccessException anException)
{
throw new JellyTagException(anException);
}
catch (InvocationTargetException anException)
{
throw new JellyTagException(anException);
}
}
|
public void setVar(String theVar) {
this.var = theVar;
}
Sets the name of the variable exported by this tag. |