Author: chris.laprun(a)jboss.com
Date: 2009-01-13 13:07:42 -0500 (Tue, 13 Jan 2009)
New Revision: 12489
Modified:
modules/portlet/trunk/build/pom.xml
modules/portlet/trunk/test/src/test/build.xml
modules/portlet/trunk/test/src/test/resources/test/servers.xml
Log:
- Make it easier to run tests locally without having to setup many servlet containers.
- Started prefixing Private ANT tasks that cannot/shouldn't be called directly with
__.
- Use web 1.2.2.
- Run tests on 4.2.3.
Modified: modules/portlet/trunk/build/pom.xml
===================================================================
--- modules/portlet/trunk/build/pom.xml 2009-01-13 15:25:44 UTC (rev 12488)
+++ modules/portlet/trunk/build/pom.xml 2009-01-13 18:07:42 UTC (rev 12489)
@@ -34,7 +34,7 @@
<version.jbossxb>2.0.0.CR8</version.jbossxb>
<version.jboss-remoting>2.2.1.GA</version.jboss-remoting>
<version.jboss.portal.common>trunk-SNAPSHOT</version.jboss.portal.common>
- <version.jboss.portal.web>1.2.1</version.jboss.portal.web>
+ <version.jboss.portal.web>1.2.2</version.jboss.portal.web>
<version.jboss.unit>1.2.1</version.jboss.unit>
<version.log4j>1.2.14</version.log4j>
<version.apache.commons-logging>1.1.1</version.apache.commons-logging>
Modified: modules/portlet/trunk/test/src/test/build.xml
===================================================================
--- modules/portlet/trunk/test/src/test/build.xml 2009-01-13 15:25:44 UTC (rev 12488)
+++ modules/portlet/trunk/test/src/test/build.xml 2009-01-13 18:07:42 UTC (rev 12489)
@@ -5,7 +5,7 @@
<antcall target="__tests"/>
</target>
- <target name="__tests" depends="prepare_env,
evaluate_properties" >
+ <target name="__tests" depends="prepare_env,
__evaluate_properties.init" >
<echo message="compile classpath: ${compile_classpath}"/>
<echo message="runtime classpath: ${runtime_classpath}"/>
@@ -14,6 +14,7 @@
<!-- <echo message="You can run small subset of tests using
-Dtests=local, -Dtests=jboss, -Dtests=tomcat, or -Dtests=jetty"/> -->
<echo message="You can run small subset of tests using -Dtests=local,
-Dtests=jboss, or -Dtests=tomcat"/>
+ <echo message="-Dtests=local will only run the tests on your locally
installed servlet containers"/>
<antcall target="package-tests"/>
@@ -23,12 +24,14 @@
</target>
<target name="tests.call.all" unless="tests">
+ <antcall target="__evaluate_properties.all"/>
<antcall target="tests.jboss"/>
<antcall target="tests.tomcat"/>
<!-- <antcall target="tests.jetty"/> -->
</target>
<target name="tests.call.single" if="tests">
+ <antcall target="__evaluate_properties.${tests}"/>
<antcall target="tests.${tests}"/>
</target>
@@ -188,8 +191,8 @@
</target>
- <!--Lets make the check in one place so the build fail in the beggining instead of
end-->
- <target name="evaluate_properties">
+ <!-- Check which servlet containers are known -->
+ <target name="__evaluate_properties.init">
<property environment="env"/>
@@ -218,14 +221,22 @@
</not>
</and>
</condition>
-<!-- <condition property="JBOSS_5_0_HOME"
value="${env.JBOSS_5_0_HOME}">
+ <condition property="JBOSS_4_2_3_HOME"
value="${env.JBOSS_4_2_3_HOME}">
<and>
+ <isset property="env.JBOSS_4_2_3_HOME"/>
+ <not>
+ <isset property="JBOSS_4_2_3_HOME"/>
+ </not>
+ </and>
+ </condition>
+ <condition property="JBOSS_5_0_HOME"
value="${env.JBOSS_5_0_HOME}">
+ <and>
<isset property="env.JBOSS_5_0_HOME"/>
<not>
<isset property="JBOSS_5_0_HOME"/>
</not>
</and>
- </condition> -->
+ </condition>
<condition property="TOMCAT_6_0_HOME"
value="${env.TOMCAT_6_0_HOME}">
<and>
<isset property="env.TOMCAT_6_0_HOME"/>
@@ -234,63 +245,88 @@
</not>
</and>
</condition>
-<!-- <condition property="JETTY_6_1_HOME"
value="${env.JETTY_6_1_HOME}">
+ <condition property="JETTY_6_1_HOME"
value="${env.JETTY_6_1_HOME}">
<and>
<isset property="env.JETTY_6_1_HOME"/>
<not>
<isset property="JETTY_6_1_HOME"/>
</not>
</and>
- </condition> -->
+ </condition>
- <fail message="Please set the environment variable JBOSS_4_2_0_HOME,
JBOSS_4_2_1_HOME or JBOSS_4_2_2_HOME">
+ <echo message="JBOSS_4_2_0_HOME: ${JBOSS_4_2_0_HOME}"/>
+ <echo message="JBOSS_4_2_1_HOME: ${JBOSS_4_2_1_HOME}"/>
+ <echo message="JBOSS_4_2_2_HOME: ${JBOSS_4_2_2_HOME}"/>
+ <echo message="JBOSS_4_2_3_HOME: ${JBOSS_4_2_3_HOME}"/>
+ <echo message="JBOSS_5_0_HOME: ${JBOSS_5_0_HOME}"/>
+ <echo message="TOMCAT_6_0_HOME: ${TOMCAT_6_0_HOME}"/>
+ <echo message="JETTY_6_1_HOME: ${JETTY_6_1_HOME}"/>
+ </target>
+
+ <target name="__evaluate_properties.tomcat">
+ <fail message="Please set the environment variable
TOMCAT_6_0_HOME">
<condition>
<and>
<not>
- <isset property="JBOSS_4_2_0_HOME"/>
+ <isset property="TOMCAT_6_0_HOME"/>
</not>
- <not>
- <isset property="JBOSS_4_2_1_HOME"/>
- </not>
- <not>
- <isset property="JBOSS_4_2_2_HOME"/>
- </not>
</and>
</condition>
</fail>
+ </target>
-<!-- <fail message="Please set the environment variable
JBOSS_5_0_HOME">
+ <target name="__evaluate_properties.jetty">
+ <fail message="Please set the environment variable
JETTY_6_1_HOME">
<condition>
<and>
<not>
- <isset property="JBOSS_5_0_HOME"/>
+ <isset property="JETTY_6_1_HOME"/>
</not>
</and>
</condition>
- </fail> -->
+ </fail>
+ </target>
- <fail message="Please set the environment variable
TOMCAT_6_0_HOME">
+ <target name="__evaluate_properties.jboss">
+ <fail message="Please set the environment variables JBOSS_4_2_0_HOME,
JBOSS_4_2_1_HOME, JBOSS_4_2_2_HOME and JBOSS_4_2_3_HOME">
<condition>
<and>
<not>
- <isset property="TOMCAT_6_0_HOME"/>
+ <isset property="JBOSS_4_2_0_HOME"/>
</not>
+ <not>
+ <isset property="JBOSS_4_2_1_HOME"/>
+ </not>
+ <not>
+ <isset property="JBOSS_4_2_2_HOME"/>
+ </not>
+ <not>
+ <isset property="JBOSS_4_2_3_HOME"/>
+ </not>
</and>
</condition>
</fail>
-
-<!-- <fail message="Please set the environment variable
JETTY_6_1_HOME">
+ <!--<fail message="Please set the environment variable
JBOSS_5_0_HOME">
<condition>
<and>
<not>
- <isset property="JETTY_6_1_HOME"/>
+ <isset property="JBOSS_5_0_HOME"/>
</not>
</and>
</condition>
- </fail> -->
+ </fail>-->
+ </target>
+ <target name="__evaluate_properties.local">
+ <!-- empty on purpose! -->
</target>
+ <target name="__evaluate_properties.all">
+ <antcall target="__evaluate_properties.jboss"/>
+ <antcall target="__evaluate_properties.jetty"/>
+ <antcall target="__evaluate_properties.tomcat"/>
+ </target>
+
<macrodef name="package-misc-test">
<attribute name="test"/>
<sequential>
@@ -542,7 +578,7 @@
</target>
- <target name="cargo.setup">
+ <target name="__cargo.setup">
<property name="cargo.log.dir"
value="${target}/test/cargo"/>
<mkdir dir="${cargo.log.dir}"/>
<taskdef resource="cargo.tasks">
@@ -552,7 +588,7 @@
</taskdef>
</target>
- <target name="cargo.jboss-4.2.start" depends="cargo.setup">
+ <target name="__cargo.jboss-4.2.start"
depends="__cargo.setup">
<!-- The lib portal-test-lib.jar must be loaded at the shared level rather than
in the war file
otherwise it is somehow inspected and produce a NoClassDefFoundError in the
web service integration
layer on the class
org/jboss/portal/test/framework/driver/remote/RemoteTestDriver for some unknown
@@ -583,7 +619,7 @@
</cargo>
</target>
- <target name="cargo.jboss-4.2.stop" depends="cargo.setup">
+ <target name="__cargo.jboss-4.2.stop"
depends="__cargo.setup">
<cargo
containerId="jboss42x"
home="${test.jboss-4.2.home}"
@@ -596,50 +632,56 @@
</cargo>
</target>
- <target name="tests.jboss-4.2.container-servlet"
if="${test.jboss-4.2.home.variable-name}">
+ <target name="__tests.jboss-4.2.container-servlet"
if="${test.jboss-4.2.home.variable-name}">
<echo message="Starting JBoss 4.2 container-servlet tests with
${test.jboss-4.2.home}"/>
- <antcall target="cargo.jboss-4.2.start">
+ <antcall target="__cargo.jboss-4.2.start">
<param name="cargo.wait" value="false"/>
<param name="test.spi.server.path"
value="${test.archive.path}"/>
</antcall>
- <antcall target="tests.remote">
+ <antcall target="__tests.remote">
<param name="test.server.name"
value="${test.jboss-4.2.name}"/>
<param name="test.deploy.name"
value="jboss-4.2-container-servlet"/>
</antcall>
- <antcall target="cargo.jboss-4.2.stop">
+ <antcall target="__cargo.jboss-4.2.stop">
</antcall>
</target>
- <target name="tests.jboss-4.2.generic"
if="${test.jboss-4.2.home.variable-name}">
+ <target name="__tests.jboss-4.2.generic"
if="${test.jboss-4.2.home.variable-name}">
<echo message="Starting JBoss 4.2 generic tests with
${test.jboss-4.2.home}"/>
- <antcall target="cargo.jboss-4.2.start">
+ <antcall target="__cargo.jboss-4.2.start">
<param name="cargo.wait" value="false"/>
<param name="test.spi.server.path"
value="${test.archive.path}"/>
</antcall>
- <antcall target="tests.remote">
+ <antcall target="__tests.remote">
<param name="test.server.name"
value="${test.jboss-4.2.name}"/>
<param name="test.deploy.name"
value="jboss-4.2-generic"/>
</antcall>
- <antcall target="cargo.jboss-4.2.stop">
+ <antcall target="__cargo.jboss-4.2.stop">
</antcall>
</target>
- <target name="tests.jboss-4.2">
- <antcall target="tests.jboss-4.2.container-servlet">
+ <target name="__tests.jboss-4.2.0" if="JBOSS_4_2_0_HOME">
+ <antcall target="__tests.jboss-4.2.container-servlet">
<param name="test.id"
value="JBoss-4_2_0-container-servlet"/>
<param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_0"/>
<param name="test.jboss-4.2.home"
value="${JBOSS_4_2_0_HOME}"/>
<param name="test.jboss-4.2.home.variable-name"
value="JBOSS_4_2_0_HOME"/>
<param name="test.jboss-4.2.tempdir"
value="${target}/cargo-tmp/4_2_0"/>
</antcall>
- <antcall target="tests.jboss-4.2.container-servlet">
+ </target>
+
+ <target name="__tests.jboss-4.2.1" if="JBOSS_4_2_1_HOME">
+ <antcall target="__tests.jboss-4.2.container-servlet">
<param name="test.id"
value="JBoss-4_2_1-container-servlet"/>
<param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_1"/>
<param name="test.jboss-4.2.home"
value="${JBOSS_4_2_1_HOME}"/>
<param name="test.jboss-4.2.home.variable-name"
value="JBOSS_4_2_1_HOME"/>
<param name="test.jboss-4.2.tempdir"
value="${target}/cargo-tmp/4_2_1"/>
</antcall>
- <antcall target="tests.jboss-4.2.container-servlet">
+ </target>
+
+ <target name="__tests.jboss-4.2.2" if="JBOSS_4_2_2_HOME">
+ <antcall target="__tests.jboss-4.2.container-servlet">
<param name="test.id"
value="JBoss-4_2_2-container-servlet"/>
<param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_2"/>
<param name="test.jboss-4.2.home"
value="${JBOSS_4_2_2_HOME}"/>
@@ -648,7 +690,24 @@
</antcall>
</target>
- <target name="cargo.jboss-5.0.start" depends="cargo.setup">
+ <target name="__tests.jboss-4.2.3" if="JBOSS_4_2_3_HOME">
+ <antcall target="__tests.jboss-4.2.container-servlet">
+ <param name="test.id"
value="JBoss-4_2_3-container-servlet"/>
+ <param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_3"/>
+ <param name="test.jboss-4.2.home"
value="${JBOSS_4_2_3_HOME}"/>
+ <param name="test.jboss-4.2.home.variable-name"
value="JBOSS_4_2_3_HOME"/>
+ <param name="test.jboss-4.2.tempdir"
value="${target}/cargo-tmp/4_2_3"/>
+ </antcall>
+ </target>
+
+ <target name="tests.jboss-4.2">
+ <antcall target="__tests.jboss-4.2.0"/>
+ <antcall target="__tests.jboss-4.2.1"/>
+ <antcall target="__tests.jboss-4.2.2"/>
+ <antcall target="__tests.jboss-4.2.3"/>
+ </target>
+
+ <target name="__cargo.jboss-5.0.start"
depends="__cargo.setup">
<!-- The lib portal-test-lib.jar must be loaded at the shared level rather than
in the war file
otherwise it is somehow inspected and produce a NoClassDefFoundError in the
web service integration
layer on the class
org/jboss/portal/test/framework/driver/remote/RemoteTestDriver for some unknown
@@ -682,7 +741,7 @@
</cargo>
</target>
- <target name="cargo.jboss-5.0.stop" depends="cargo.setup">
+ <target name="__cargo.jboss-5.0.stop"
depends="__cargo.setup">
<cargo
containerId="jboss5x"
home="${test.jboss-5.0.home}"
@@ -697,33 +756,33 @@
<target name="tests.jboss-5.0.container-servlet"
if="${test.jboss-5.0.home.variable-name}">
<echo message="Starting JBoss 5.0 container-servlet tests with
${test.jboss-5.0.home}"/>
- <antcall target="cargo.jboss-5.0.start">
+ <antcall target="__cargo.jboss-5.0.start">
<param name="cargo.wait" value="false"/>
<param name="test.spi.server.path"
value="${test.archive.path}"/>
</antcall>
- <antcall target="tests.remote">
+ <antcall target="__tests.remote">
<param name="test.server.name"
value="${test.jboss-5.0.name}"/>
<param name="test.deploy.name"
value="jboss-5.0-container-servlet"/>
</antcall>
- <antcall target="cargo.jboss-5.0.stop">
+ <antcall target="__cargo.jboss-5.0.stop">
</antcall>
</target>
<target name="tests.jboss-5.0.generic"
if="${test.jboss-5.0.home.variable-name}">
<echo message="Starting JBoss 5.0 generic tests with
${test.jboss-5.0.home}"/>
- <antcall target="cargo.jboss-5.0.start">
+ <antcall target="__cargo.jboss-5.0.start">
<param name="cargo.wait" value="false"/>
<param name="test.spi.server.path"
value="${test.archive.path}"/>
</antcall>
- <antcall target="tests.remote">
+ <antcall target="__tests.remote">
<param name="test.server.name"
value="${test.jboss-5.0.name}"/>
<param name="test.deploy.name"
value="jboss-5.0-generic"/>
</antcall>
- <antcall target="cargo.jboss-5.0.stop">
+ <antcall target="__cargo.jboss-5.0.stop">
</antcall>
</target>
- <target name="tests.jboss-5.0">
+ <target name="tests.jboss-5.0" if="JBOSS_5_0_HOME">
<antcall target="tests.jboss-5.0.container-servlet">
<param name="test.id"
value="JBoss-5_0-container-servlet"/>
<param name="test.jboss-5.0.name"
value="RemoteJBoss_5_0"/>
@@ -738,8 +797,14 @@
<!-- <antcall target="tests.jboss-5.0"/> -->
</target>
- <target name="cargo.tomcat-6.start" depends="cargo.setup">
+ <target name="tests.local">
+ <antcall target="tests.jboss"/>
+ <antcall target="tests.jetty"/>
+ <antcall target="tests.tomcat"/>
+ </target>
+ <target name="__cargo.tomcat-6.start"
depends="__cargo.setup">
+
<taskdef resource="cargo.tasks">
<classpath>
<pathelement path="${plugin_classpath}"/>
@@ -768,7 +833,7 @@
</cargo>
</target>
- <target name="cargo.tomcat-6.stop" depends="cargo.setup">
+ <target name="__cargo.tomcat-6.stop"
depends="__cargo.setup">
<cargo
containerId="tomcat6x"
home="${test.tomcat-6.home}"
@@ -778,19 +843,19 @@
</cargo>
</target>
- <target name="tests.tomcat-6.container-servlet"
if="${test.tomcat-6.home.variable-name}">
+ <target name="__tests.tomcat-6.container-servlet"
if="${test.tomcat-6.home.variable-name}">
<echo message="Starting Tomcat 6 container-servlet tests with
${test.tomcat-6.home}"/>
- <antcall target="cargo.tomcat-6.start">
+ <antcall target="__cargo.tomcat-6.start">
<param name="cargo.wait" value="false"/>
</antcall>
- <antcall target="tests.remote">
+ <antcall target="__tests.remote">
<param name="test.server.name"
value="RemoteTomcat_6_0"/>
</antcall>
- <antcall target="cargo.tomcat-6.stop"/>
+ <antcall target="__cargo.tomcat-6.stop"/>
</target>
<target name="tests.tomcat-6">
- <antcall target="tests.tomcat-6.container-servlet">
+ <antcall target="__tests.tomcat-6.container-servlet">
<param name="test.id"
value="Tomcat-6_0-container-servlet"/>
<param name="test.tomcat-6.name"
value="RemoteTomcat_6_0"/>
<param name="test.tomcat-6.home"
value="${TOMCAT_6_0_HOME}"/>
@@ -802,7 +867,7 @@
<antcall target="tests.tomcat-6"/>
</target>
- <target name="cargo.jetty-6.start" depends="cargo.setup">
+ <target name="__cargo.jetty-6.start"
depends="__cargo.setup">
<taskdef resource="cargo.tasks">
<classpath>
@@ -834,7 +899,7 @@
</cargo>
</target>
- <target name="cargo.jetty-6.stop" depends="cargo.setup">
+ <target name="__cargo.jetty-6.stop"
depends="__cargo.setup">
<cargo
containerId="jetty6x"
home="${test.jetty-6.home}"
@@ -846,13 +911,13 @@
<target name="tests.jetty-6.container-servlet"
if="${test.jetty-6.home.variable-name}">
<echo message="Starting Jetty 6 container-servlet tests with
${test.jetty-6.home}"/>
- <antcall target="cargo.jetty-6.start">
+ <antcall target="__cargo.jetty-6.start">
<param name="cargo.wait" value="false"/>
</antcall>
- <antcall target="tests.remote">
+ <antcall target="__tests.remote">
<param name="test.server.name"
value="RemoteJetty_6_1"/>
</antcall>
- <antcall target="cargo.jetty-6.stop"/>
+ <antcall target="__cargo.jetty-6.stop"/>
</target>
<target name="tests.jetty-6">
@@ -868,7 +933,7 @@
<antcall target="tests.jetty-6"/>
</target>
- <target name="tests.remote">
+ <target name="__tests.remote">
<taskdef name="jboss-unit"
classname="org.jboss.unit.tooling.ant.JBossUnitTask"
classpath="${plugin_classpath}"/>
Modified: modules/portlet/trunk/test/src/test/resources/test/servers.xml
===================================================================
--- modules/portlet/trunk/test/src/test/resources/test/servers.xml 2009-01-13 15:25:44 UTC
(rev 12488)
+++ modules/portlet/trunk/test/src/test/resources/test/servers.xml 2009-01-13 18:07:42 UTC
(rev 12489)
@@ -97,7 +97,25 @@
</deployer>
</node>
</server>
- <server>
+ <server>
+ <server-name>RemoteJBoss_4_2_3</server-name>
+ <node>
+ <node-id>default</node-id>
+ <service>
+ <service-name>TestDriverServer</service-name>
+
<interface>org.jboss.unit.remote.driver.RemoteTestDriver</interface>
+ <uri>socket://localhost:5400</uri>
+ </service>
+ <deployer>
+ <remote>
+ <name>jboss4x</name>
+ <host>localhost</host>
+ <port>8080</port>
+ </remote>
+ </deployer>
+ </node>
+ </server>
+ <server>
<server-name>RemoteJBoss_5_0</server-name>
<node>
<node-id>default</node-id>