org.jboss.jsfunit.ant
Class JSFUnitWarTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.jboss.jsfunit.ant.JSFUnitWarTask
All Implemented Interfaces:
Cloneable

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

This class provides for an Ant task that will "JSFUnify" a WAR.

Since:
1.0
Author:
Matt Wringe, Stan Silvert

Nested Class Summary
static class JSFUnitWarTask.Filter
          This class represents a filter declaration and mapping that will be added to web.xml.
static class JSFUnitWarTask.JSFUnitFilter
          This class represents the JSFUnitFilter that will be added to web.xml.
static class JSFUnitWarTask.JSFUnitTestRunnerFilter
          This class represents the ServletTestFilter that may be added to web.xml.
 
Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
JSFUnitWarTask()
           
 
Method Summary
 void addClasses(org.apache.tools.ant.types.FileSet classesFileSet)
          Sets the fileset that should be added to the WEB-INF/classes directory of the created archive.
 void addJSFUnitFilter(JSFUnitWarTask.JSFUnitFilter jsfFilter)
          Adds a JSFFilter.
 void addLib(org.apache.tools.ant.types.FileSet libFileSet)
          Sets the fileset that should be added to the WEB-INF/lib directory of the created archive.
 void addTestRunner(JSFUnitWarTask.JSFUnitTestRunnerFilter testRunnerFilter)
          Add the ServletTestRunner filter to web.xml.
 void execute()
          Execute the ant task.
 void setAutoAddJars(Boolean autoAddJars)
          Sets whether or not to automatically add needed jars into the WEB-INF/lib directory of the crearted archive.
 void setContainer(String containerId)
          Set the container Id for the target WAR.
 void setDestfile(File destfile)
          Sets the destination for the newly created archive with JSFUnit specifics
 void setSrcfile(File srcfile)
          Sets the original archive that should have JSFUnit specifics added
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSFUnitWarTask

public JSFUnitWarTask()
Method Detail

setContainer

public void setContainer(String containerId)
Set the container Id for the target WAR. This is sometimes needed to auto-add jars correctly. Currently, the container value that has an affect is "jboss5x".

Parameters:
containerId - "jboss5x" or ""

setSrcfile

public void setSrcfile(File srcfile)
Sets the original archive that should have JSFUnit specifics added

Parameters:
srcfile - A WAR file or a directory containing an exploded WAR.

setDestfile

public void setDestfile(File destfile)
Sets the destination for the newly created archive with JSFUnit specifics

Parameters:
destfile - The destination WAR or directory for an exploded WAR.

addLib

public void addLib(org.apache.tools.ant.types.FileSet libFileSet)
Sets the fileset that should be added to the WEB-INF/lib directory of the created archive.

Parameters:
libFileSet - The fileset to add

addClasses

public void addClasses(org.apache.tools.ant.types.FileSet classesFileSet)
Sets the fileset that should be added to the WEB-INF/classes directory of the created archive. This is typically used to specify the JSFUnit test classes.

Parameters:
classesFileSet - Files to be added to WEB-INF/classes

setAutoAddJars

public void setAutoAddJars(Boolean autoAddJars)
Sets whether or not to automatically add needed jars into the WEB-INF/lib directory of the crearted archive.

Parameters:
autoAddJars - True to automatically add jars, false otherwise

addJSFUnitFilter

public void addJSFUnitFilter(JSFUnitWarTask.JSFUnitFilter jsfFilter)
Adds a JSFFilter. Note: this doesn't actually set the once JSFFilter but rather adds it to the list of already added filters.

Parameters:
jsfFilter - The JSFFilter

addTestRunner

public void addTestRunner(JSFUnitWarTask.JSFUnitTestRunnerFilter testRunnerFilter)
Add the ServletTestRunner filter to web.xml.

Parameters:
testRunnerFilter - An instance of JSFUnitTestRunnerFilter

execute

public void execute()
Execute the ant task.

Overrides:
execute in class org.apache.tools.ant.Task


Copyright © 2007-2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.