The cactus plugin is moving to the cactus project CVS.

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@114253 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
vmassol
2003-10-29 16:25:22 +00:00
parent 9d69059623
commit 6e2d8782b3
39 changed files with 0 additions and 3863 deletions

View File

@@ -1,6 +0,0 @@
target
maven.log
velocity.log
build.properties
.classpath
.project

View File

@@ -1,29 +0,0 @@
The Maven team is pleased to announce the Cactus plugin 1.0 release!
http://jakarta.apache.org/turbine/maven/reference/plugins/cactus
The Maven Cactus plugin is a plugin for Cactus
(http://jakarta.apache.org/cactus) that allows to automatically start
containers, run Cactus tests and stop the containers.
Features in this version includes:
o Support for Tomcat 4.x
o Support for Resin 2.x
o HTML report generation (integrated with Maven reports)
o Support for keeping the server running between redeployments
Limitations:
o Bug when overriding the cactus web.xml in one's project
o Supports only the Servlet API 2.3
You can download the Cactus Maven plugin here:
http://www.ibiblio.org/maven/maven/jars/maven-cactus-plugin-1.0.jar
Have fun!
-Vincent

View File

@@ -1,34 +0,0 @@
The Maven team is pleased to announce the Cactus plugin 1.1 release!
http://jakarta.apache.org/turbine/maven/reference/plugins/cactus
The Maven Cactus plugin is a plugin for Cactus
(http://jakarta.apache.org/cactus) that allows to automatically start
containers, run Cactus tests and stop the containers.
Changes in this version:
o Added support for HttpUnit integration out of the box (i.e. the
HttpUnit jars are automatically added by the Cactus plugin).
o Ability to exclude Cactus tests (for long running tests for example,
in debug period).
o The web.xml elements required for Cactus are now automatically added to the
user project web.xml.
o Added support for running the tests using the JUnit Swing Test Runner.
Simply create the following Maven property
"maven.cactus.testrunner = swing" to use the Swing Test Runner.
o Added automatic discovery of Cactus Test Cases and ignore test support
classes.
o Creation of the project war/webapp is now left to the Maven War plugin.
Cactus repackages it by adding the Cactus tests, the Cactus
configuration files and the Cactus external jars. Thus, the Cactus
plugin now supports the "war:webapp" goal.
o Improved documentation: "news" section on front page and improved
"Quick Start" page.
o Support for WebLogic 7.x.
You can download the Cactus Maven plugin here:
http://www.ibiblio.org/maven/maven/jars/maven-cactus-plugin-1.1.jar
Have fun!
-Vincent

View File

@@ -1,32 +0,0 @@
The Maven team is pleased to announce the Cactus plugin 1.2 release!
http://maven.apache.org/reference/plugins/cactus
The Maven Cactus plugin is a plugin for Cactus
(http://jakarta.apache.org/cactus) that allows to automatically start
containers, run Cactus tests and stop the containers.
Changes in this version:
o Update the plugin to make it work in Maven beta 8
o Checkstyle fixes for included Sample webapp.
o Add new target cactus:test that runs tests for all containers with a
maven.cactus.[container].home property set.
o cactus:single now builds all the code and then runs the testcase specified
by the property mavencactustestcase.
Example: maven cactus:single -Dmavencactustestcase=com.my.company.EasyTest
o Commented out dvsl merging of web.xml due to changes in Maven. Instead uses
either included default web.xml or one provided by maven.cactus.webxml.
o Added Checkstyle report to Cactus plugin web site.
o The plugin now works even if not connected to the internet.
o Fixed problem when the <code>web.xml</code> of the application to
test was defining security configuration. The Cactus was adding its
own but the web.xml DTD only supports one. The new implementation
discards the application security information which is replaced by
the Cactus definition.
You can download the Cactus Maven plugin here:
http://www.ibiblio.org/maven/maven/jars/maven-cactus-plugin-1.2.jar
Have fun!
-Vincent

View File

@@ -1,23 +0,0 @@
The Maven team is pleased to announce the Cactus plugin 2.0 release!
http://maven.apache.org/reference/plugins/cactus
The Maven Cactus plugin is a plugin for Cactus
(http://jakarta.apache.org/cactus) that allows to automatically start
containers, run Cactus tests and stop the containers.
Changes in this version:
o Complete rework of the plugin to use the Cactus/Ant Integration
module from the Cactus project. Now using Cactus 1.5dev for J2EE
1.3, built from CVS on 7th of April 2003. Thus the Plugin feature
are now those of the Cactus/Ant Integration module.
Note that this plugin has been tested with Maven beta 9. Using it with
another version of Maven is at your own risks! :-)
You can download the Cactus Maven plugin here:
http://www.ibiblio.org/maven/maven/jars/maven-cactus-plugin-2.0.jar
Have fun!
-Vincent

View File

@@ -1,40 +0,0 @@
The Maven team is pleased to announce the Cactus plugin 3.0 release!
http://maven.apache.org/reference/plugins/cactus
The Maven Cactus plugin is a plugin for Cactus
(http://jakarta.apache.org/cactus) that allows to automatically start
containers, run Cactus tests and stop the containers.
User-visible changes in this version:
o New goal cactus:match added that allows you to run just matching testcases.
Pass the testcase in using -Dtestmatch=MyTestCase. This brings to parity the
cactus plugin with the test plugin for running types of tests.
o New goal cactus:single added that allows you to run just a single testcase.
Pass the testcase in using -Dtestcase=my.single.TestCase.
o Add xml declaration to generated report. Fixed for character encoding.
o Ability to optionally specify for Tomcat 4x and 5x a directory to which
the container will be installed for the tests.
o Add all user jars that have been marked to be included in the cactus
test (with the <cactus.bundle>true</cactus.bundle> property
in dependencies). For example, DBUnit would be a jar you would
include in a Cactus test but not in a runtime war.
o Updated to Cactus/Ant of 19th of June 2003 which fixes a bug
preventing JBoss to start correctly on unix machines (caused by
an invalid URL file format on unix. Thanks to Chris Lenz for
fixing it.
o The cactus:compile goal now correctly copy the non java files to the target
class directory.
o Major change: updated to use the Cactus/Ant integration built after
23rd of May 2003 (it is completely different from the Cactus/Ant
integration used in version 2.0.
Note that this plugin has been tested with Maven beta 10. Using it with
another version of Maven is at your own risks! :-)
You can download the Cactus Maven plugin here:
http://www.ibiblio.org/maven/maven/jars/maven-cactus-plugin-3.0.jar
Have fun!
-Vincent

View File

@@ -1,36 +0,0 @@
The Maven team is pleased to announce the Cactus plugin 3.1 release!
http://maven.apache.org/reference/plugins/cactus
The Maven Cactus plugin is a plugin for Cactus
(http://jakarta.apache.org/cactus) that allows to automatically start
containers, run Cactus tests and stop the containers.
User-visible changes in this version:
o New cactus:jar-install goal to install the Cactus jar in the local Maven
repository. This is useful if you wish to put Cactus test classes in one
Maven project and execute the Cactus tests in another project.
o New cactus:jar goal to generate a jar containing the Cactus test classes.
o Added new cactus.tmp.dir optional property to specify a location where
Cactus will put its temporary files (mostly where it setup containers for
execution). Defaults to [java.io.tmpdir]/[containername].
o Generate the Cactus test reports in the Cactus reports directory
instead of directly in the Maven build directory. This fixes bug MAVEN-669
o Updated commons-httpclient dependency to 2.0 rc1, httpunit to 1.5.3 and
nekohtml to 0.7.7.
o Added new optional property cactus.weblogic7x.beahome to configure the
location of BEA HOME for the WebLogic 7.x container. It is only needed if
the BEA HOME location is not the parent directory of cactus.home.weblogic7x.
o Added back support for WebLogic 7.x (it had somehow been dropped
when we moved to the new Cactus/Ant integration in version 3.0).
o Updated to Cactus 1.6dev-20030830 which has fixes for WebLogic 7.x support.
Note that this plugin has been tested with Maven 1.0 rc1.
Using it with another version of Maven is at your own risks! :-)
You can download the Cactus Maven plugin here:
http://www.ibiblio.org/maven/maven/jars/maven-cactus-plugin-3.1.jar
Have fun!
-Vincent

View File

@@ -1,22 +0,0 @@
The Maven team is pleased to announce the Cactus plugin 3.2 release!
http://maven.apache.org/reference/plugins/cactus
The Maven Cactus plugin is a plugin for Cactus
(http://jakarta.apache.org/cactus) that allows to automatically start
containers, run Cactus tests and stop the containers.
User-visible changes in this version:
o Added documentation for cactus.bundle property that can be used in POM
dependency list. This fixes bug MAVEN-901.
o Updated to use Cactus 1.5-rc1, HttpClient 2.0 rc2 and AspectJ 1.1.1.
Note that this plugin has been tested with Maven 1.0 rc1.
Using it with another version of Maven is at your own risks! :-)
You can download the Cactus Maven plugin here:
http://www.ibiblio.org/maven/maven/plugins/maven-cactus-plugin-3.2.jar
Have fun!
-Vincent

View File

@@ -1,779 +0,0 @@
<?xml version="1.0"?>
<!--
=============================================================================
Cactus plugin for Maven. It uses the Cactus/Ant Integration from the
Cactus project.
=============================================================================
-->
<!--
Note: There is significant refactoring required for the goals cactus:test,
cactus:single, and cactus:match. The <cactus> tasks in each of those goals
are mostly similar.
-->
<project
xmlns:j="jelly:core"
xmlns:doc="doc"
xmlns:util="jelly:util"
xmlns:ant="jelly:ant"
xmlns:define="jelly:define">
<!--
========================================================================
Default goal.
========================================================================
-->
<goal name="cactus" description="Run all Cactus Test Cases"
prereqs="cactus:test"/>
<!--
========================================================================
Initializations.
========================================================================
-->
<goal name="cactus:init" prereqs="war:war">
<ant:path id="cactus.classpath">
<pathelement location="${plugin.getDependencyPath('cactus:cactus-ant')}"/>
<pathelement location="${plugin.getDependencyPath('cactus:cactus')}"/>
<pathelement location="${plugin.getDependencyPath('commons-logging:commons-logging')}"/>
<pathelement location="${plugin.getDependencyPath('junit:junit')}"/>
<pathelement location="${plugin.getDependencyPath('commons-httpclient:commons-httpclient')}"/>
<pathelement location="${plugin.getDependencyPath('aspectj:aspectjrt')}"/>
<pathelement location="${plugin.getDependencyPath('httpunit:httpunit')}"/>
<pathelement location="${plugin.getDependencyPath('nekohtml:nekohtml')}"/>
<pathelement location="${plugin.getDependencyPath('xerces:xerces')}"/>
<pathelement location="${plugin.getDependencyPath('xml-apis:xml-apis')}"/>
<pathelement location="${plugin.getDependencyPath('rhino:js')}"/>
</ant:path>
<ant:taskdef resource="cactus.tasks" classpathref="cactus.classpath"/>
<ant:taskdef name="junit"
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
<ant:property name="cactus.target.classes.dir"
value="${maven.build.dir}/test-cactus-classes"/>
<j:set var="warBuildDir"
value="${pom.getPluginContext('maven-war-plugin').getVariable('maven.war.build.dir')}"/>
<ant:property name="cactus.src.war"
value="${warBuildDir}/${pom.artifactId}.war"/>
<util:available file="${cactus.src.dir}">
<j:set var="cactusSourcePresent" value="true"/>
</util:available>
</goal>
<!--
========================================================================
Preparations for executing the JUnit reports
========================================================================
-->
<goal name="cactus:init-report">
<!-- Prepare the directories for the JUnit reports -->
<ant:mkdir dir="${cactus.reports.dir}"/>
<j:if test="${context.getVariable('cactus.home.jboss3x') != null}">
<ant:mkdir dir="${cactus.reports.dir}/jboss3x"/>
</j:if>
<j:if test="${context.getVariable('cactus.home.orion1x') != null}">
<ant:mkdir dir="${cactus.reports.dir}/orion1x"/>
</j:if>
<j:if test="${context.getVariable('cactus.home.orion2x') != null}">
<ant:mkdir dir="${cactus.reports.dir}/orion2x"/>
</j:if>
<j:if test="${context.getVariable('cactus.home.resin2x') != null}">
<ant:mkdir dir="${cactus.reports.dir}/resin2x"/>
</j:if>
<j:if test="${context.getVariable('cactus.home.tomcat4x') != null}">
<ant:mkdir dir="${cactus.reports.dir}/tomcat4x"/>
</j:if>
<j:if test="${context.getVariable('cactus.home.tomcat5x') != null}">
<ant:mkdir dir="${cactus.reports.dir}/tomcat5x"/>
</j:if>
<j:if test="${context.getVariable('cactus.home.weblogic7x') != null}">
<ant:mkdir dir="${cactus.reports.dir}/weblogic7x"/>
</j:if>
</goal>
<!--
========================================================================
Compiles the Cactus tests.
========================================================================
-->
<goal name="cactus:compile" prereqs="cactus:init"
description="Compiles the cactus tests">
<mkdir dir="${cactus.target.classes.dir}"/>
<j:choose>
<j:when test="${cactusSourcePresent == 'true'}">
<ant:javac destdir="${cactus.target.classes.dir}"
excludes="**/package.html"
debug="${pom.getPluginContext('maven-java-plugin').getVariable('maven.compile.debug')}"
deprecation="${pom.getPluginContext('maven-java-plugin').getVariable('maven.compile.deprecation')}"
target="${pom.getPluginContext('maven-java-plugin').getVariable('maven.compile.target')}"
optimize="${pom.getPluginContext('maven-java-plugin').getVariable('maven.compile.optimize')}">
<ant:src path="${cactus.src.dir}"/>
<ant:classpath>
<ant:path refid="maven.dependency.classpath"/>
<ant:path refid="cactus.classpath"/>
<ant:pathelement path="${maven.build.dest}"/>
</ant:classpath>
<j:if test="${pom.getPluginContext('maven-java-plugin').getVariable('maven.compile.compilerargs')}">
<ant:compilerarg line="${pom.getPluginContext('maven-java-plugin').getVariable('maven.compile.compilerargs')}"/>
</j:if>
<j:if test="${pom.getPluginContext('maven-java-plugin').getVariable('maven.compile.encoding')}">
<ant:setProperty name="encoding" value="${pom.getPluginContext('maven-java-plugin').getVariable('maven.compile.encoding')}"/>
</j:if>
<j:if test="${pom.getPluginContext('maven-java-plugin').getVariable('maven.compile.executable')}">
<ant:setProperty name="executable" value="${pom.getPluginContext('maven-java-plugin').getVariable('maven.compile.executable')}"/>
</j:if>
<j:if test="${pom.getPluginContext('maven-java-plugin').getVariable('maven.compile.fork')}">
<ant:setProperty name="fork" value="${pom.getPluginContext('maven-java-plugin').getVariable('maven.compile.fork')}"/>
</j:if>
<j:if test="${pom.getPluginContext('maven-java-plugin').getVariable('maven.compile.source')}">
<ant:setProperty name="source" value="${pom.getPluginContext('maven-java-plugin').getVariable('maven.compile.source')}"/>
</j:if>
<j:if test="${pom.getPluginContext('maven-java-plugin').getVariable('maven.compile.verbose')}">
<ant:setProperty name="verbose" value="${pom.getPluginContext('maven-java-plugin').getVariable('maven.compile.verbose')}"/>
</j:if>
</ant:javac>
<!-- Copy non java source files -->
<ant:copy todir="${cactus.target.classes.dir}">
<ant:fileset dir="${cactus.src.dir}">
<ant:exclude name="**/*.java"/>
<ant:exclude name="**/*.html"/>
</ant:fileset>
</ant:copy>
</j:when>
<j:otherwise>
<ant:echo>No Cactus source files to compile.</ant:echo>
</j:otherwise>
</j:choose>
</goal>
<!--
========================================================================
Generate a jar containing Cactus tests classes.
========================================================================
-->
<goal name="cactus:jar" prereqs="cactus:compile"
description="Generate a Cactus jar">
<ant:jar
jarfile="${maven.build.dir}/${pom.artifactId}-cactus-${pom.currentVersion}.jar"
basedir="${cactus.target.classes.dir}">
<ant:manifest>
<ant:attribute name="Built-By" value="${user.name}"/>
<ant:attribute name="Created-By" value="Apache Jakarta Maven"/>
<ant:attribute name="Package" value="${pom.package}"/>
<ant:attribute name="Build-Jdk" value="${java.version}"/>
<ant:attribute name="Extension-Name" value="${pom.artifactId}"/>
<ant:attribute name="Specification-Version" value="${pom.specificationVersion}"/>
<ant:attribute name="Specification-Vendor" value="${pom.organization.name}"/>
<ant:attribute name="Specification-Title" value="${pom.shortDescription}"/>
<ant:attribute name="Implementation-Version" value="${pom.currentVersion}"/>
<ant:attribute name="Implementation-Vendor" value="${pom.organization.name}"/>
<ant:attribute name="Implementation-Vendor-Id" value="${pom.organization.identifier}"/>
</ant:manifest>
</ant:jar>
</goal>
<!--
========================================================================
Cactify an application war.
========================================================================
-->
<goal name="cactus:cactifywar" prereqs="cactus:compile"
description="Cactify the application war">
<cactifywar srcfile="${cactus.src.war}"
destfile="${maven.build.dir}/${pom.artifactId}-cactus.war">
<!-- Add the mergewebxml attribute if it has been defined by the
user -->
<j:if test="${context.getVariable('cactus.src.mergewebxml') != null}">
<ant:setProperty name="mergewebxml" value="${cactus.src.mergewebxml}"/>
</j:if>
<ant:classes dir="${cactus.target.classes.dir}"/>
<!-- Orion fails on a servlet filter that is not mapped to an actual
resource, to trick it -->
<filterredirector mapping="/test/filterRedirector.jsp"/>
<!-- Files needed for JBoss -->
<ant:classes dir="${plugin.resources}/jboss3x">
<ant:include name="*.properties" if="cactus.home.jboss3x"/>
</ant:classes>
<ant:webinf dir="${plugin.resources}/jboss3x">
<ant:include name="jboss-web.xml" if="cactus.home.jboss3x"/>
</ant:webinf>
<!-- Add all cactus related jars to the WEB-INF/lib dir. By default
the CactifyWarTask only adds the pure Cactus jars but not
related jars such as HttpUnit jars -->
<lib file="${plugin.getDependencyPath('httpunit:httpunit')}"/>
<!-- Add all user jars that have been marked to be included in the cactus
test. For example, DBUnit would be a jar you would include in a
Cactus test but not in a runtime war -->
<j:forEach var="artifact" items="${pom.artifacts}">
<j:set var="dep" value="${artifact.dependency}"/>
<j:if test="${dep.getProperty('cactus.bundle')=='true'}">
<lib file="${artifact.path}"/>
</j:if>
</j:forEach>
</cactifywar>
</goal>
<!--
========================================================================
Execute the Cactus tests on all containers which have been defined,
i.e. which have a ${cactus.home.[container name]} property
defined.
========================================================================
-->
<goal name="cactus:test"
prereqs="cactus:init,cactus:init-report,cactus:cactifywar"
description="Run all Cactus Test Cases">
<cactus warfile="${maven.build.dir}/${pom.artifactId}-cactus.war"
fork="yes" errorproperty="cactustests.error"
failureproperty="cactustests.failure"
printsummary="${maven.cactus.printsummary}">
<ant:classpath>
<ant:pathelement path="${maven.build.dest}"/>
<ant:pathelement location="${cactus.target.classes.dir}"/>
<ant:path refid="maven.dependency.classpath"/>
<ant:path refid="cactus.classpath"/>
</ant:classpath>
<containerset>
<!-- TODO: Find how to set the port for JBoss 3x -->
<jboss3x if="cactus.home.jboss3x"
dir="${cactus.home.jboss3x}"
output="${cactus.reports.dir}/jboss3x.out"
todir="${cactus.reports.dir}/jboss3x"
config="${cactus.jboss3x.config.name}">
<j:if test="${context.getVariable('cactus.tmp.dir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tmp.dir}"/>
</j:if>
</jboss3x>
<orion1x if="cactus.home.orion1x"
dir="${cactus.home.orion1x}" port="${cactus.port}"
output="${cactus.reports.dir}/orion1x.out"
todir="${cactus.reports.dir}/orion1x">
<j:if test="${context.getVariable('cactus.tmp.dir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tmp.dir}"/>
</j:if>
</orion1x>
<orion2x if="cactus.home.orion2x"
dir="${cactus.home.orion2x}" port="${cactus.port}"
output="${cactus.reports.dir}/orion2x.out"
todir="${cactus.reports.dir}/orion2x">
<j:if test="${context.getVariable('cactus.tmp.dir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tmp.dir}"/>
</j:if>
</orion2x>
<resin2x if="cactus.home.resin2x"
dir="${cactus.home.resin2x}" port="${cactus.port}"
output="${cactus.reports.dir}/resin2x.out"
todir="${cactus.reports.dir}/resin2x">
<j:if test="${context.getVariable('cactus.tmp.dir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tmp.dir}"/>
</j:if>
<j:if test="${context.getVariable('cactus.resin2x.config') != null}">
<ant:setProperty name="resinconf" value="${cactus.resin2x.config}"/>
</j:if>
</resin2x>
<tomcat4x if="cactus.home.tomcat4x"
dir="${cactus.home.tomcat4x}" port="${cactus.port}"
output="${cactus.reports.dir}/tomcat4x.out"
todir="${cactus.reports.dir}/tomcat4x">
<j:if test="${context.getVariable('cactus.tmp.dir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tmp.dir}"/>
</j:if>
<j:if test="${context.getVariable('cactus.tomcat4x.config') != null}">
<ant:setProperty name="serverxml" value="${cactus.tomcat4x.config}"/>
</j:if>
<j:if test="${context.getVariable('cactus.tomcat4x.tmpdir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tomcat4x.tmpdir}"/>
</j:if>
<j:if test="${context.getVariable('cactus.tomcat4x.conf.dir') != null}">
<conf dir="${cactus.tomcat4x.conf.dir}"
includes="${cactus.tomcat4x.conf.includes}"
excludes="${cactus.tomcat4x.conf.excludes}"/>
</j:if>
</tomcat4x>
<tomcat5x if="cactus.home.tomcat5x"
dir="${cactus.home.tomcat5x}" port="${cactus.port}"
output="${cactus.reports.dir}/tomcat5x.out"
todir="${cactus.reports.dir}/tomcat5x">
<j:if test="${context.getVariable('cactus.tmp.dir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tmp.dir}"/>
</j:if>
<j:if test="${context.getVariable('cactus.tomcat5x.config') != null}">
<ant:setProperty name="serverxml" value="${cactus.tomcat5x.config}"/>
</j:if>
<j:if test="${context.getVariable('cactus.tomcat5x.tmpdir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tomcat5x.tmpdir}"/>
</j:if>
<j:if test="${context.getVariable('cactus.tomcat5x.conf.dir') != null}">
<conf dir="${cactus.tomcat5x.conf.dir}"
includes="${cactus.tomcat5x.conf.includes}"
excludes="${cactus.tomcat5x.conf.excludes}"/>
</j:if>
</tomcat5x>
<weblogic7x if="cactus.home.weblogic7x"
dir="${cactus.home.weblogic7x}" port="${cactus.port}"
output="${cactus.reports.dir}/weblogic7x.out"
todir="${cactus.reports.dir}/weblogic7x">
<j:if test="${context.getVariable('cactus.tmp.dir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tmp.dir}"/>
</j:if>
<j:if test="${context.getVariable('cactus.weblogic7x.beahome') != null}">
<ant:setProperty name="beahome" value="${cactus.weblogic7x.beahome}"/>
</j:if>
</weblogic7x>
</containerset>
<ant:formatter type="plain" usefile="${cactus.junit.usefile}"/>
<ant:formatter type="xml"/>
<ant:batchtest>
<ant:fileset dir="${cactus.src.dir}"
includes="${cactus.src.includes}"
excludes="${cactus.src.excludes}"/>
</ant:batchtest>
</cactus>
<!-- TODO: Change the Cactus stylesheet (cactus.jsl) to handle reports
for several containers -->
<!-- Consolidate the reports into a single -->
<ant:junitreport todir="${cactus.reports.dir}"
tofile="TESTS-TestSuites-Cactus.xml">
<j:if test="${context.getVariable('cactus.home.jboss3x') != null}">
<ant:fileset dir="${cactus.reports.dir}/jboss3x">
<ant:include name="TEST-*.xml"/>
</ant:fileset>
</j:if>
<j:if test="${context.getVariable('cactus.home.orion1x') != null}">
<ant:fileset dir="${cactus.reports.dir}/orion1x">
<ant:include name="TEST-*.xml"/>
</ant:fileset>
</j:if>
<j:if test="${context.getVariable('cactus.home.orion2x') != null}">
<ant:fileset dir="${cactus.reports.dir}/orion2x">
<ant:include name="TEST-*.xml"/>
</ant:fileset>
</j:if>
<j:if test="${context.getVariable('cactus.home.resin2x') != null}">
<ant:fileset dir="${cactus.reports.dir}/resin2x">
<ant:include name="TEST-*.xml"/>
</ant:fileset>
</j:if>
<j:if test="${context.getVariable('cactus.home.tomcat4x') != null}">
<ant:fileset dir="${cactus.reports.dir}/tomcat4x">
<ant:include name="TEST-*.xml"/>
</ant:fileset>
</j:if>
<j:if test="${context.getVariable('cactus.home.tomcat5x') != null}">
<ant:fileset dir="${cactus.reports.dir}/tomcat5x">
<ant:include name="TEST-*.xml"/>
</ant:fileset>
</j:if>
<j:if test="${context.getVariable('cactus.home.weblogic7x') != null}">
<ant:fileset dir="${cactus.reports.dir}/weblogic7x">
<ant:include name="TEST-*.xml"/>
</ant:fileset>
</j:if>
</ant:junitreport>
<j:if test="${cactus.halt.on.failure}">
<ant:fail if="cactustests.failure">At least one test had a failure!</ant:fail>
</j:if>
<j:if test="${cactus.halt.on.error}">
<ant:fail if="cactustests.error">At least one test had an error!</ant:fail>
</j:if>
</goal>
<!--
========================================================================
Execute a single Cactus test on all containers which have been defined,
i.e. which have a ${cactus.home.[container name]} property
defined. Specify the case with -Dtestcase=my.single.TestCase
========================================================================
-->
<goal name="cactus:single" prereqs="cactus:init,cactus:cactifywar"
description="Run a single Cactus Test Case">
<j:choose>
<j:when test="${empty(testcase)}">
<echo>
You must define the test case to run via -Dtestcase=classname
Example: maven -Dtestcase=MyTest cactus:single
</echo>
</j:when>
<j:otherwise>
<cactus warfile="${maven.build.dir}/${pom.artifactId}-cactus.war"
fork="yes" errorproperty="cactustests.error"
failureproperty="cactustests.failure"
printsummary="${maven.cactus.printsummary}">
<ant:classpath>
<ant:pathelement path="${maven.build.dest}"/>
<ant:pathelement location="${cactus.target.classes.dir}"/>
<ant:path refid="maven.dependency.classpath"/>
<ant:path refid="cactus.classpath"/>
</ant:classpath>
<containerset>
<!-- TODO: Find how to set the port for JBoss 3x -->
<jboss3x if="cactus.home.jboss3x"
dir="${cactus.home.jboss3x}"
output="${cactus.reports.dir}/jboss3x.out"
todir="${cactus.reports.dir}/jboss3x"
config="${cactus.jboss3x.config.name}">
<j:if test="${context.getVariable('cactus.tmp.dir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tmp.dir}"/>
</j:if>
</jboss3x>
<orion1x if="cactus.home.orion1x"
dir="${cactus.home.orion1x}" port="${cactus.port}"
output="${cactus.reports.dir}/orion1x.out"
todir="${cactus.reports.dir}/orion1x">
<j:if test="${context.getVariable('cactus.tmp.dir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tmp.dir}"/>
</j:if>
</orion1x>
<orion2x if="cactus.home.orion2x"
dir="${cactus.home.orion2x}" port="${cactus.port}"
output="${cactus.reports.dir}/orion2x.out"
todir="${cactus.reports.dir}/orion2x">
<j:if test="${context.getVariable('cactus.tmp.dir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tmp.dir}"/>
</j:if>
</orion2x>
<resin2x if="cactus.home.resin2x"
dir="${cactus.home.resin2x}" port="${cactus.port}"
output="${cactus.reports.dir}/resin2x.out"
todir="${cactus.reports.dir}/resin2x">
<j:if test="${context.getVariable('cactus.tmp.dir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tmp.dir}"/>
</j:if>
<j:if test="${context.getVariable('cactus.resin2x.config') != null}">
<ant:setProperty name="resinconf" value="${cactus.resin2x.config}"/>
</j:if>
</resin2x>
<tomcat4x if="cactus.home.tomcat4x"
dir="${cactus.home.tomcat4x}" port="${cactus.port}"
output="${cactus.reports.dir}/tomcat4x.out"
todir="${cactus.reports.dir}/tomcat4x">
<j:if test="${context.getVariable('cactus.tmp.dir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tmp.dir}"/>
</j:if>
<j:if test="${context.getVariable('cactus.tomcat4x.config') != null}">
<ant:setProperty name="serverxml" value="${cactus.tomcat4x.config}"/>
</j:if>
<j:if test="${context.getVariable('cactus.tomcat4x.tmpdir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tomcat4x.tmpdir}"/>
</j:if>
<j:if test="${context.getVariable('cactus.tomcat4x.conf.dir') != null}">
<conf dir="${cactus.tomcat4x.conf.dir}"
includes="${cactus.tomcat4x.conf.includes}"
excludes="${cactus.tomcat4x.conf.excludes}"/>
</j:if>
</tomcat4x>
<tomcat5x if="cactus.home.tomcat5x"
dir="${cactus.home.tomcat5x}" port="${cactus.port}"
output="${cactus.reports.dir}/tomcat5x.out"
todir="${cactus.reports.dir}/tomcat5x">
<j:if test="${context.getVariable('cactus.tmp.dir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tmp.dir}"/>
</j:if>
<j:if test="${context.getVariable('cactus.tomcat5x.config') != null}">
<ant:setProperty name="serverxml" value="${cactus.tomcat5x.config}"/>
</j:if>
<j:if test="${context.getVariable('cactus.tomcat5x.tmpdir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tomcat5x.tmpdir}"/>
</j:if>
<j:if test="${context.getVariable('cactus.tomcat5x.conf.dir') != null}">
<conf dir="${cactus.tomcat5x.conf.dir}"
includes="${cactus.tomcat5x.conf.includes}"
excludes="${cactus.tomcat5x.conf.excludes}"/>
</j:if>
</tomcat5x>
<weblogic7x if="cactus.home.weblogic7x"
dir="${cactus.home.weblogic7x}" port="${cactus.port}"
output="${cactus.reports.dir}/weblogic7x.out"
todir="${cactus.reports.dir}/weblogic7x">
<j:if test="${context.getVariable('cactus.tmp.dir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tmp.dir}"/>
</j:if>
<j:if test="${context.getVariable('cactus.weblogic7x.beahome') != null}">
<ant:setProperty name="beahome" value="${cactus.weblogic7x.beahome}"/>
</j:if>
</weblogic7x>
</containerset>
<ant:formatter type="plain" usefile="${cactus.junit.usefile}"/>
<ant:formatter type="xml"/>
<!-- Run only a single testcase passed in via -Dtestcase=my.single.TestCase-->
<ant:test name="${testcase}"/>
</cactus>
</j:otherwise>
</j:choose>
</goal>
<!--
========================================================================
Execute a Cactus tests on all containers which have been defined,
i.e. which have a ${cactus.home.[container name]} property
defined. Specify the matching tests with -Dtestmatch=FooTest
========================================================================
-->
<goal name="cactus:match" prereqs="cactus:init,cactus:cactifywar"
description="Execute all the Cactus tests matching the given 'testmatch' variable">
<j:choose>
<j:when test="${empty(testmatch)}">
<echo>
You must define the test case to match via -Dtestmatch=classname
Example: maven -Dtestmatch=MyTest cactus:match
</echo>
</j:when>
<j:otherwise>
<cactus warfile="${maven.build.dir}/${pom.artifactId}-cactus.war"
fork="yes" errorproperty="cactustests.error"
failureproperty="cactustests.failure"
printsummary="${maven.cactus.printsummary}">
<ant:classpath>
<ant:pathelement path="${maven.build.dest}"/>
<ant:pathelement location="${cactus.target.classes.dir}"/>
<ant:path refid="maven.dependency.classpath"/>
<ant:path refid="cactus.classpath"/>
</ant:classpath>
<containerset>
<!-- TODO: Find how to set the port for JBoss 3x -->
<jboss3x if="cactus.home.jboss3x"
dir="${cactus.home.jboss3x}"
output="${cactus.reports.dir}/jboss3x.out"
todir="${cactus.reports.dir}/jboss3x"
config="${cactus.jboss3x.config.name}">
<j:if test="${context.getVariable('cactus.tmp.dir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tmp.dir}"/>
</j:if>
</jboss3x>
<orion1x if="cactus.home.orion1x"
dir="${cactus.home.orion1x}" port="${cactus.port}"
output="${cactus.reports.dir}/orion1x.out"
todir="${cactus.reports.dir}/orion1x">
<j:if test="${context.getVariable('cactus.tmp.dir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tmp.dir}"/>
</j:if>
</orion1x>
<orion2x if="cactus.home.orion2x"
dir="${cactus.home.orion2x}" port="${cactus.port}"
output="${cactus.reports.dir}/orion2x.out"
todir="${cactus.reports.dir}/orion2x">
<j:if test="${context.getVariable('cactus.tmp.dir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tmp.dir}"/>
</j:if>
</orion2x>
<resin2x if="cactus.home.resin2x"
dir="${cactus.home.resin2x}" port="${cactus.port}"
output="${cactus.reports.dir}/resin2x.out"
todir="${cactus.reports.dir}/resin2x">
<j:if test="${context.getVariable('cactus.tmp.dir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tmp.dir}"/>
</j:if>
<j:if test="${context.getVariable('cactus.resin2x.config') != null}">
<ant:setProperty name="resinconf" value="${cactus.resin2x.config}"/>
</j:if>
</resin2x>
<tomcat4x if="cactus.home.tomcat4x"
dir="${cactus.home.tomcat4x}" port="${cactus.port}"
output="${cactus.reports.dir}/tomcat4x.out"
todir="${cactus.reports.dir}/tomcat4x">
<j:if test="${context.getVariable('cactus.tmp.dir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tmp.dir}"/>
</j:if>
<j:if test="${context.getVariable('cactus.tomcat4x.config') != null}">
<ant:setProperty name="serverxml" value="${cactus.tomcat4x.config}"/>
</j:if>
<j:if test="${context.getVariable('cactus.tomcat4x.tmpdir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tomcat4x.tmpdir}"/>
</j:if>
<j:if test="${context.getVariable('cactus.tomcat4x.conf.dir') != null}">
<conf dir="${cactus.tomcat4x.conf.dir}"
includes="${cactus.tomcat4x.conf.includes}"
excludes="${cactus.tomcat4x.conf.excludes}"/>
</j:if>
</tomcat4x>
<tomcat5x if="cactus.home.tomcat5x"
dir="${cactus.home.tomcat5x}" port="${cactus.port}"
output="${cactus.reports.dir}/tomcat5x.out"
todir="${cactus.reports.dir}/tomcat5x">
<j:if test="${context.getVariable('cactus.tmp.dir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tmp.dir}"/>
</j:if>
<j:if test="${context.getVariable('cactus.tomcat5x.config') != null}">
<ant:setProperty name="serverxml" value="${cactus.tomcat5x.config}"/>
</j:if>
<j:if test="${context.getVariable('cactus.tomcat5x.tmpdir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tomcat5x.tmpdir}"/>
</j:if>
<j:if test="${context.getVariable('cactus.tomcat5x.conf.dir') != null}">
<conf dir="${cactus.tomcat5x.conf.dir}"
includes="${cactus.tomcat5x.conf.includes}"
excludes="${cactus.tomcat5x.conf.excludes}"/>
</j:if>
</tomcat5x>
<weblogic7x if="cactus.home.weblogic7x"
dir="${cactus.home.weblogic7x}" port="${cactus.port}"
output="${cactus.reports.dir}/weblogic7x.out"
todir="${cactus.reports.dir}/weblogic7x">
<j:if test="${context.getVariable('cactus.tmp.dir') != null}">
<ant:setProperty name="tmpdir" value="${cactus.tmp.dir}"/>
</j:if>
<j:if test="${context.getVariable('cactus.weblogic7x.beahome') != null}">
<ant:setProperty name="beahome" value="${cactus.weblogic7x.beahome}"/>
</j:if>
</weblogic7x>
</containerset>
<ant:formatter type="plain" usefile="${cactus.junit.usefile}"/>
<ant:formatter type="xml"/>
<!-- Run all testcases matched via -Dtestmatch=FooTest-->
<ant:batchtest>
<ant:fileset dir="${cactus.src.dir}">
<include name="**/${testmatch}.java"/>
</ant:fileset>
</ant:batchtest>
</cactus>
</j:otherwise>
</j:choose>
</goal>
<!--
========================================================================
Register a Cactus report.
========================================================================
-->
<goal name="maven-cactus-plugin:register">
<doc:registerReport
name="Cactus Unit Tests"
pluginName="cactus"
description="Report on the results of the Cactus unit tests."
link="cactus-report"/>
</goal>
<!--
========================================================================
Deregister a Cactus report.
========================================================================
-->
<goal name="maven-cactus-plugin:deregister">
<doc:deregisterReport name="Cactus Unit Tests"/>
</goal>
<!--
========================================================================
Generate a Cactus report.
========================================================================
-->
<goal name="cactus:report"
description="Generate a report from the test results">
<doc:jsl
input="${cactus.reports.dir}/TESTS-TestSuites-Cactus.xml"
output="cactus-report.xml"
stylesheet="${plugin.resources}/cactus.jsl"
outputMode="xml"
prettyPrint="true"/>
</goal>
<define:taglib uri="cactus">
<define:tag name="dependency-handle">
<!-- XXX Use this tag to allow this plugin to be loaded into another -->
<!--<attainGoal name="cactus:init"/>-->
</define:tag>
</define:taglib>
<!--
========================================================================
Install the Cactus jar in the local repository.
========================================================================
-->
<goal name="cactus:jar-install" prereqs="cactus:jar"
description="Install the Cactus jar in the local repository">
<ant:echo>
id = '${pom.artifactId}'
groupId = '${pom.groupId}'
artifactDirectory = '${pom.artifactDirectory}'
</ant:echo>
<ant:property name="jardir__" value="${maven.repo.local}/${pom.artifactDirectory}/jars"/>
<ant:mkdir dir="${jardir__}"/>
<ant:copy
file="${maven.build.dir}/${pom.artifactId}-cactus-${pom.currentVersion}.jar"
todir="${jardir__}"
overwrite="true"
/>
</goal>
</project>

View File

@@ -1,99 +0,0 @@
# -------------------------------------------------------------------
# Default properties for the Cactus Plugin
# -------------------------------------------------------------------
# Location of containers. These properties need to be put in your
# local project.properties as they depend on where you installed
# your containers on your local machine.
#
# Examples:
#
# cactus.home.tomcat4x = c:/apps/tomcat-4.1.10
#
# Supported container names: jboss3x, tomcat4x, resin2x, orion1x,
# orion2x, tomcat5x
# Location of Cactus tests in project sources
cactus.src.dir = ${basedir}/src/test-cactus
# Default Cactus test files to include in the test
cactus.src.includes = **/*Test*.java
# Default Cactus test files to exclude from the test
cactus.src.excludes = **/AllTests.java,**/Test*All.java
# (optional). Location of a test-specific web.xml file that will be
# merged with the application web.xml, during the War cactification.
# Note that by default the cactification already adds the Cactus
# redirector definitions.
#cactus.src.mergewebxml = ${basedir}/src/conf/cactus-web.xml
# Default port on which to start the containers
cactus.port = 8080
# Decides whether the test result will be printed to the console or
# not. Default is false
cactus.junit.usefile = false
# Location of junit test reports for the Cactus tests
cactus.reports.dir = ${maven.build.dir}/test-cactus-reports
# Shall we stop the build in case of test failures?
cactus.halt.on.failure = true
# Shall we stop the build in case of test errors?
cactus.halt.on.error = true
# How summary information on test should be printed (see the
# "printsummary" attribute of the JUnit Ant task.
maven.cactus.printsummary = withOutAndErr
# (optional) Temporary directory where the containers are setup/executed
#cactus.tmp.dir =
# -------------------------------------------------------------------
# Container-related properties
# -------------------------------------------------------------------
# Name of the JBoss server configuration to use.
cactus.jboss3x.config.name = default
# (optional). Resin 2.x configuration file if you don't want to use the
# cactus-provided one
#cactus.resin2x.config =
# (optional). Tomcat 4.x configuration file if you don't want to use the
# cactus-provided one
#cactus.tomcat4x.config =
# (optional). List of custom Tomcat 4.x configuration files that will be
# included/excluded in the Tomcat conf/ directory (will overwrite the
# default cactus-provided conf files).
#cactus.tomcat4x.conf.dir =
#cactus.tomcat4x.conf.includes =
#cactus.tomcat4x.conf.excludes =
# (optional). Tomcat 4.x directory to which the container will be installed for the tests.
# By default the system temporary directory is used
#cactus.tomcat4x.tmpdir =
# (optional). Tomcat 5.x configuration file if you don't want to use the
# cactus-provided one
#cactus.tomcat5x.config =
# (optional). List of custom Tomcat 5.x configuration files that will be
# included/excluded in the Tomcat conf/ directory (will overwrite the
# default cactus-provided conf files).
#cactus.tomcat5x.conf.dir =
#cactus.tomcat5x.conf.includes =
#cactus.tomcat5x.conf.excludes =
# (optional). Tomcat 5.x directory to which the container will be installed for the tests.
# By default the system temporary directory is used
#cactus.tomcat5x.tmpdir =
# (optional). Location of BEA HOME. If not specified it defaults to
# the parent directory of cactus.home.weblogic7x
#cactus.weblogic7x.beahome =

View File

@@ -1,7 +0,0 @@
# -------------------------------------------------------------------
# P R O J E C T P R O P E R T I E S
# -------------------------------------------------------------------
maven.xdoc.date=left
maven.xdoc.version=${pom.currentVersion}
maven.checkstyle.format = turbine
maven.license.licenseFile=${basedir}/../LICENSE.txt

View File

@@ -1,146 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<extend>../project.xml</extend>
<pomVersion>3</pomVersion>
<id>maven-cactus-plugin</id>
<name>Maven Cactus Plug-in</name>
<currentVersion>3.2</currentVersion>
<description>Plugin for Cactus (http://jakarta.apache.org/cactus) that allows to automatically start containers, run Cactus tests and stop the containers.</description>
<shortDescription>Cactus plugin</shortDescription>
<url>http://maven.apache.org/reference/plugins/cactus/</url>
<siteDirectory>/www/maven.apache.org/reference/plugins/cactus/</siteDirectory>
<repository>
<connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven-plugins/cactus/</connection>
<url>http://cvs.apache.org/viewcvs/maven-plugins/cactus/</url>
</repository>
<versions>
<version>
<id>1.0</id>
<name>1.0</name>
<tag>MAVEN_CACTUS_1_0</tag>
</version>
<version>
<id>1.1</id>
<name>1.1</name>
<tag>MAVEN_CACTUS_1_1</tag>
</version>
<version>
<id>1.2</id>
<name>1.2</name>
<tag>MAVEN_CACTUS_1_2</tag>
</version>
<version>
<id>2.0</id>
<name>2.0</name>
<tag>MAVEN_CACTUS_2_0</tag>
</version>
<version>
<id>3.0</id>
<name>3.0</name>
<tag>MAVEN_CACTUS_3_0</tag>
</version>
<version>
<id>3.1</id>
<name>3.1</name>
<tag>MAVEN_CACTUS_3_1</tag>
</version>
<version>
<id>3.2</id>
<name>3.2</name>
<tag>MAVEN_CACTUS_3_2</tag>
</version>
</versions>
<developers>
<developer>
<name>Vincent Massol</name>
<id>vmassol</id>
<email>vmassol@pivolis.com</email>
<organization>Pivolis</organization>
<roles>
<role>Creator</role>
<role>Java Developer</role>
<role>Release Manager</role>
</roles>
</developer>
<developer>
<name>Eric Pugh</name>
<id>epugh</id>
<email>EPugh@upstate.com</email>
<organization/>
<roles>
<role>Java Developer</role>
</roles>
</developer>
</developers>
<contributors/>
<dependencies>
<dependency>
<groupId>cactus</groupId>
<artifactId>cactus</artifactId>
<version>13-1.5-rc1</version>
</dependency>
<dependency>
<groupId>cactus</groupId>
<artifactId>cactus-ant</artifactId>
<version>13-1.5-rc1</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>2.0-rc2</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
</dependency>
<!-- Note: Dependencies below are needed by HttpUnit. Xerces is also
needed by the XML report used by the junitreport Ant task -->
<dependency>
<groupId>httpunit</groupId>
<artifactId>httpunit</artifactId>
<version>1.5.3</version>
</dependency>
<dependency>
<groupId>nekohtml</groupId>
<artifactId>nekohtml</artifactId>
<version>0.7.7</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xerces</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.0.b2</version>
</dependency>
<dependency>
<groupId>rhino</groupId>
<artifactId>js</artifactId>
<version>1.5R4-RC3</version>
</dependency>
</dependencies>
<reports>
<report>maven-changes-plugin</report>
<report>maven-changelog-plugin</report>
<report>maven-file-activity-plugin</report>
<report>maven-developer-activity-plugin</report>
<report>maven-file-activity-plugin</report>
<report>maven-license-plugin</report>
<report>maven-linkcheck-plugin</report>
</reports>
</project>

View File

@@ -1,5 +0,0 @@
target
cactus_client.log
maven.log
build.properties
velocity.log

View File

@@ -1,4 +0,0 @@
# Please specify your path to your container
cactus.home.tomcat4x = C:/Apps/jakarta-tomcat-4.1.24
cactus.home.resin2x = C:/Apps/resin-2.1.6

View File

@@ -1,77 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<!-- the version of maven's project object model -->
<pomVersion>3</pomVersion>
<!-- a unique name for this project -->
<id>maven-cactus-sample</id>
<!-- a short but descriptive name for the project -->
<name>Cactus Sample</name>
<!-- The version of the project under development, e.g.
1.1, 1.2, 2.0-dev -->
<currentVersion>1.0</currentVersion>
<!-- details about the organization that 'owns' the project -->
<organization>
<name>Apache Software Foundation</name>
<url>http://jakarta.apache.org/</url>
</organization>
<!-- the year the project started -->
<inceptionYear>2002-2003</inceptionYear>
<!-- the top level of java packages that this project defines
e.g. if your project contains the packages
com.mycompany.accounts.reports, com.mycompany.accounts.reports
and com.mycompany.accounts.utils, the package would be
'com.mycompany.accounts' -->
<package>org.apache.maven.cactus.sample</package>
<!-- a short description of what the project does -->
<shortDescription>A sample project using the Cactus plugin for Maven</shortDescription>
<!-- the project home page -->
<url>http://maven.apache.org/</url>
<!-- the version control repository and http url for online access
the connection element has the form:
scm:<system>:<system specific connection string> -->
<repository>
<connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven</connection>
<url>http://cvs.apache.org/viewcvs/maven/</url>
</repository>
<!-- any mailing lists for the project -->
<mailingLists/>
<!-- who the developers are for the project -->
<developers/>
<!-- jar files the project is dependent on -->
<dependencies>
<dependency>
<groupId>servletapi</groupId>>
<artifactId>servletapi</artifactId>>
<version>2.3</version>
</dependency>
</dependencies>
<!-- build information for the project -->
<build>
<sourceDirectory>src/java</sourceDirectory>
</build>
<reports>
<report>maven-cactus-plugin</report>
<report>maven-checkstyle-plugin</report>
<report>maven-changelog-plugin</report>
<report>maven-file-activity-plugin</report>
<report>maven-developer-activity-plugin</report>
<report>maven-tasklist-plugin</report>
<report>maven-jxr-plugin</report>
</reports>
</project>

View File

@@ -1,141 +0,0 @@
package org.apache.maven.cactus.sample;
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Maven" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Maven", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* ====================================================================
*/
import java.io.IOException;
import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.BodyTagSupport;
/**
* Sample tag that interacts with its body. The tag acts as a filter for its
* body. "Target" and "Replacement" Strings are defined by the tag's attributes
* and each "occurrence" of the target is replaced by the "replacement".
*
* @author <a href="mailto:nick@eblox.com">Nicholas Lesiecki</a>
*
* @version $Id: SampleBodyTag.java,v 1.2 2003/08/19 04:45:06 dion Exp $
*/
public class SampleBodyTag extends BodyTagSupport {
/**
* The substring to be replaced in the body.
*/
private String target;
/**
* The substring that will replace the target in the body.
*/
private String replacement;
/**
* Sets the substring to be replaced in the body.
*
* @param theTarget the substring to be replaced in the body
*/
public void setTarget(String theTarget) {
this.target = theTarget;
}
/**
* Sets the substring that will replace the target in the body.
*
* @param theReplacement the replacement string
*/
public void setReplacement(String theReplacement) {
this.replacement = theReplacement;
}
/**
* @see BodyTagSupport#doAfterBody()
*/
public int doAfterBody() throws JspTagException {
String contentString = this.bodyContent.getString();
StringBuffer contentBuffer = new StringBuffer(contentString);
int beginIndex = -1;
int targetLength = this.target.length();
// while instances of target still exist
while ((beginIndex = contentString.indexOf(this.target)) > -1) {
int endIndex = beginIndex + targetLength;
contentBuffer.replace(beginIndex, endIndex, this.replacement);
contentString = contentBuffer.toString();
}
// write out the changed body
JspWriter pageWriter = this.bodyContent.getEnclosingWriter();
try {
pageWriter.write(contentString);
} catch (IOException e) {
throw new JspTagException(e.getMessage());
}
return SKIP_BODY;
}
/**
* @see BodyTagSupport#release()
*/
public void release() {
this.target = null;
this.replacement = null;
}
}

View File

@@ -1,173 +0,0 @@
package org.apache.maven.cactus.sample;
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Maven" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Maven", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* ====================================================================
*/
import java.io.IOException;
import java.io.OutputStream;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletResponse;
import org.apache.maven.cactus.sample.util.GenericResponseWrapper;
/**
* Sample filter that implements some very simple business logic. The goal is
* to provide some functional tests for Cactus and examples for Cactus users.
* This filter simply adds a header and a footer to the returned HTML.
*
* @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
*
* @version $Id: SampleFilter.java,v 1.2 2003/08/19 04:45:06 dion Exp $
*/
public class SampleFilter implements Filter {
/**
* We need to save the filter config as the Fitler API does not offer
* a means to get the filter config ... except in the <code>init()</code>
*/
private FilterConfig config;
/**
* Filter initialisation. Called by the servlet engine during the life
* cycle of the filter.
*
* @param theConfig the filter config
*
* @exception ServletException on failure
*/
public void init(FilterConfig theConfig) throws ServletException {
this.config = theConfig;
}
/**
* Perform the filter function. Called by the container upon a request
* matching the filter pattern defined in <code>web.xml</code>.
*
* @param theRequest the incmoing HTTP request
* @param theResponse the returned HTTP response
* @param theChain the chain of filters extracted from the definition
* given in <code>web.xml</code> by the container.
*
* @exception ServletException on failure
* @exception IOException on failure
*/
public void doFilter(ServletRequest theRequest,
ServletResponse theResponse, FilterChain theChain) throws IOException,
ServletException {
OutputStream out = theResponse.getOutputStream();
addHeader(out);
// Create a wrapper of the response so that we can later write to
// the response (add the footer). If we did not do this, we would
// get an error saying that the response has already been
// committed.
GenericResponseWrapper wrapper =
new GenericResponseWrapper((HttpServletResponse) theResponse);
theChain.doFilter(theRequest, wrapper);
out.write(wrapper.getData());
addFooter(out);
out.close();
}
/**
* Write the header to the output stream. The header text is extracted
* from a filter initialisation parameter (defined in
* <code>web.xml</code>). Don't write anything if no parameter is defined.
*
* @param theOutputStream the output stream
*
* @exception IOException on failure
*/
protected void addHeader(OutputStream theOutputStream) throws IOException {
String header = this.config.getInitParameter("header");
if (header != null) {
theOutputStream.write(header.getBytes());
}
}
/**
* Write the footer to the output stream. The footer text is extracted
* from a filter initialisation parameter (defined in
* <code>web.xml</code>). Don't write anything if no parameter is defined.
*
* @param theOutputStream the output stream
*
* @exception IOException on failure
*/
protected void addFooter(OutputStream theOutputStream) throws IOException {
String footer = this.config.getInitParameter("footer");
if (footer != null) {
theOutputStream.write(footer.getBytes());
}
}
/**
* Filter un-initialisation. Called by the servlet engine during the life
* cycle of the filter.
*/
public void destroy() {
}
}

View File

@@ -1,96 +0,0 @@
package org.apache.maven.cactus.sample;
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Maven" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Maven", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* ====================================================================
*/
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
/**
* Sample servlet that implements some very simple business logic. The goal is
* to provide some functional tests for Cactus and examples for Cactus users.
* This servlet simply checks is a user is authenticated
*
* @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
* @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
*
* @version $Id: SampleServlet.java,v 1.2 2003/08/19 04:45:06 dion Exp $
*/
public class SampleServlet extends HttpServlet {
/**
*Take a request object and return whether the user is authenticated o not.
*
* @param request the HttpServletRequest object
*
* @return boolean whether the request is by an authenticated user or not
*
*/
public boolean isAuthenticated(HttpServletRequest request) {
HttpSession session = request.getSession(false);
if (session == null) {
return false;
}
String authenticationAttribute =
(String) session.getAttribute("authenticated");
return new Boolean(authenticationAttribute).booleanValue();
}
}

View File

@@ -1,118 +0,0 @@
package org.apache.maven.cactus.sample.util;
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Maven" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Maven", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* ====================================================================
*/
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import javax.servlet.ServletOutputStream;
/**
* Helper class to help write filters that manipulates the output stream. This
* is because normally, the <code>ServletOutputStream</code> cannot be
* modified after a resource has committed it.
*
* Note: This code was adapted from the Filter tutorial found
* {@link <a href="http://www.orionserver.com/tutorials/filters/lesson3/">
* here</a>}
*
* @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
*
* @version $Id: FilterServletOutputStream.java,v 1.2 2003/08/19 04:45:07 dion Exp $
*
* @see GenericResponseWrapper
*/
public class FilterServletOutputStream extends ServletOutputStream {
/**
* The stream where all the data will get written to
*/
private DataOutputStream stream;
/**
* Constructor.
*
* @param theOutput the output stream that we wrap in a
* <code>DataOutputStream</code> in order to hold the data
*/
public FilterServletOutputStream(OutputStream theOutput) {
stream = new DataOutputStream(theOutput);
}
// Overriden methods from ServletOutputStream ----------------------------
/**
* @see ServletOutputStream#write(int)
*/
public void write(int b) throws IOException {
stream.write(b);
}
/**
* @see ServletOutputStream#write(byte[])
*/
public void write(byte[] b) throws IOException {
stream.write(b);
}
/**
* @see ServletOutputStream#write(byte[], int, int)
*/
public void write(byte[] b, int off, int len) throws IOException {
stream.write(b, off, len);
}
}

View File

@@ -1,170 +0,0 @@
package org.apache.maven.cactus.sample.util;
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Maven" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Maven", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* ====================================================================
*/
import java.io.ByteArrayOutputStream;
import java.io.PrintWriter;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;
/**
* Wrapper around a <code>HttpServletResponse</code> that we use to easily
* write filters that manipulate the output stream. Indeed, we cannot pass
* the output stream of our filter direectly to the next filter in the chain
* because then we won't be able to write to it (the response will have been
* committed). Instead, we pass this wrapper class and then copy its data
* to our filter output stream.
*
* Note: This code was adapted from the Filter tutorial found
* {@link <a href="http://www.orionserver.com/tutorials/filters/lesson3/">
* here</a>}
*
* @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
*
* @version $Id: GenericResponseWrapper.java,v 1.2 2003/08/19 04:45:07 dion Exp $
*
* @see FilterServletOutputStream
*/
public class GenericResponseWrapper extends HttpServletResponseWrapper {
/**
* Holder for the output data
*/
private ByteArrayOutputStream output;
/**
* Save the content length so that we can query it at a later time
* (otherwise it would not be possible as
* <code>HttpServletResponseWrapper</code> does not have a method to get
* the content length).
*/
private int contentLength;
/**
* Save the content type so that we can query it at a later time
* (otherwise it would not be possible as
* <code>HttpServletResponseWrapper</code> does not have a method to get
* the content type).
*/
private String contentType;
// Constructors ----------------------------------------------------------
/**
* @param theResponse the wrapped response object
*/
public GenericResponseWrapper(HttpServletResponse theResponse) {
super(theResponse);
this.output = new ByteArrayOutputStream();
}
// New methods -----------------------------------------------------------
/**
* @return the data sent to the output stream
*/
public byte[] getData() {
return output.toByteArray();
}
// Overridden methods ----------------------------------------------------
/**
* @see HttpServletResponseWrapper#getOutputStream()
*/
public ServletOutputStream getOutputStream() {
return new FilterServletOutputStream(this.output);
}
/**
* @see HttpServletResponseWrapper#setContentLength(int)
*/
public void setContentLength(int theLength) {
this.contentLength = theLength;
super.setContentLength(theLength);
}
/**
* @see HttpServletResponseWrapper#getContentLength()
*/
public int getContentLength() {
return this.contentLength;
}
/**
* @see HttpServletResponseWrapper#setContentType(String)
*/
public void setContentType(String theType) {
this.contentType = theType;
super.setContentType(theType);
}
/**
* @see HttpServletResponseWrapper#getContentType()
*/
public String getContentType() {
return this.contentType;
}
/**
* @see HttpServletResponseWrapper#getWriter()
*/
public PrintWriter getWriter() {
return new PrintWriter(getOutputStream(), true);
}
}

View File

@@ -1,127 +0,0 @@
package org.apache.maven.cactus.sample;
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Maven" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Maven", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* ====================================================================
*/
import java.io.IOException;
import java.io.PrintWriter;
import org.apache.cactus.ServletTestCase;
/**
* Test the HtppUnit integration.
*
* @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
*
* @version $Id: TestHttpUnitIntegration.java,v 1.2 2003/08/19 04:45:06 dion Exp $
*/
public class TestHttpUnitIntegration extends ServletTestCase
{
/**
* Verify that the HttpUnit integration works.
*
* @exception IOException on test failure
*/
public void testHttpUnitGetText() throws IOException
{
PrintWriter pw = response.getWriter();
pw.print("something to return for the test");
}
/**
* Verify that HttpUnit integration works
*
* @param theResponse the response from the server side.
*
* @exception IOException on test failure
*/
public void endHttpUnitGetText(
com.meterware.httpunit.WebResponse theResponse) throws IOException
{
String text = theResponse.getText();
assertEquals("something to return for the test", text);
}
//-------------------------------------------------------------------------
/**
* Verify that we can set several headers in the response and
* assert them in endXXX().
*/
public void testResponseAddHeadersHttpUnit()
{
response.addHeader("X-Access-Header1", "value1");
response.addHeader("X-Access-Header2", "value2");
}
/**
* Verify that we can set several headers in the response and
* assert them in endXXX().
*
* @param theResponse the response from the server side.
*/
public void endResponseAddHeadersHttpUnit(
com.meterware.httpunit.WebResponse theResponse)
{
String value1 = theResponse.getHeaderField("X-Access-Header1");
String value2 = theResponse.getHeaderField("X-Access-Header2");
assertEquals("value1", value1);
assertEquals("value2", value2);
}
}

View File

@@ -1,170 +0,0 @@
package org.apache.maven.cactus.sample;
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Maven" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Maven", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* ====================================================================
*/
import javax.servlet.jsp.tagext.BodyContent;
import javax.servlet.jsp.tagext.BodyTag;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.apache.cactus.JspTestCase;
import org.apache.cactus.WebResponse;
/**
* Tests of the <code>SampleBodyTag</code> class.
*
* @author <a href="mailto:nick@eblox.com">Nciholas Lesiecki</a>
*
* @version $Id: TestSampleBodyTag.java,v 1.3 2003/08/19 04:45:06 dion Exp $
*/
public class TestSampleBodyTag extends JspTestCase
{
private SampleBodyTag tag;
private BodyContent tagContent;
/**
* Defines the testcase name for JUnit.
*
* @param theName the testcase's name.
*/
public TestSampleBodyTag(String theName)
{
super(theName);
}
/**
* Start the tests.
*
* @param theArgs the arguments. Not used
*/
public static void main(String[] theArgs)
{
junit.swingui.TestRunner.main(
new String[] { TestSampleBodyTag.class.getName() });
}
/**
* @return a test suite (<code>TestSuite</code>) that includes all methods
* starting with "test"
*/
public static Test suite()
{
// All methods starting with "test" will be executed in the test suite.
return new TestSuite(TestSampleBodyTag.class);
}
/**
* In addition to creating the tag instance and adding the pageContext to
* it, this method creates a BodyContent object and passes it to the tag.
*/
public void setUp()
{
this.tag = new SampleBodyTag();
this.tag.setPageContext(this.pageContext);
//create the BodyContent object and call the setter on the tag instance
this.tagContent = this.pageContext.pushBody();
this.tag.setBodyContent(this.tagContent);
}
//-------------------------------------------------------------------------
/**
* Sets the replacement target and replacement String on the tag, then calls
* doAfterBody(). Most of the assertion work is done in endReplacement().
*/
public void testReplacement() throws Exception
{
//set the target and the String to replace it with
this.tag.setTarget("@target@");
this.tag.setReplacement("replacement");
//add the tag's body by writing to the BodyContent object created in
//setUp()
this.tagContent.println("@target@ is now @target@");
this.tagContent.println("@target@_@target@");
//none of the other life cycle methods need to be implemented, so they
//do not need to be called.
int result = this.tag.doAfterBody();
assertEquals(BodyTag.SKIP_BODY, result);
}
public void tearDown()
{
//necessary for tag to output anything on most servlet engines.
this.pageContext.popBody();
}
/**
* Verifies that the target String has indeed been replaced in the tag's
* body.
*/
public void endReplacement(WebResponse theResponse)
{
String content = theResponse.getText();
assertTrue("Response should have contained the ["
+ "replacement is now replacement] string",
content.indexOf("replacement is now replacement") > -1);
assertTrue("Response should have contained the ["
+ "replacement_replacement] string",
content.indexOf("replacement") > -1);
}
}

View File

@@ -1,259 +0,0 @@
package org.apache.maven.cactus.sample;
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Maven" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Maven", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* ====================================================================
*/
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.apache.cactus.FilterTestCase;
import org.apache.cactus.WebResponse;
/**
* Tests of the <code>SampleFilter</code> filter class.
*
* @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
*
* @version $Id: TestSampleFilter.java,v 1.2 2003/08/19 04:45:06 dion Exp $
*/
public class TestSampleFilter extends FilterTestCase
{
/**
* Defines the testcase name for JUnit.
*
* @param theName the testcase's name.
*/
public TestSampleFilter(String theName)
{
super(theName);
}
/**
* Start the tests.
*
* @param theArgs the arguments. Not used
*/
public static void main(String[] theArgs)
{
junit.swingui.TestRunner.main(
new String[] { TestSampleFilter.class.getName() });
}
/**
* @return a test suite (<code>TestSuite</code>) that includes all methods
* starting with "test"
*/
public static Test suite()
{
// All methods starting with "test" will be executed in the test suite.
return new TestSuite(TestSampleFilter.class);
}
//-------------------------------------------------------------------------
/**
* Test that adding a header to the output stream is working fine when
* a header parameter is defined.
*
* @exception ServletException on test failure
* @exception IOException on test failure
*/
public void testAddHeaderParamOK() throws ServletException, IOException
{
SampleFilter filter = new SampleFilter();
config.setInitParameter("header", "<h1>header</h1>");
filter.init(config);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
filter.addHeader(baos);
assertEquals("<h1>header</h1>", baos.toString());
}
//-------------------------------------------------------------------------
/**
* Test that adding a header to the output stream is working fine
* (i.e. nothing gets written) when no header parameter is defined.
*
* @exception ServletException on test failure
* @exception IOException on test failure
*/
public void testAddHeaderParamNotDefined() throws ServletException,
IOException
{
SampleFilter filter = new SampleFilter();
filter.init(config);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
filter.addHeader(baos);
assertEquals("", baos.toString());
}
//-------------------------------------------------------------------------
/**
* Test that adding a footer to the output stream is working fine when
* a footer parameter is defined.
*
* @exception ServletException on test failure
* @exception IOException on test failure
*/
public void testAddFooterParamOK() throws ServletException, IOException
{
SampleFilter filter = new SampleFilter();
config.setInitParameter("footer", "<h1>footer</h1>");
filter.init(config);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
filter.addFooter(baos);
assertEquals("<h1>footer</h1>", baos.toString());
}
//-------------------------------------------------------------------------
/**
* Test that adding a footer to the output stream is working fine
* (i.e. nothing gets written) when no footer parameter is defined.
*
* @exception ServletException on test failure
* @exception IOException on test failure
*/
public void testAddFooterParamNotDefined() throws ServletException,
IOException
{
SampleFilter filter = new SampleFilter();
filter.init(config);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
filter.addFooter(baos);
assertEquals("", baos.toString());
}
//-------------------------------------------------------------------------
/**
* Test that the filter does correctly add a header and footer to
* any requets it is serving.
*
* @exception ServletException on test failure
* @exception IOException on test failure
*/
public void testDoFilterOK() throws ServletException, IOException
{
SampleFilter filter = new SampleFilter();
config.setInitParameter("header", "<h1>header</h1>");
config.setInitParameter("footer", "<h1>footer</h1>");
filter.init(config);
FilterChain mockFilterChain = new FilterChain()
{
public void doFilter(ServletRequest theRequest,
ServletResponse theResponse) throws IOException,
ServletException
{
PrintWriter writer = theResponse.getWriter();
writer.print("<p>some content</p>");
writer.close();
}
public void init(FilterConfig theConfig)
{
}
public void destroy()
{
}
};
filter.doFilter(request, response, mockFilterChain);
}
/**
* Test that the filter does correctly add a header and footer to
* any requets it is serving.
*
* @param theResponse the response from the server side.
*/
public void endDoFilterOK(WebResponse theResponse)
{
assertEquals("<h1>header</h1><p>some content</p><h1>footer</h1>",
theResponse.getText());
}
}

View File

@@ -1,97 +0,0 @@
package org.apache.maven.cactus.sample;
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Maven" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Maven", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* ====================================================================
*/
import org.apache.cactus.ServletTestCase;
import org.apache.cactus.WebRequest;
public class TestSampleServlet extends ServletTestCase
{
public TestSampleServlet(String testName)
{
super(testName);
}
public void testIsAuthenticatedAuthenticated()
{
SampleServlet servlet = new SampleServlet();
session.setAttribute("authenticated", "true");
assertTrue(servlet.isAuthenticated(request));
}
public void testIsAuthenticatedNotAuthenticated()
{
SampleServlet servlet = new SampleServlet();
assertTrue(!servlet.isAuthenticated(request));
}
public void beginIsAuthenticatedNoSession(WebRequest request)
{
request.setAutomaticSession(false);
}
public void testIsAuthenticatedNoSession()
{
SampleServlet servlet = new SampleServlet();
assertTrue(!servlet.isAuthenticated(request));
}
}

View File

@@ -1,4 +0,0 @@
<!-- Do not delete -->
<!-- Some sample resource file to verify that non java source files
are correctly copied by the cactus:compile goal -->

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
</web-app>

View File

@@ -1,273 +0,0 @@
<?xml version="1.0"?>
<jsl:stylesheet
select="$doc"
xmlns:j="jelly:core"
xmlns:jsl="jelly:jsl"
xmlns:x="jelly:xml"
xmlns:define="jelly:define"
xmlns:util="jelly:util"
xmlns:junit="junit"
xmlns:doc="doc"
trim="false">
<!-- This needs to be instantiated here to be available in the template matches -->
<j:useBean var="mavenTool" class="org.apache.maven.util.MavenTool"/>
<j:useBean var="numbers" class="java.text.DecimalFormat"/>
<j:useBean var="htmlescape" class="org.apache.velocity.anakia.Escape"/>
<j:useBean var="formatter" class="org.apache.maven.util.DVSLFormatter"/>
<j:useBean var="fileutil" class="org.apache.velocity.texen.util.FileUtil"/>
<j:useBean var="pathtool" class="org.apache.maven.util.DVSLPathTool"/>
<define:taglib uri="junit">
<define:tag name="nav">
<p>
[
<a href="#Summary">summary</a>]
[
<a href="#Package List">package list</a>]
[
<a href="#Test Cases">test cases</a>]
</p>
</define:tag>
<define:tag name="testSuiteHeader">
<tr>
<th>Name</th>
<th>Tests</th>
<th>Errors</th>
<th>Failures</th>
<th>Time(s)</th>
</tr>
</define:tag>
<define:tag name="testCaseHeader">
<tr>
<th>Name</th>
<th>Status</th>
<th>Type</th>
<th>Time(s)</th>
</tr>
</define:tag>
<define:tag name="displayFailure">
<j:choose>
<j:when test="${current.attribute('message') != null}">
${htmlescape.getText(current.attribute('message').value)}
</j:when>
<j:otherwise>
N/A
</j:otherwise>
</j:choose>
<p/>
<j:if test="${current.value() != null}">
<code>
${htmlescape.getText(current.value())}
</code>
</j:if>
</define:tag>
</define:taglib>
<jsl:template match="testsuites">
<document>
<properties>
<title>JUnit Test Results</title>
</properties>
<body>
<section name="Summary">
<junit:nav/>
<j:set var="testCount"><x:expr select="sum(testsuite/@tests)"/></j:set>
<j:set var="errorCount"><x:expr select="sum(testsuite/@errors)"/></j:set>
<j:set var="failureCount"><x:expr select="sum(testsuite/@failures)"/></j:set>
<j:set var="timeCount"><x:expr select="sum(testsuite/@time)"/></j:set>
<j:set var="successRate"><x:expr select="($testCount - ($failureCount + $errorCount)) div $testCount"/></j:set>
<table>
<tr>
<th>Tests</th>
<th>Errors</th>
<th>Failures</th>
<th>Success rate</th>
<th>Time(s)</th>
</tr>
<tr>
<td>
<doc:formatAsNumber string="${testCount}" pattern="0"/>
</td>
<td>
<doc:formatAsNumber string="${errorCount}" pattern="0"/>
</td>
<td>
<doc:formatAsNumber string="${failureCount}" pattern="0"/>
</td>
<td>
<doc:formatAsNumber string="${successRate}" pattern="0.00%"/>
</td>
<td>
<doc:formatAsNumber string="${timeCount}" pattern="0.00"/>
</td>
</tr>
</table>
<p>
Note:
<i>failures</i> are anticipated and checked for with
assertions while
<i>errors</i> are unanticipated.
</p>
</section>
<section name="Package List">
<junit:nav/>
<table>
<!--
<junit:testSuiteHeader/>
-->
<x:set var="testsuites" select="./testsuite[not(./@package = preceding-sibling::testsuite/@package)]"/>
<j:forEach var="testsuite" items="${testsuites}">
<j:set var="package" value="${testsuite.attribute('package').value}"/>
<x:set var="quotedPackage" select='"${package}"'/>
<j:set var="testCount"><x:expr select="sum(./testsuite[./@package = $quotedPackage]/@tests)"/></j:set>
<j:set var="errorCount"><x:expr select="sum(./testsuite[./@package = $quotedPackage]/@errors)"/></j:set>
<j:set var="failureCount"><x:expr select="sum(./testsuite[./@package = $quotedPackage]/@failures)"/></j:set>
<j:set var="timeCount"><x:expr select="sum(./testsuite[./@package = $quotedPackage]/@time)"/></j:set>
<tr>
<td>
<a href="#${package}">${package}</a>
</td>
<td>
<doc:formatAsNumber string="${testCount}" pattern="0"/>
</td>
<td>
<doc:formatAsNumber string="${failureCount}" pattern="0"/>
</td>
<td>
<doc:formatAsNumber string="${errorCount}" pattern="0"/>
</td>
<td>
<doc:formatAsNumber string="${timeCount}" pattern="0.00"/>
</td>
</tr>
</j:forEach>
</table>
<p>
Note: package statistics are not computed recursively, they only
sum up all of its testsuites numbers.
</p>
<j:forEach var="testsuite" items="${testsuites}">
<j:set var="package" value="${testsuite.attribute('package').value}"/>
<x:set var="quotedPackage" select='"${package}"'/>
<a name="${package}"></a>
<subsection name="${package}">
<table>
<!--
<junit:testSuiteHeader/>
-->
<x:forEach var="test" select="/testsuites/testsuite[./@package = $quotedPackage]">
<tr>
<td>
<a href="#${test.attribute('name').value}">${test.attribute('name').value}</a>
</td>
<td>
<doc:formatAsNumber string="${test.attribute('tests').value}" pattern="0"/>
</td>
<td>
<doc:formatAsNumber string="${test.attribute('errors').value}" pattern="0"/>
</td>
<td>
<doc:formatAsNumber string="${test.attribute('failures').value}" pattern="0"/>
</td>
<td>
<doc:formatAsNumber string="${test.attribute('time').value}" pattern="0.000"/>
</td>
</tr>
</x:forEach>
</table>
</subsection>
</j:forEach>
</section>
<section name="Test Cases">
<junit:nav/>
<x:set var="testsuites" select="./testsuite"/>
<j:forEach var="testsuite" items="${testsuites}">
<a name="${testsuite.attribute('name').value}"></a>
<subsection name="${testsuite.attribute('name').value}">
<table>
<!--
<junit:testCaseHeader/>
-->
## test can even not be started at all (failure to load the class)
## so report the error directly
##
<x:set var="errors" select="$testsuite/error"/>
<j:forEach var="error" items="${errors}">
<tr>
<td colspan="4">
<junit:displayFailure current="${error}"/>
</td>
</tr>
</j:forEach>
<x:set var="testcases" select="$testsuite/testcase"/>
<j:forEach var="testcase" items="${testcases}">
<j:set var="failure" value="${testcase.selectSingleNode('failure')}"/>
<j:set var="error" value="${testcase.selectSingleNode('error')}"/>
<tr>
<td>${testcase.attribute("name").value}</td>
<j:choose>
<j:when test="${failure != null}">
<td style="width: 60px; color: red; font-weight: bold">Failure</td>
</j:when>
<j:when test="${error != null}">
<td style="width: 60px; color: red; font-weight: bold">Error</td>
</j:when>
<j:otherwise>
<td style="width: 60px;">Success</td>
</j:otherwise>
</j:choose>
<j:choose>
<j:when test="${testcase.attribute('time') != null}">
<td width="60px">
<doc:formatAsNumber string="${testcase.attribute('time').value}" pattern="0.00"/>
</td>
</j:when>
<j:otherwise>
<td width="60px"></td>
</j:otherwise>
</j:choose>
</tr>
<j:choose>
<j:when test="${failure != null}">
<tr>
<td colspan="3" style="padding-left: 50px">
<junit:displayFailure current="${failure}"/>
</td>
</tr>
</j:when>
<j:when test="${error != null}">
<tr>
<td colspan="3" style="padding-left: 50px">
<junit:displayFailure current="${error}"/>
</td>
</tr>
</j:when>
</j:choose>
</j:forEach>
</table>
</subsection>
</j:forEach>
</section>
</body>
</document>
</jsl:template>
</jsl:stylesheet>

View File

@@ -1,3 +0,0 @@
<jboss-web>
<security-domain>java:/jaas/other</security-domain>
</jboss-web>

View File

@@ -1,2 +0,0 @@
testuser=test
admin=JBossAdmin

View File

@@ -1,2 +0,0 @@
testuser=testpassword
admin=admin

View File

@@ -1 +0,0 @@
stylesheets

View File

@@ -1,217 +0,0 @@
<?xml version="1.0"?>
<document>
<properties>
<title>Changes</title>
<author email="vmassol@apache.org">Vincent Massol</author>
</properties>
<body>
<release version="3.2" date="in CVS">
<action dev="vmassol" type="fix">
Added documentation for <code>cactus.bundle</code> property that
can be used in POM dependency list. This fixes bug
<a href="http://jira.codehaus.org/secure/ViewIssue.jspa?key=MAVEN-901">MAVEN-901</a>
</action>
<action dev="vmassol" type="update">
Updated to use Cactus 1.5-rc1, HttpClient 2.0 rc2 and AspectJ 1.1.1.
</action>
</release>
<release version="3.1" date="2003-09-15">
<action dev="vmassol" type="add">
New <code>cactus:jar-install</code> goal to install the Cactus
jar in the local Maven repository. This is useful if you wish to
put Cactus test classes in one Maven project and execute the
Cactus tests in another project.
</action>
<action dev="vmassol" type="add">
New <code>cactus:jar</code> goal to generate a jar containing
the Cactus test classes.
</action>
<action dev="vmassol" type="add">
Added new <code>cactus.tmp.dir</code> optional property to specify
a location where Cactus will put its temporary files (mostly where
it setup containers for execution). Defaults to
<code>[java.io.tmpdir]/[containername]</code>.
</action>
<action dev="vmassol" type="update">
Generate the Cactus test reports in the Cactus reports directory
instead of directly in the Maven build directory. This fixes bug
<a href="http://jira.codehaus.org/secure/ViewIssue.jspa?key=MAVEN-669">MAVEN-669</a>
and
<a href="http://jira.codehaus.org/secure/ViewIssue.jspa?key=MAVEN-671">MAVEN-671</a>.
</action>
<action dev="vmassol" type="update">
Updated commons-httpclient dependency to 2.0 rc1, httpunit to
1.5.3 and nekohtml to 0.7.7.
</action>
<action dev="vmassol" type="add">
Added new optional property <code>cactus.weblogic7x.beahome</code> to
configure the location of BEA HOME for the WebLogic 7.x container. It
is only needed if the BEA HOME location is not the parent
directory of <code>cactus.home.weblogic7x</code>.
</action>
<action dev="vmassol" type="add">
Added back support for WebLogic 7.x (it had somehow been dropped
when we moved to the new Cactus/Ant integration in version 3.0).
</action>
<action dev="vmassol" type="update">
Updated to Cactus 1.6dev-20030830 which has fixes for WebLogic 7.x
support.
</action>
</release>
<release version="3.0" date="2003-08-05">
<action dev="dion" type="update">
Upgrade to commons-logging 1.0.3
</action>
<action dev="epugh" type="add">
New goal cactus:match added that allows you to run just matching testcases.
Pass the testcase in using -Dtestmatch=MyTestCase. This brings to parity the
cactus plugin with the test plugin for running types of tests.
</action>
<action dev="epugh" type="add">
New goal cactus:single added that allows you to run just a single testcase.
Pass the testcase in using -Dtestcase=my.single.TestCase.
</action>
<action dev="evenisse" type="fix">
Add xml declaration to generated report. Fixed for character encoding.
</action>
<action dev="epugh" type="add">
Ability to optionally specify for Tomcat 4x and 5x a directory to which
the container will be installed for the tests.
</action>
<action dev="vmassol" type="add">
Add all user jars that have been marked to be included in the cactus
test (with the
<code>&lt;cactus.bundle&gt;true&lt;/cactus.bundle&gt;</code> property
in dependencies). For example, DBUnit would be a jar you would
include in a Cactus test but not in a runtime war.
</action>
<action dev="vmassol" type="fix">
Updated to Cactus/Ant of 19th of June 2003 which fixes a bug
preventing JBoss to start correctly on unix machines (caused by
an invalid URL file format on unix. Thanks to Chris Lenz for
fixing it.
</action>
<action dev="vmassol" type="fix">
The <code>cactus:compile</code> goal now correctly copy the non
java files to the target class directory. Thanks to Florin Vancea for
reporting this bug. This fixes bug
<a href="http://jira.codehaus.org/secure/ViewIssue.jspa?key=MAVEN-478">MAVEN-478</a>.
</action>
<action dev="vmassol" type="update">
Major change: updated to use the Cactus/Ant integration built after
23rd of May 2003 (it is completely different from the Cactus/Ant
integration used in version 2.0.
</action>
</release>
<release version="2.0" date="2003-04-08">
<action dev="vmassol" type="update">
Complete rework of the plugin to use the Cactus/Ant Integration
module from the Cactus project. Now using Cactus 1.5dev for J2EE
1.3, built from CVS on 7th of April 2003. Thus the Plugin feature
are now those of the Cactus/Ant Integration module.
</action>
</release>
<release version="1.2" date="2003-03-22">
<action dev="epugh" type="fix">
Upgraded scripts to work with Maven beta 8.
</action>
<action dev="epugh" type="fix">
Checkstyle fixes for included Sample webapp.
</action>
<action dev="epugh" type="add">
Add new target <code>cactus:test</code> that runs tests for
all containers with a
<code>maven.cactus.[container].home</code> property set.
</action>
<action dev="epugh" type="fix">
<code>cactus:single</code> now builds all the code and then runs
the testcase specified by the property
<code>mavencactustestcase</code>. Example
<code>maven cactus:single
-Dmavencactustestcase=com.my.company.EasyTest</code>.
</action>
<action dev="epugh" type="fix">
Commented out dvsl merging of web.xml due to changes in Maven.
Instead uses either included default web.xml or one provided by
<code>maven.cactus.webxml</code>.
</action>
<action dev="vmassol" type="add">
Added Checkstyle report to Cactus plugin web site.
</action>
<action dev="vmassol" type="fix">
The plugin now works even if not connected to the internet.
</action>
<action dev="vmassol" type="fix" due-to="Eric Pugh" due-to-email="EPugh@upstate.com">
Fixed problem when the <code>web.xml</code> of the application to
test was defining security configuration. The Cactus was adding its
own but the web.xml DTD only supports one. The new implementation
discards the application security information which is replaced by
the Cactus definition.
</action>
</release>
<release version="1.1" date="2002-11-16">
<action dev="vmassol" type="add">
Added support for HttpUnit integration out of the box (i.e. the
HttpUnit jars are automatically added by the Cactus plugin).
</action>
<action dev="vmassol" type="add">
Ability to exclude Cactus tests (for long running tests for example,
in debug period).
</action>
<action dev="vmassol" type="update">
The <code>web.xml</code> elements required for Cactus are now
automatically added to the user project <code>web.xml</code>.
</action>
<action dev="vmassol" type="add">
Added support for running the tests using the JUnit Swing Test Runner.
Simply create the following Maven property
<code>maven.cactus.testrunner = swing</code> to use the Swing Test
Runner.
</action>
<action dev="vmassol" type="add">
Added automatic discovery of Cactus Test Cases and ignore test support
classes.
</action>
<action dev="vmassol" type="update">
Creation of the project war/webapp is now left to the Maven War plugin.
Cactus repackages it by adding the Cactus tests, the Cactus
configuration files and the Cactus external jars. Thus, the Cactus
plugin now supports the "war:webapp" goal.
</action>
<action dev="vmassol" type="update">
Improved documentation: "news" section on front page and improved
"Quick Start" page.
</action>
<action dev="vmassol" type="add">
Support for WebLogic 7.x.
</action>
</release>
<release version="1.0" date="2002-11-06">
<action dev="vmassol" type="add">
Sample project showing how to use the Cactus plugin.
</action>
<action dev="vmassol" type="add">
Generates HTML reports
</action>
<action dev="vmassol" type="add">
Support for Resin 2.x.
</action>
<action dev="vmassol" type="add">
Support for Tomcat 4.x (supports hot redeploy).
</action>
<action dev="vmassol" type="add">
Creation of the Cactus plugin
</action>
</release>
</body>
</document>

View File

@@ -1,36 +0,0 @@
<?xml version="1.0"?>
<document>
<properties>
<title>Features of the Cactus plugin</title>
<author email="vmassol@apache.org">Vincent Massol</author>
</properties>
<body>
<section name="Cactus Plug-in Features">
<p>
The Cactus plugin for Maven uses the
<a href="http://jakarta.apache.org/cactus">Cactus/Ant
integration</a> module. Thus benefits from all its features.
</p>
<p>
Some jars are used only for testing (for example, DbUnit). These
jars can be entered as dependencies in the <code>project.xml</code>
and tagged with <code>cactus.bundle</code>. When the Cactus plugin
finds such jars it will automatically add them to the deployed war.
For example:
</p>
<source><![CDATA[
<dependency>
<groupId>dbunit</groupId>>
<artifactId>dbunit</artifactId>>
<version>1.5.5</version>
<properties>
<cactus.bundle>true</cactus.bundle>
</properties>
</dependency>
]]></source>
</section>
</body>
</document>

View File

@@ -1,78 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<document>
<properties>
<title>Maven cactus Plug-in Goals</title>
<author email="dion@apache.org">dIon Gillard</author>
<author email="vmassol@apache.org">Vincent Massol</author>
</properties>
<body>
<goals>
<goal>
<name>cactus:compile</name>
<description>
Compiles the Cactus tests.
</description>
</goal>
<goal>
<name>cactus:cactifywar</name>
<description>
Creates a Cactus-ready war from the application war (depends
on <code>war:war</code>).
</description>
</goal>
<goal>
<name>cactus:test</name>
<description>
Run the Cactus tests on the containers for which you have defined
a <code>cactus.home.[container name]</code> property.
</description>
</goal>
<goal>
<name>cactus:single</name>
<description>
Run a single Cactus test on the containers for which you have defined
a <code>cactus.home.[container name]</code> property. Pass the name
of the testcase in using -Dtestcase=my.single.TestCase.
</description>
</goal>
<goal>
<name>cactus:match</name>
<description>
Run all Cactus tests that match a property <code>-Dtestmatch=MyTestCase</code>
on the containers for which you have defined
a <code>cactus.home.[container name]</code> property.
</description>
</goal>
<goal>
<name>cactus:report</name>
<description>
Generate an HTML report for the Cactus tests that been run. In order
to get this report as part of the generated web site, add the
following to your <code>project.xml</code>:
<source><![CDATA[
<reports>
[...]
<report>maven-cactus-plugin</report>
[...]
</reports>
]]></source>
</description>
</goal>
<goal>
<name>cactus:jar</name>
<description>
Generate a jar containing the Cactus test classes.
</description>
</goal>
<goal>
<name>cactus:jar</name>
<description>
Deploy the Cactus jar to the local Maven repository. This is
useful if you wish to put Cactus test classes in one Maven
project and execute the Cactus tests in another Maven project.
</description>
</goal>
</goals>
</body>
</document>

View File

@@ -1,93 +0,0 @@
<?xml version="1.0"?>
<document>
<properties>
<title>Maven Cactus Plug-in</title>
<author email="vmassol@apache.org">Vincent Massol</author>
</properties>
<body>
<section name="Maven Cactus Plug-in">
<p>
This is a plugin for
<a href="http://jakarta.apache.org/cactus">Cactus</a> that
allows to automatically start containers, run Cactus tests and stop
the containers.
</p>
<p>
Currently, this plugin only supports the Servlet API 2.3.
</p>
</section>
<section name="News">
<table>
<tr>
<th>Date</th>
<th>Description</th>
</tr>
<tr>
<td>26 Oct 2003</td>
<td>
Release of version 3.2. Read the
<a href="http://cvs.apache.org/viewcvs.cgi/maven-plugins/cactus/announcements/3.2.ann?rev=1.2&amp;content-type=text/vnd.viewcvs-markup">announcement</a>.
</td>
</tr>
<tr>
<td>15 Sep 2003</td>
<td>
Release of version 3.1. Read the
<a href="http://cvs.apache.org/viewcvs.cgi/maven-plugins/cactus/announcements/3.1.ann?rev=1.1&amp;content-type=text/vnd.viewcvs-markup">announcement</a>.
</td>
</tr>
<tr>
<td>05 Aug 2003</td>
<td>
Release of version 3.0. Read the
<a href="http://cvs.apache.org/viewcvs.cgi/maven-plugins/cactus/announcements/3.0.ann?rev=1.1&amp;content-type=text/vnd.viewcvs-markup">announcement</a>.
</td>
</tr>
<tr>
<td>08 Apr 2003</td>
<td>
Release of version 2.0. Read the
<a href="http://cvs.apache.org/viewcvs.cgi/maven-plugins/cactus/announcements/2.0.ann?rev=1.1&amp;content-type=text/vnd.viewcvs-markup">announcement</a>.
</td>
</tr>
<tr>
<td>22 Mar 2003</td>
<td>
Release of version 1.2. Read the
<a href="http://cvs.apache.org/viewcvs.cgi/maven-plugins/cactus/announcements/1.2.ann?rev=1.1&amp;content-type=text/vnd.viewcvs-markup">announcement</a>.
</td>
</tr>
<tr>
<td>16 Nov 2002</td>
<td>
Release of version 1.1. Read the
<a href="http://cvs.apache.org/viewcvs.cgi/maven-plugins/cactus/announcements/1.1.ann?rev=1.1.1.1&amp;content-type=text/vnd.viewcvs-markup">announcement</a>.
</td>
</tr>
<tr>
<td>06 Nov 2002</td>
<td>
Release of version 1.0. Read the
<a href="http://cvs.apache.org/viewcvs.cgi/maven-plugins/cactus/announcements/1.0.ann?rev=1.1.1.1&amp;content-type=text/vnd.viewcvs-markup">announcement</a>.
</td>
</tr>
</table>
</section>
<section name="Documentation roadmap">
<p>
Check the <a href="features.html">features</a> page for all features
of this plugin.
</p>
<p>
Then, you should read the <a href="using.html">Quick Start</a> page
which provides details about how to use the plugin.
</p>
<p>
The latest changes are available <a href="changes-report.html">here</a>.
</p>
</section>
</body>
</document>

View File

@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="Maven Cactus Plugin">
<title>Maven Cactus Plugin</title>
<body>
<links>
<item name="Maven" href="http://maven.apache.org/"/>
<item name="Cactus" href="http://jakarta.apache.org/cactus/"/>
</links>
<menu name="Overview">
<item name="Features" href="/features.html"/>
<item name="Quick Start" href="/using.html"/>
<item name="Goals" href="/goals.html"/>
<item name="Properties" href="/properties.html"/>
</menu>
<menu name="Downloads">
<item name="Cactus Plugin 3.2" href="http://www.ibiblio.org/maven/maven/plugins/maven-cactus-plugin-3.2.jar"/>
<item name="Cactus Plugin 3.1" href="http://www.ibiblio.org/maven/maven/plugins/maven-cactus-plugin-3.1.jar"/>
<item name="Cactus Plugin 3.0" href="http://www.ibiblio.org/maven/maven/plugins/maven-cactus-plugin-3.0.jar"/>
<item name="Cactus Plugin 2.0" href="http://www.ibiblio.org/maven/maven/plugins/maven-cactus-plugin-2.0.jar"/>
<item name="Cactus Plugin 1.2" href="http://www.ibiblio.org/maven/maven/plugins/maven-cactus-plugin-1.2.jar"/>
<item name="Cactus Plugin 1.1" href="http://www.ibiblio.org/maven/maven/plugins/maven-cactus-plugin-1.1.jar"/>
<item name="Cactus Plugin 1.0" href="http://www.ibiblio.org/maven/maven/plugins/maven-cactus-plugin-1.0.jar"/>
</menu>
</body>
</project>

View File

@@ -1,349 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<document>
<properties>
<title>Cactus Properties</title>
<author email="dion@apache.org">dIon Gillard</author>
<author email="vmassol@apache.org">Vincent Massol</author>
</properties>
<body>
<section name="Cactus Settings">
<table>
<tr>
<th>Property</th>
<th>Optional?</th>
<th>Description</th>
</tr>
<tr>
<td>cactus.home.[container name]</td>
<td>At least one container</td>
<td>
<p>
Home directory of where you have installed the container on
which you wish to run the Cactus tests. Valid container
names are: <code>tomcat4x</code>, <code>tomcat5x</code>,
<code>resin2x</code>, <code>orion1x</code>,
<code>orion2x</code> and <code>jboss3x</code>.
</p>
</td>
</tr>
<tr>
<td>cactus.src.dir</td>
<td>Yes</td>
<td>
<p>
Location of the Cactus test cases. Default value is
<code>src/test-cactus</code>.
</p>
</td>
</tr>
<tr>
<td>cactus.port</td>
<td>Yes</td>
<td>
<p>
Port on which to start the containers. Default value is
<code>8080</code>.
</p>
</td>
</tr>
<tr>
<td>cactus.src.includes</td>
<td>Yes</td>
<td>
<p>
Lists of test classes that will be executed. Default value is
<code>**/*Test*.java</code>.
</p>
</td>
</tr>
<tr>
<td>cactus.src.excludes</td>
<td>Yes</td>
<td>
<p>
Lists of classes that will be excluded in the tests. Default
value is <code>**/AllTests.java,**/Test*All.java</code>.
</p>
</td>
</tr>
<tr>
<td>cactus.junit.usefile</td>
<td>Yes</td>
<td>
<p>
Decides whether the test result will be printed to the console or
not. Default value is <code>false</code>, meaning errors will be
displayed on the console.
</p>
</td>
</tr>
<tr>
<td>cactus.reports.dir</td>
<td>Yes</td>
<td>
<p>
Location of junit test reports for the Cactus tests.
Default value is
<code>${cactus.target.dir}/test-cactus-reports</code>.
</p>
</td>
</tr>
<tr>
<td>cactus.halt.on.error</td>
<td>Yes</td>
<td>
<p>
Decides whether to stop the build on test errors.
Default value is <code>true</code>.
</p>
</td>
</tr>
<tr>
<td>cactus.halt.on.failure</td>
<td>Yes</td>
<td>
<p>
Decides whether to stop the build on test failures
Default value is <code>true</code>.
</p>
</td>
</tr>
<tr>
<td>cactus.src.mergewebxml</td>
<td>Yes</td>
<td>
<p>
Location of a test-specific web.xml file that will be merged with
the application web.xml, during the War cactification. Note that
by default the cactification already adds the Cactus redirector
definitions.Decides whether to stop the build on test failures.
Example:
<code>cactus.src.mergewebxml = ${basedir}/src/conf/cactus-web.xml</code>.
</p>
</td>
</tr>
<tr>
<td>maven.cactus.printsummary</td>
<td>Yes</td>
<td>
<p>
How summary information on test should be printed to the console. This
property has the same meaning as the <code>printsummary</code> attribute
of the JUnit Ant task. Default value is
<code>maven.cactus.printsummary = withOutAndErr</code>.
</p>
</td>
</tr>
<tr>
<td>maven.tmpdir.dir</td>
<td>Yes</td>
<td>
<p>
Location where Cactus will put its temporary files (mostly where
it setups containers for execution). Default value is
<code>[java.io.tmpdir]/[containername]</code>.
</p>
</td>
</tr>
<!--
<tr>
<td>cactus.runner</td>
<td>Yes</td>
<td>
<p>
The JUnit Runner to use for executing the tests. Valid values
are "text" and "swing". Default value is <code>text</code>.
</p>
</td>
</tr>
-->
</table>
</section>
<section name="Cactus/JBoss 3.x Settings">
<table>
<tr>
<th>Property</th>
<th>Optional?</th>
<th>Description</th>
</tr>
<tr>
<td>cactus.jboss3x.config.name</td>
<td>Yes</td>
<td>
<p>
Name of the JBoss server configuration to use.
Default value is <code>default</code>.
</p>
</td>
</tr>
</table>
</section>
<section name="Cactus/Resin 2.x Settings">
<table>
<tr>
<th>Property</th>
<th>Optional?</th>
<th>Description</th>
</tr>
<tr>
<td>cactus.resin2x.config</td>
<td>Yes</td>
<td>
<p>
Location of the Resin 2.x configuration file if you don't want
to use the cactus-provided one.
</p>
</td>
</tr>
</table>
</section>
<section name="Cactus/Tomcat 4.x Settings">
<table>
<tr>
<th>Property</th>
<th>Optional?</th>
<th>Description</th>
</tr>
<tr>
<td>cactus.tomcat4x.config</td>
<td>Yes</td>
<td>
<p>
Location of the Tomcat 4.x configuration file if you don't want
to use the cactus-provided one.
</p>
</td>
</tr>
<tr>
<td>cactus.tomcat4x.conf.dir</td>
<td>Yes</td>
<td>
<p>
Location of custom Tomcat 4.x configuration file that will be
copied, overwriting the Cactus-provided configuration files.
</p>
</td>
</tr>
<tr>
<td>cactus.tomcat4x.conf.includes</td>
<td>Yes</td>
<td>
<p>
Configuration files located at
<code>${cactus.tomcat4x.conf.dir</code> that should be included
in the Tomcat 4.x container set up by Cactus.
</p>
</td>
</tr>
<tr>
<td>cactus.tomcat4x.conf.excludes</td>
<td>Yes</td>
<td>
<p>
Configuration files located at
<code>${cactus.tomcat4x.conf.dir</code> that should not be
included in the Tomcat 4.x container set up by Cactus.
</p>
</td>
</tr>
<tr>
<td>cactus.tomcat4x.tmpdir</td>
<td>Yes</td>
<td>
<p>
Directory to which the container will be installed for the tests.
By default the system temporary directory is used.
</p>
</td>
</tr>
</table>
</section>
<section name="Cactus/Tomcat 5.x Settings">
<table>
<tr>
<th>Property</th>
<th>Optional?</th>
<th>Description</th>
</tr>
<tr>
<td>cactus.tomcat5x.config</td>
<td>Yes</td>
<td>
<p>
Location of the Tomcat 5.x configuration file if you don't want
to use the cactus-provided one.
</p>
</td>
</tr>
<tr>
<td>cactus.tomcat5x.conf.dir</td>
<td>Yes</td>
<td>
<p>
Location of custom Tomcat 5.x configuration file that will be
copied, overwriting the Cactus-provided configuration files.
</p>
</td>
</tr>
<tr>
<td>cactus.tomcat5x.conf.includes</td>
<td>Yes</td>
<td>
<p>
Configuration files located at
<code>${cactus.tomcat5x.conf.dir</code> that should be included
in the Tomcat 5.x container set up by Cactus.
</p>
</td>
</tr>
<tr>
<td>cactus.tomcat5x.conf.excludes</td>
<td>Yes</td>
<td>
<p>
Configuration files located at
<code>${cactus.tomcat5x.conf.dir</code> that should not be
included in the Tomcat 5.x container set up by Cactus.
</p>
</td>
</tr>
<tr>
<td>cactus.tomcat5x.tmpdir</td>
<td>Yes</td>
<td>
<p>
Directory to which the container will be installed for the tests.
By default the system temporary directory is used.
</p>
</td>
</tr>
</table>
</section>
<section name="Cactus/WebLogic 7.x Settings">
<table>
<tr>
<th>Property</th>
<th>Optional?</th>
<th>Description</th>
</tr>
<tr>
<td>cactus.weblogic7x.beahome</td>
<td>Yes</td>
<td>
<p>
Location of BEA HOME. If not specified it defaults to
the parent directory of <code>cactus.home.weblogic7x</code>.
</p>
</td>
</tr>
</table>
</section>
</body>
</document>

View File

@@ -1,39 +0,0 @@
<?xml version="1.0"?>
<document>
<properties>
<title>Tasks</title>
<author email="vmassol@apache.org">Vincent Massol</author>
</properties>
<body>
<section name="Tasks">
<p>
Lists of todos and ideas for future versions.
</p>
<subsection name="3.1">
<p>
<ul>
<li>
Refactor code in goals cactus:test, cactus:single, and cactus:match
to share more code. Currently there is a lot of cut-n-paste code.
Should use jelly tags to reuse code.
</li>
</ul>
</p>
<p>
<ul>
<li>
Add support for Jetty (note: This should actually be added in the
Cactus/Ant integration module and not in the Maven plugin), for
better reuse.
</li>
</ul>
</p>
</subsection>
</section>
</body>
</document>

View File

@@ -1,41 +0,0 @@
<?xml version="1.0"?>
<document>
<properties>
<title>Using the Maven Cactus Plug-in</title>
<author email="vmassol@apache.org">Vincent Massol</author>
</properties>
<body>
<section name="Using the Maven Cactus Plug-in">
<ol>
<li>
Create a <code>src/test-cactus</code> directory in your project and
put your Cactus test classes in it (with the normal package directory
structure). Note that the location of the Cactus test sources can be
configured through the <code>cactus.src.dir</code> property.
</li>
<li>
Create a <code>build.properties</code> file in your project root
directory (where <code>project.xml</code> is located) and define in
it the location of the container you wish to use for the tests. For
example, if you wish to run the Cactus tests on Tomcat 4.1.24 and on
Resin 2.6, you will write:
</li>
<source><![CDATA[
cactus.home.tomcat4x = C:/Apps/jakarta-tomcat-4.1.24
cactus.home.resin2x = C:/Apps/resin-2.1.6
]]></source>
<li>
Then, simply type <code>maven cactus:test</code> (or
<code>maven cactus</code> for short) to run the Cactus
tests.
</li>
</ol>
</section>
</body>
</document>