From eef02557cb1a35293d4358e986b1e97ec9a42e6f Mon Sep 17 00:00:00 2001
From: vmassol
Date: Fri, 23 May 2003 21:05:56 +0000
Subject: [PATCH] WARNING: Full plugin rewrite! Version 3.0 of the Cactus
plugin now relies on the newest Cactus/Ant integration which has completely
changed since version 2.0 (and 2.1-SNAPSHOT, which by the way has never been
released, and never will). Thanks to the new Cactus/Ant, some features have
also been added. The plugin now uses the new and Ant
tasks (see http://jakarta.apache.org/cactus/integration/ant/index.html for
more details).
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113436 13f79535-47bb-0310-9956-ffa450edef68
---
cactus/maven.xml | 31 --
cactus/plugin.jelly | 357 +++++++++++++-----
cactus/plugin.properties | 63 +++-
cactus/project.properties | 10 -
cactus/project.xml | 38 +-
cactus/sample/build.properties.sample | 4 +
cactus/sample/project.xml | 10 +-
.../cactus/sample/TestSampleBodyTag.java | 14 +-
.../plugin-resources/jboss3x/jboss-web.xml | 3 +
.../plugin-resources/jboss3x/roles.properties | 2 +
.../plugin-resources/jboss3x/users.properties | 2 +
cactus/xdocs/changes.xml | 11 +-
cactus/xdocs/goals.xml | 13 +
cactus/xdocs/properties.xml | 180 +++++++--
cactus/xdocs/tasks.xml | 2 +-
cactus/xdocs/using.xml | 11 +-
16 files changed, 527 insertions(+), 224 deletions(-)
delete mode 100644 cactus/maven.xml
create mode 100644 cactus/sample/build.properties.sample
create mode 100644 cactus/src/plugin-resources/jboss3x/jboss-web.xml
create mode 100644 cactus/src/plugin-resources/jboss3x/roles.properties
create mode 100644 cactus/src/plugin-resources/jboss3x/users.properties
diff --git a/cactus/maven.xml b/cactus/maven.xml
deleted file mode 100644
index c21acc9c..00000000
--- a/cactus/maven.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/cactus/plugin.jelly b/cactus/plugin.jelly
index aa504608..e6a07794 100644
--- a/cactus/plugin.jelly
+++ b/cactus/plugin.jelly
@@ -2,15 +2,15 @@
-
-
-
-
+
+ prereqs="cactus:test"/>
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+ value="${pom.getPluginContext('maven-war-plugin').getVariable('maven.war.build.dir')}"/>
+
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ No Cactus source files to compile.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -74,58 +160,159 @@
defined.
========================================================================
-->
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
-
+
+
+
+
-
+
+
+
+
+
-
-
- WARNING: You need to define at least one container property of the form cactus.home.[container name]. See the plugin documentation.
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ At least one test had a failure!
+
+
+ At least one test had an error!
+
@@ -159,21 +346,13 @@
-
-
-
-
-
-
-
+ prettyPrint="true"/>
diff --git a/cactus/plugin.properties b/cactus/plugin.properties
index 8b5938b7..c6bae981 100644
--- a/cactus/plugin.properties
+++ b/cactus/plugin.properties
@@ -8,38 +8,71 @@
#
# Examples:
#
-# cactus.home.jboss3x = c:/apps/jboss-3.0.4
# cactus.home.tomcat4x = c:/apps/tomcat-4.1.10
-# cactus.home.resin2x = C:/Apps/resin-2.1.4
-# cactus.home.weblogic7x = C:/bea
+#
+# Supported container names: jboss3x, tomcat4x, resin2x, orion1x,
+# orion2x, tomcat5x
# Location of Cactus tests in project sources
cactus.src.dir = ${basedir}/src/test-cactus
-# Location where the plugins puts temporary Cactus build-generated files
-cactus.target.dir = ${maven.build.dir}/cactus
-
-# Default port on which to start the containers
-cactus.port = 8080
-
# 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
-# Default webapp context
-cactus.context = cactustest
+# (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 true
cactus.junit.usefile = false
# Location of junit test reports for the Cactus tests
-cactus.reports.dir = ${cactus.target.dir}/test-cactus-reports
+cactus.reports.dir = ${maven.build.dir}/test-cactus-reports
-# Location of the JBoss server configuration directory.
-cactus.jboss3x.config.dir = ${cactus.home.jboss3x}/server
+# Shall we stop the build in case of test failures?
+cactus.halt.on.failure = true
-# Name of the JBoss server configuration to use
+# Shall we stop the build in case of test errors?
+cactus.halt.on.error = true
+
+# -------------------------------------------------------------------
+# 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 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 =
diff --git a/cactus/project.properties b/cactus/project.properties
index 8f729ba5..4911a5ac 100644
--- a/cactus/project.properties
+++ b/cactus/project.properties
@@ -5,13 +5,3 @@ maven.xdoc.date=left
maven.xdoc.version=${pom.currentVersion}
maven.checkstyle.format = turbine
maven.license.licenseFile=${basedir}/../../../LICENSE.txt
-
-# Properties specific to the plugin
-
-# Note: These should be removed once Maven artifacts dependencies
-# mechanism is finalized.
-
-maven.cactus.artifacts.zips.dir = ${maven.repo.local}/cactus/zips
-maven.cactus.antintegration.version = 13-1.5dev-20030426
-maven.cactus.antintegration.name = jakarta-cactus-integration-ant-${maven.cactus.antintegration.version}
-maven.cactus.antintegration.zip = ${maven.cactus.artifacts.zips.dir}/${maven.cactus.antintegration.name}.zip
diff --git a/cactus/project.xml b/cactus/project.xml
index c04f581c..77b503a4 100644
--- a/cactus/project.xml
+++ b/cactus/project.xml
@@ -5,7 +5,7 @@
3maven-cactus-pluginMaven Cactus Plug-in
- 2.1-SNAPSHOT
+ 3.0-SNAPSHOTPlugin for Cactus (http://jakarta.apache.org/cactus) that allows to automatically start containers, run Cactus tests and stop the containers.Cactus pluginhttp://maven.apache.org/reference/plugins/cactus/
@@ -36,8 +36,8 @@
MAVEN_CACTUS_2_0
- 2.1
- 2.1
+ 3.0
+ 3.0HEAD
@@ -65,34 +65,25 @@
-
cactus
- jakarta-cactus-integration-ant
- 13-1.5dev-20030426
- zip
-
-
-
-
- cactus
- cactus-framework>
- 13-1.5dev-20030407
+ cactus
+ 13-1.5dev-20030522cactus
- cactus-integration-ant>
- 1.5dev-20030407
+ cactus-ant
+ 13-1.5dev-20030522commons-httpclient
- commons-httpclient>
+ commons-httpclient2.0-alpha3commons-logging
- commons-logging>
+ commons-logging1.0.2
@@ -100,23 +91,19 @@
aspectjrt1.0.6
-
- log4j
- log4j
- 1.2.7
- junitjunit3.8.1
+
+
+
httpunithttpunit1.5.1
-
-
nekohtmlnekohtml
@@ -132,5 +119,6 @@
xmlParserAPIs2.2.1
+
diff --git a/cactus/sample/build.properties.sample b/cactus/sample/build.properties.sample
new file mode 100644
index 00000000..b906c2e4
--- /dev/null
+++ b/cactus/sample/build.properties.sample
@@ -0,0 +1,4 @@
+# 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
+
diff --git a/cactus/sample/project.xml b/cactus/sample/project.xml
index 1d0e0782..0c834337 100644
--- a/cactus/sample/project.xml
+++ b/cactus/sample/project.xml
@@ -12,7 +12,7 @@
- 1.0-SNAPSHOT
+ 3.0-SNAPSHOT
@@ -64,4 +64,12 @@
src/java
+
+ maven-cactus-plugin
+ maven-changelog-plugin
+ maven-file-activity-plugin
+ maven-developer-activity-plugin
+ maven-tasklist-plugin
+
+
\ No newline at end of file
diff --git a/cactus/sample/src/test-cactus/org/apache/maven/cactus/sample/TestSampleBodyTag.java b/cactus/sample/src/test-cactus/org/apache/maven/cactus/sample/TestSampleBodyTag.java
index 52076451..670115b0 100644
--- a/cactus/sample/src/test-cactus/org/apache/maven/cactus/sample/TestSampleBodyTag.java
+++ b/cactus/sample/src/test-cactus/org/apache/maven/cactus/sample/TestSampleBodyTag.java
@@ -70,9 +70,10 @@ import org.apache.cactus.WebResponse;
*
* @author Nciholas Lesiecki
*
- * @version $Id: TestSampleBodyTag.java,v 1.1 2003/03/22 16:39:09 vmassol Exp $
+ * @version $Id: TestSampleBodyTag.java,v 1.2 2003/05/23 21:05:56 vmassol Exp $
*/
-public class TestSampleBodyTag extends JspTestCase {
+public class TestSampleBodyTag extends JspTestCase
+{
private SampleBodyTag tag;
private BodyContent tagContent;
@@ -91,7 +92,8 @@ public class TestSampleBodyTag extends JspTestCase {
*
* @param theArgs the arguments. Not used
*/
- public static void main(String[] theArgs) {
+ public static void main(String[] theArgs)
+ {
junit.swingui.TestRunner.main(
new String[] { TestSampleBodyTag.class.getName() });
}
@@ -100,7 +102,8 @@ public class TestSampleBodyTag extends JspTestCase {
* @return a test suite (TestSuite) that includes all methods
* starting with "test"
*/
- public static Test suite() {
+ public static Test suite()
+ {
// All methods starting with "test" will be executed in the test suite.
return new TestSuite(TestSampleBodyTag.class);
}
@@ -109,7 +112,8 @@ public class TestSampleBodyTag extends JspTestCase {
* 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() {
+ public void setUp()
+ {
this.tag = new SampleBodyTag();
this.tag.setPageContext(this.pageContext);
diff --git a/cactus/src/plugin-resources/jboss3x/jboss-web.xml b/cactus/src/plugin-resources/jboss3x/jboss-web.xml
new file mode 100644
index 00000000..1c27d2f9
--- /dev/null
+++ b/cactus/src/plugin-resources/jboss3x/jboss-web.xml
@@ -0,0 +1,3 @@
+
+ java:/jaas/other
+
diff --git a/cactus/src/plugin-resources/jboss3x/roles.properties b/cactus/src/plugin-resources/jboss3x/roles.properties
new file mode 100644
index 00000000..2bca7f99
--- /dev/null
+++ b/cactus/src/plugin-resources/jboss3x/roles.properties
@@ -0,0 +1,2 @@
+testuser=test
+admin=JBossAdmin
diff --git a/cactus/src/plugin-resources/jboss3x/users.properties b/cactus/src/plugin-resources/jboss3x/users.properties
new file mode 100644
index 00000000..1dd9f297
--- /dev/null
+++ b/cactus/src/plugin-resources/jboss3x/users.properties
@@ -0,0 +1,2 @@
+testuser=testpassword
+admin=admin
diff --git a/cactus/xdocs/changes.xml b/cactus/xdocs/changes.xml
index 43709e88..37fb8c37 100644
--- a/cactus/xdocs/changes.xml
+++ b/cactus/xdocs/changes.xml
@@ -7,15 +7,12 @@
-
+
- Updated to use the Cactus/Ant integration built on 26th of April 2003.
- This makes the web.xml merge works.
+ Major change: updated to use the Cactus/Ant integration built on
+ 23rd of May 2003 (it is completely different from the Cactus/Ant
+ integration used in version 2.0.
-
- Fix bug where generation of the Cactus report was failing in some
- cases.
-
diff --git a/cactus/xdocs/goals.xml b/cactus/xdocs/goals.xml
index 4d93e899..bde999fa 100644
--- a/cactus/xdocs/goals.xml
+++ b/cactus/xdocs/goals.xml
@@ -8,6 +8,19 @@
+
+ cactus:compile
+
+ Compiles the Cactus tests.
+
+
+
+ cactus:cactifywar
+
+ Creates a Cactus-ready war from the application war (depends
+ on war:war).
+
+ cactus:test
diff --git a/cactus/xdocs/properties.xml b/cactus/xdocs/properties.xml
index 13f3ee1d..6bfecd36 100644
--- a/cactus/xdocs/properties.xml
+++ b/cactus/xdocs/properties.xml
@@ -21,9 +21,9 @@
Home directory of where you have installed the container on
which you wish to run the Cactus tests. Valid container
- names are: tomcat4x, resin2x,
- orion1x, weblogic6x,
- weblogic7x and jboss3x.
+ names are: tomcat4x, tomcat5x,
+ resin2x, orion1x,
+ orion2x and jboss3x.
@@ -47,16 +47,6 @@
-
-
cactus.target.dir
-
Yes
-
-
- Location where the plugins puts temporary build-generated
- files. Default value is ${maven.build.dir}/cactus.
-
-
-
cactus.src.includes
Yes
@@ -77,17 +67,6 @@
-
-
cactus.context
-
Yes
-
-
- Name of the webapp context under which the application will be
- deployed for executing the Cactus tests. Default
- value is cactustest.
-
-
-
cactus.junit.usefile
Yes
@@ -130,6 +109,22 @@
+
+
cactus.src.mergewebxml
+
Yes
+
+
+ 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:
+ cactus.src.mergewebxml = ${basedir}/src/conf/cactus-web.xml.
+
+
+
+
+
-
+
Property
Optional?
Description
-
-
cactus.jboss3x.config.dir
-
Yes
-
-
- Location of the JBoss server configuration directory.
- Default value is ${cactus.home.jboss3x}.
-
-
-
cactus.jboss3x.config.name
Yes
@@ -172,6 +158,130 @@
+
+
+
+
+
Property
+
Optional?
+
Description
+
+
+
cactus.resin2x.config
+
Yes
+
+
+ Location of the Resin 2.x configuration file if you don't want
+ to use the cactus-provided one.
+
+
+
+
+
+
+
+
+
Property
+
Optional?
+
Description
+
+
+
cactus.tomcat4x.config
+
Yes
+
+
+ Location of the Tomcat 4.x configuration file if you don't want
+ to use the cactus-provided one.
+
+
+
+
+
cactus.tomcat4x.conf.dir
+
Yes
+
+
+ Location of custom Tomcat 4.x configuration file that will be
+ copied, overwriting the Cactus-provided configuration files.
+
+
+
+
+
cactus.tomcat4x.conf.includes
+
Yes
+
+
+ Configuration files located at
+ ${cactus.tomcat4x.conf.dir that should be included
+ in the Tomcat 4.x container set up by Cactus.
+
+
+
+
+
cactus.tomcat4x.conf.excludes
+
Yes
+
+
+ Configuration files located at
+ ${cactus.tomcat4x.conf.dir that should not be
+ included in the Tomcat 4.x container set up by Cactus.
+
+
+
+
+
+
+
+
+
+
Property
+
Optional?
+
Description
+
+
+
cactus.tomcat5x.config
+
Yes
+
+
+ Location of the Tomcat 5.x configuration file if you don't want
+ to use the cactus-provided one.
+
+
+
+
+
cactus.tomcat5x.conf.dir
+
Yes
+
+
+ Location of custom Tomcat 5.x configuration file that will be
+ copied, overwriting the Cactus-provided configuration files.
+
+
+
+
+
cactus.tomcat5x.conf.includes
+
Yes
+
+
+ Configuration files located at
+ ${cactus.tomcat5x.conf.dir that should be included
+ in the Tomcat 5.x container set up by Cactus.
+
+
+
+
+
cactus.tomcat5x.conf.excludes
+
Yes
+
+
+ Configuration files located at
+ ${cactus.tomcat5x.conf.dir that should not be
+ included in the Tomcat 5.x container set up by Cactus.
+
+
+
+
+
+
\ No newline at end of file
diff --git a/cactus/xdocs/tasks.xml b/cactus/xdocs/tasks.xml
index 07da17a1..c22e555f 100644
--- a/cactus/xdocs/tasks.xml
+++ b/cactus/xdocs/tasks.xml
@@ -12,7 +12,7 @@
Lists of todos and ideas for future versions.
-
+
diff --git a/cactus/xdocs/using.xml b/cactus/xdocs/using.xml
index a8c30738..e6770837 100644
--- a/cactus/xdocs/using.xml
+++ b/cactus/xdocs/using.xml
@@ -19,17 +19,18 @@
Create a build.properties file in your project root
directory (where project.xml 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.10 and on
- Resin 2.4, you will write:
+ example, if you wish to run the Cactus tests on Tomcat 4.1.24 and on
+ Resin 2.6, you will write:
- Then, simply type maven cactus:test to run the Cactus
+ Then, simply type maven cactus:test (or
+ maven cactus for short) to run the Cactus
tests.