vmassol 2004/12/07 13:20:17
Modified: . Tag: CACTUS_17_CARGO_BRANCH
build.properties.default build.properties.vmassol
build.xml dependencies.xml.default download.xml
samples/servlet Tag: CACTUS_17_CARGO_BRANCH build.xml
samples/servlet/src/scripts/share Tag:
CACTUS_17_CARGO_BRANCH build.xml
Log:
First batch of changes to use Cargo instead of the <cactus> task. It is *NOT*
in a working state. The next step is for me to add support for authentication
properties in Cargo. I'm committing this to show the idea I currently have on
how to use Cargo directly with Cactus (without wrapping it). It may or may not
be too complex to use directly. If it is, then we'll need to do a thin wrapper
around the Cargo tasks to bring to a level of comfort similar to the previous
<cactus> task...
Revision Changes Path
No revision
No revision
1.2.2.1 +4 -1 jakarta-cactus/build.properties.default
Index: build.properties.default
===================================================================
RCS file: /home/cvs/jakarta-cactus/build.properties.default,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -r1.2 -r1.2.2.1
--- build.properties.default 23 May 2004 14:12:34 -0000 1.2
+++ build.properties.default 7 Dec 2004 21:20:16 -0000 1.2.2.1
@@ -190,6 +190,9 @@
jsp.12.jar = ${servlet.23.jar}
jsp.20.jar =
${lib.repo}/${jsp.20.project}/jars/${jsp.20.artifact}-${jsp.20.version}.jar
+# The location of the Cargo jar
+cargo.jar =
${lib.repo}/${cargo.project}/jars/${cargo.artifact}-${cargo.version}.jar
+
# The location of the Commons Logging jar
commons.logging.jar =
${lib.repo}/${commons.logging.project}/jars/${commons.logging.artifact}-${commons.logging.version}.jar
1.25.2.1 +4 -1 jakarta-cactus/build.properties.vmassol
Index: build.properties.vmassol
===================================================================
RCS file: /home/cvs/jakarta-cactus/build.properties.vmassol,v
retrieving revision 1.25
retrieving revision 1.25.2.1
diff -u -r1.25 -r1.25.2.1
--- build.properties.vmassol 23 May 2004 14:10:07 -0000 1.25
+++ build.properties.vmassol 7 Dec 2004 21:20:16 -0000 1.25.2.1
@@ -186,6 +186,9 @@
jsp.12.jar = ${servlet.23.jar}
jsp.20.jar =
${lib.repo}/${jsp.20.project}/jars/${jsp.20.artifact}-${jsp.20.version}.jar
+# The location of the Cargo jar
+cargo.jar =
${lib.repo}/${cargo.project}/jars/${cargo.artifact}-${cargo.version}.jar
+
# The location of the Commons Logging jar
commons.logging.jar =
${lib.repo}/${commons.logging.project}/jars/${commons.logging.artifact}-${commons.logging.version}.jar
1.75.2.1 +3 -1 jakarta-cactus/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-cactus/build.xml,v
retrieving revision 1.75
retrieving revision 1.75.2.1
diff -u -r1.75 -r1.75.2.1
--- build.xml 23 May 2004 14:10:07 -0000 1.75
+++ build.xml 7 Dec 2004 21:20:16 -0000 1.75.2.1
@@ -208,6 +208,8 @@
prefix="${main.release.name}/lib"/>
<zipfileset file="${cactus.jar}"
prefix="${main.release.name}/lib"/>
+ <zipfileset file="${cargo.jar}"
+ prefix="${main.release.name}/lib"/>
<zipfileset file="${commons.logging.jar}"
prefix="${main.release.name}/lib"/>
<zipfileset file="${commons.httpclient.jar}"
1.5.2.1 +2 -0 jakarta-cactus/dependencies.xml.default
Index: dependencies.xml.default
===================================================================
RCS file: /home/cvs/jakarta-cactus/dependencies.xml.default,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -r1.5 -r1.5.2.1
--- dependencies.xml.default 29 Oct 2004 05:52:36 -0000 1.5
+++ dependencies.xml.default 7 Dec 2004 21:20:16 -0000 1.5.2.1
@@ -9,6 +9,8 @@
artifact="aspectjrt" version="1.2.1rc1"/>
<aspectj-tools project="aspectj"
artifact="aspectjtools" version="1.2.1rc1"/>
+ <cargo project="cargo"
+ artifact="cargo" version="0.4-SNAPSHOT"/>
<checkstyle project="checkstyle"
artifact="checkstyle" version="3.4"/>
<clover project="clover"
1.6.2.1 +2 -1 jakarta-cactus/download.xml
Index: download.xml
===================================================================
RCS file: /home/cvs/jakarta-cactus/download.xml,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -u -r1.6 -r1.6.2.1
--- download.xml 23 May 2004 14:37:04 -0000 1.6
+++ download.xml 7 Dec 2004 21:20:16 -0000 1.6.2.1
@@ -108,6 +108,7 @@
<download jar="antlr"/>
<download jar="aspectjrt"/>
<download jar="aspectj-tools"/>
+ <download jar="cargo"/>
<download jar="checkstyle"/>
<download jar="clover"/>
<download jar="commons.beanutils"/>
No revision
No revision
1.40.4.1 +8 -4 jakarta-cactus/samples/servlet/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-cactus/samples/servlet/build.xml,v
retrieving revision 1.40
retrieving revision 1.40.4.1
diff -u -r1.40 -r1.40.4.1
--- build.xml 14 Feb 2004 11:52:31 -0000 1.40
+++ build.xml 7 Dec 2004 21:20:17 -0000 1.40.4.1
@@ -125,6 +125,7 @@
init.filters.12, init.filters.13">
<!-- Copy scripts -->
+ <basename property="cargo.jar.name" file="${cargo.jar}"/>
<basename property="jstl.jar.name" file="${jstl.jar}"/>
<basename property="standard.jar.name" file="${standard.jar}"/>
<basename property="servlet.jar.name" file="${servlet.jar}"/>
@@ -139,6 +140,7 @@
<basename property="log4j.jar.name" file="${log4j.jar}"/>
<filterset id="jar.names">
+ <filter token="cargo.jar.name" value="${cargo.jar.name}"/>
<filter token="jstl.jar.name" value="${jstl.jar.name}"/>
<filter token="standard.jar.name" value="${standard.jar.name}"/>
<filter token="servlet.jar.name" value="${servlet.jar.name}"/>
@@ -167,16 +169,17 @@
<echo>Dependencies:</echo>
<echo> aspectjrt.jar = [${aspectjrt.jar}]</echo>
- <echo> cactus.jar = [${cactus.jar}]</echo>
<echo> cactus.ant.jar = [${cactus.ant.jar}]</echo>
+ <echo> cactus.jar = [${cactus.jar}]</echo>
+ <echo> cargo.jar = [${cargo.jar}]</echo>
<echo> commons.httpclient.jar = [${commons.httpclient.jar}]</echo>
<echo> commons.logging.jar = [${commons.logging.jar}]</echo>
<echo> httpunit.jar = [${httpunit.jar}]</echo>
- <echo> servlet.jar = [${servlet.jar}]</echo>
+ <echo> jstl.jar (for J2EE 1.3 only) = [${jstl.jar}]</echo>
<echo> junit.jar = [${junit.jar}]</echo>
<echo> log4j.jar = [${log4j.jar}]</echo>
<echo> nekohtml.jar = [${nekohtml.jar}]</echo>
- <echo> jstl.jar (for J2EE 1.3 only) = [${jstl.jar}]</echo>
+ <echo> servlet.jar = [${servlet.jar}]</echo>
<echo> standard.jar (for J2EE 1.3 only) = [${standard.jar}]</echo>
<echo> xerces.jar (optional) = [${xerces.jar}]</echo>
<echo> xmlapis.jar (optional) = [${xmlapis.jar}]</echo>
@@ -191,6 +194,7 @@
<available file="${aspectjrt.jar}"/>
<available file="${cactus.jar}"/>
<available file="${cactus.ant.jar}"/>
+ <available file="${cargo.jar}"/>
<available file="${commons.httpclient.jar}"/>
<available file="${commons.logging.jar}"/>
<available file="${httpunit.jar}"/>
No revision
No revision
1.30.4.1 +147 -146
jakarta-cactus/samples/servlet/src/scripts/share/build.xml
Index: build.xml
===================================================================
RCS file:
/home/cvs/jakarta-cactus/samples/servlet/src/scripts/share/build.xml,v
retrieving revision 1.30
retrieving revision 1.30.4.1
diff -u -r1.30 -r1.30.4.1
--- build.xml 23 Mar 2004 09:29:17 -0000 1.30
+++ build.xml 7 Dec 2004 21:20:17 -0000 1.30.4.1
@@ -104,6 +104,8 @@
location="[EMAIL PROTECTED]@"/>
<property name="cactus.ant.jar"
location="[EMAIL PROTECTED]@"/>
+ <property name="cargo.jar"
+ location="[EMAIL PROTECTED]@"/>
<property name="commons.httpclient.jar"
location="[EMAIL PROTECTED]@"/>
<property name="commons.logging.jar"
@@ -125,6 +127,7 @@
<pathelement location="${aspectjrt.jar}"/>
<pathelement location="${cactus.jar}"/>
<pathelement location="${cactus.ant.jar}"/>
+ <pathelement location="${cargo.jar}"/>
<pathelement location="${commons.httpclient.jar}"/>
<pathelement location="${commons.logging.jar}"/>
<pathelement location="${junit.jar}"/>
@@ -148,6 +151,7 @@
(check your build.properties file)</fail>
<taskdef resource="cactus.tasks" classpathref="cactus.classpath"/>
+ <taskdef resource="cargo.tasks" classpathref="cactus.classpath"/>
<tstamp/>
@@ -298,159 +302,156 @@
<@[EMAIL PROTECTED] file="${clover.jar}"[EMAIL PROTECTED]@>
</cactifywar>
- <!-- Prepare the directories for the JUnit reports -->
- <mkdir dir="${target.testreports.dir}"/>
- <@[EMAIL PROTECTED] dir="${target.testreports.dir}/jboss3x"[EMAIL PROTECTED]@>
- <mkdir dir="${target.testreports.dir}/orion1x"/>
- <mkdir dir="${target.testreports.dir}/orion2x"/>
- <mkdir dir="${target.testreports.dir}/resin2x"/>
- <mkdir dir="${target.testreports.dir}/resin3x"/>
- <@[EMAIL PROTECTED]
dir="${target.testreports.dir}/tomcat3x"[EMAIL PROTECTED]@>
- <mkdir dir="${target.testreports.dir}/tomcat4x"/>
- <mkdir dir="${target.testreports.dir}/tomcat5x"/>
- <mkdir dir="${target.testreports.dir}/weblogic7x"/>
+ </target>
+
+ <!-- Start a container -->
+ <macrodef name="start-container">
+ <attribute name="containerKey"/>
+ <sequential>
+ <mkdir dir="${target.dir}/@{containerKey}"/>
+ <cargo id="@{containerKey}" containerKey="@{containerKey}"
action="start"
+ homeDir="[EMAIL PROTECTED]"
+ workingDir="${target.dir}/@{containerKey}/container"
+ log="${target.dir}/@{containerKey}/cargo_start.log"
+ output="${target.dir}/@{containerKey}/container_start.log">
+
+ <property name="cargo.servlet.port" value="${cactus.port}"/>
+ <property name="cargo.logging" value="high"/>
+ <war warfile="${target.dir}/${project.name.file}-cactified.war"/>
+
+ <!-- Configure Cactus for logging -->
+ <syspropertyset
file="${target.dir.normalized}/logging_server.properties"/>
+
+ <!-- Additional jars that will be added to the classpath used to
start
+ the container -->
+ <extraclasspath>
+ <@[EMAIL PROTECTED] location="${clover.jar}"[EMAIL PROTECTED]@>
+ </extraclasspath>
+ </cargo>
+ </sequential>
+ </macrodef>
+
+ <!-- Run JUnit Cactus tests on a running container -->
+ <macrodef name="junit-container">
+ <attribute name="containerKey"/>
+ <sequential>
+ <mkdir dir="${target.testreports.dir}"/>
+ <mkdir dir="${target.testreports.dir}/@{containerKey}"/>
+ <property prefix="cactus.log"
file="${target.dir.normalized}/logging_client.properties"/>
+ <junit fork="yes" failureproperty="tests.failed" haltonerror="true">
+ <sysproperty key="cactus.contextURL"
value="http://localhost:${cactus.port}/${project.name.file}-cactified"/>
+ <syspropertyset>
+ <propertyref prefix="cactus.log"/>
+ <mapper type="glob" from="cactus.log.*" to="*"/>
+ </syspropertyset>
+ <classpath>
+ <path refid="project.classpath"/>
+ <path refid="cactus.classpath"/>
+ <@[EMAIL PROTECTED] location="${clover.jar}"[EMAIL PROTECTED]@>
+ <pathelement location="${httpunit.jar}"/>
+ <pathelement location="${nekohtml.jar}"/>
+ <pathelement location="${target.classes.java.dir}"/>
+ <pathelement location="${target.classes.cactus.dir}"/>
+ <pathelement location="${log4j.jar}"/>
+ </classpath>
+ <formatter type="brief" usefile="false"/>
+ <formatter type="xml"/>
+ <batchtest todir="${target.testreports.dir}/@{containerKey}">
+ <fileset dir="${src.cactus.dir}">
+ <!-- Due to some Cactus synchronization bug, the 'unit' tests
need
+ to run before the 'sample' tests -->
+ <include name="**/servlet/unit/Test*.java"/>
+ <exclude name="**/servlet/unit/Test*All.java"/>
+ </fileset>
+ </batchtest>
+ <batchtest todir="${target.testreports.dir}/@{containerKey}">
+ <fileset dir="${src.cactus.dir}">
+ <include name="**/servlet/Test*.java"/>
+ <exclude name="**/servlet/Test*All.java"/>
+ </fileset>
+ </batchtest>
+ </junit>
+ </sequential>
+ </macrodef>
+
+ <!-- Stop a container -->
+ <macrodef name="stop-container">
+ <attribute name="containerKey"/>
+ <sequential>
+ <cargo refid="@{containerKey}" action="stop"
+ log="${target.dir}/@{containerKey}/cargo_stop.log"
+ output="${target.dir}/@{containerKey}/container_stop.log"/>
+ </sequential>
+ </macrodef>
+
+ <!-- Generate JUnit test reports for a container -->
+ <macrodef name="report-container">
+ <attribute name="containerKey"/>
+ <sequential>
+ <junitreport todir="${target.testreports.dir}/@{containerKey}">
+ <fileset dir="${target.testreports.dir}/@{containerKey}"
+ includes="TEST-*.xml"/>
+ <report todir="${target.testreports.dir}/@{containerKey}"
+ format="frames"/>
+ </junitreport>
+ </sequential>
+ </macrodef>
+
+ <!-- Execute tests on a single container -->
+ <macrodef name="test-container-internal-check">
+ <attribute name="containerKey"/>
+ <sequential>
+ <condition property="container.shouldRun">
+ <isset property="[EMAIL PROTECTED]"/>
+ </condition>
+ </sequential>
+ </macrodef>
+
+ <target name="test-container-internal-check">
+ <test-container-internal-check containerKey="${containerKey}"/>
</target>
- <target name="test" depends="test.prepare"
- description="Run the tests on the defined containers">
+ <target name="test-container-internal-ok" if="container.shouldRun">
+ <echo>Running tests on ${containerKey} container...</echo>
+ <start-container containerKey="${containerKey}"/>
+ <junit-container containerKey="${containerKey}"/>
+ <stop-container containerKey="${containerKey}"/>
+ <report-container containerKey="${containerKey}"/>
+ </target>
- <!-- Run the tests -->
- <cactus warfile="${target.dir}/${project.name.file}-cactified.war"
- fork="yes" failureproperty="tests.failed" haltonerror="true">
-
- <!-- Configure the cactus task for logging -->
- <cactusproperty server="false"
-
propertiesFile="${target.dir.normalized}/logging_client.properties"/>
- <cactusproperty server="true"
-
propertiesFile="${target.dir.normalized}/logging_server.properties"/>
-
- <!-- Additional jars that will be added to the classpath used to start
the
- container (in addition to the container jars themseleves which are
- automatically added by the <cactus> task -->
- <containerclasspath>
- <@[EMAIL PROTECTED] location="${clover.jar}"[EMAIL PROTECTED]@>
- </containerclasspath>
+ <target name="test-container-internal-nok" unless="container.shouldRun">
+ <echo>Not running tests on ${containerKey} container as
[cactus.home.${containerKey}] property not defined</echo>
+ </target>
- <classpath>
- <path refid="project.classpath"/>
- <@[EMAIL PROTECTED] location="${clover.jar}"[EMAIL PROTECTED]@>
- <pathelement location="${httpunit.jar}"/>
- <pathelement location="${nekohtml.jar}"/>
- <pathelement location="${target.classes.java.dir}"/>
- <pathelement location="${target.classes.cactus.dir}"/>
- <pathelement location="${log4j.jar}"/>
- </classpath>
+ <target name="test-container-internal"
+
depends="test-container-internal-check,test-container-internal-ok,test-container-internal-nok"/>
+
+ <macrodef name="test-container">
+ <attribute name="containerKey"/>
+ <sequential>
+ <antcall inheritAll="true" inheritRefs="true"
target="test-container-internal">
+ <param name="containerKey" value="@{containerKey}"/>
+ </antcall>
+ </sequential>
+ </macrodef>
+
+ <target name="test" depends="test.prepare"
+ description="Run the tests on the defined containers">
- <containerset>
- <@[EMAIL PROTECTED] if="cactus.home.jboss3x"
- dir="${cactus.home.jboss3x}"
- output="${target.testreports.dir}/jboss3x.out"
- todir="${target.testreports.dir}/jboss3x"[EMAIL PROTECTED]@>
- <orion1x if="cactus.home.orion1x"
- dir="${cactus.home.orion1x}" port="${cactus.port}"
- output="${target.testreports.dir}/orion1x.out"
- todir="${target.testreports.dir}/orion1x"/>
- <orion2x if="cactus.home.orion2x"
- dir="${cactus.home.orion2x}" port="${cactus.port}"
- output="${target.testreports.dir}/orion2x.out"
- todir="${target.testreports.dir}/orion2x"/>
- <resin2x if="cactus.home.resin2x"
- dir="${cactus.home.resin2x}" port="${cactus.port}"
- output="${target.testreports.dir}/resin2x.out"
- todir="${target.testreports.dir}/resin2x"/>
- <resin3x if="cactus.home.resin3x"
- dir="${cactus.home.resin3x}" port="${cactus.port}"
- output="${target.testreports.dir}/resin3x.out"
- todir="${target.testreports.dir}/resin3x"/>
- <@[EMAIL PROTECTED] if="cactus.home.tomcat3x"
- dir="${cactus.home.tomcat3x}" port="${cactus.port}"
- output="${target.testreports.dir}/tomcat3x.out"
- todir="${target.testreports.dir}/tomcat3x"[EMAIL PROTECTED]@>
- <tomcat4x if="cactus.home.tomcat4x"
- dir="${cactus.home.tomcat4x}" port="${cactus.port}"
- output="${target.testreports.dir}/tomcat4x.out"
- todir="${target.testreports.dir}/tomcat4x"/>
- <tomcat5x if="cactus.home.tomcat5x"
- dir="${cactus.home.tomcat5x}" port="${cactus.port}"
- output="${target.testreports.dir}/tomcat5x.out"
- todir="${target.testreports.dir}/tomcat5x"/>
- <weblogic7x if="cactus.home.weblogic7x"
- dir="${cactus.home.weblogic7x}" port="${cactus.port}"
- output="${target.testreports.dir}/weblogic7x.out"
- todir="${target.testreports.dir}/weblogic7x"/>
- </containerset>
-
- <formatter type="brief" usefile="false"/>
- <formatter type="xml"/>
-
- <batchtest>
- <fileset dir="${src.cactus.dir}">
- <!-- Due to some Cactus synchronization bug, the 'unit' tests need
- to run before the 'sample' tests -->
- <include name="**/servlet/unit/Test*.java"/>
- <exclude name="**/servlet/unit/Test*All.java"/>
- </fileset>
- </batchtest>
- <batchtest>
- <fileset dir="${src.cactus.dir}">
- <include name="**/servlet/Test*.java"/>
- <exclude name="**/servlet/Test*All.java"/>
- </fileset>
- </batchtest>
-
- </cactus>
-
- <!-- Generate the JUnit reports -->
- <@[EMAIL PROTECTED] todir="${target.testreports.dir}/jboss3x">
- <fileset dir="${target.testreports.dir}/jboss3x"
- includes="TEST-*.xml"/>
- <report todir="${target.testreports.dir}/jboss3x"
- format="frames"/>
- </[EMAIL PROTECTED]@>
- <junitreport todir="${target.testreports.dir}/orion1x">
- <fileset dir="${target.testreports.dir}/orion1x"
- includes="TEST-*.xml"/>
- <report todir="${target.testreports.dir}/orion1x"
- format="frames"/>
- </junitreport>
- <junitreport todir="${target.testreports.dir}/orion2x">
- <fileset dir="${target.testreports.dir}/orion2x"
- includes="TEST-*.xml"/>
- <report todir="${target.testreports.dir}/orion2x"
- format="frames"/>
- </junitreport>
- <junitreport todir="${target.testreports.dir}/resin2x">
- <fileset dir="${target.testreports.dir}/resin2x"
- includes="TEST-*.xml"/>
- <report todir="${target.testreports.dir}/resin2x"
- format="frames"/>
- </junitreport>
- <@[EMAIL PROTECTED] todir="${target.testreports.dir}/tomcat3x">
- <fileset dir="${target.testreports.dir}/tomcat3x"
- includes="TEST-*.xml"/>
- <report todir="${target.testreports.dir}/tomcat3x"
- format="frames"/>
- </[EMAIL PROTECTED]@>
- <junitreport todir="${target.testreports.dir}/tomcat4x">
- <fileset dir="${target.testreports.dir}/tomcat4x"
- includes="TEST-*.xml"/>
- <report todir="${target.testreports.dir}/tomcat4x"
- format="frames"/>
- </junitreport>
- <junitreport todir="${target.testreports.dir}/tomcat5x">
- <fileset dir="${target.testreports.dir}/tomcat5x"
- includes="TEST-*.xml"/>
- <report todir="${target.testreports.dir}/tomcat5x"
- format="frames"/>
- </junitreport>
- <junitreport todir="${target.testreports.dir}/weblogic7x">
- <fileset dir="${target.testreports.dir}/weblogic7x"
- includes="TEST-*.xml"/>
- <report todir="${target.testreports.dir}/weblogic7x"
- format="frames"/>
- </junitreport>
+ <!-- Need to add jboss 3.x once it is supported by Cargo:
+ <@[EMAIL PROTECTED] containerKey="jboss3x"[EMAIL PROTECTED]@>-->
+ <test-container containerKey="oc4j9x"/>
+ <test-container containerKey="orion1x"/>
+ <test-container containerKey="orion2x"/>
+ <test-container containerKey="resin2x"/>
+ <test-container containerKey="resin3x"/>
+ <@[EMAIL PROTECTED] containerKey="tomcat3x"[EMAIL PROTECTED]@>
+ <test-container containerKey="tomcat4x"/>
+ <test-container containerKey="tomcat5x"/>
+ <test-container containerKey="weblogic8x"/>
+
<fail if="tests.failed">At least one test failed!</fail>
</target>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]