[seam-commits] Seam SVN: r12355 - in branches/enterprise/JBPAPP_5_0/src/test/ftest: examples and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Thu Apr 1 06:44:03 EDT 2010


Author: jharting
Date: 2010-04-01 06:44:03 -0400 (Thu, 01 Apr 2010)
New Revision: 12355

Modified:
   branches/enterprise/JBPAPP_5_0/src/test/ftest/build.xml
   branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/build.xml
   branches/enterprise/JBPAPP_5_0/src/test/ftest/ftest.properties
Log:
Backported support for container management during functional test execution.

Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/build.xml	2010-04-01 09:03:49 UTC (rev 12354)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/build.xml	2010-04-01 10:44:03 UTC (rev 12355)
@@ -44,43 +44,28 @@
 			<include name="selenium-server-standalone.jar" />
 		</fileset>
 	</path>
+	
+	<taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpath="../../../lib/groovy-all.jar"/>
 
-	<target name="testall.1" description="Run functional testsuite for JBoss 5">
+	<target name="testall" description="Run functional testsuite for EAP 5">
 		<property name="container" value="jboss5" />
 		<antcall target="start.selenium.server" />
+		<antcall target="start.container" />
 		<testexample name="blog" />
 		<testexample name="booking" />
 		<testexample name="drools" />
 		<testexample name="dvdstore" />
 		<testexample name="contactlist" />
-		<antcall target="stop.selenium.server" />
-	</target>
-	
-	<target name="testall.2" description="Run functional testsuite for JBoss 5">
-		<property name="container" value="jboss5" />
-		<antcall target="start.selenium.server" />
 		<testexample name="excel" />
 		<testexample name="groovybooking" />
 		<testexample name="hibernate" />
 		<testexample name="itext" />
 		<testexample name="jee5/booking" />
-		<antcall target="stop.selenium.server" />
-	</target>
-	
-	<target name="testall.3" description="Run functional testsuite for JBoss 5">
-		<property name="container" value="jboss5" />
-		<antcall target="start.selenium.server" />
 		<testexample name="jpa" />
 		<testexample name="mail" />
 		<testexample name="messages" />
 		<testexample name="nestedbooking" />
 		<testexample name="numberguess" />
-		<antcall target="stop.selenium.server" />
-	</target>
-	
-	<target name="testall.4" description="Run functional testsuite for JBoss 5">
-		<property name="container" value="jboss5" />
-		<antcall target="start.selenium.server" />
 		<testexample name="openid" />
 		<testexample name="quartz" />
 		<testexample name="registration" />
@@ -88,12 +73,6 @@
 		<testexample name="remoting/helloworld" />
 		<testexample name="remoting/gwt" />
 		<testexample name="seambay" />
-		<antcall target="stop.selenium.server" />
-	</target>
-	
-	<target name="testall.5" description="Run functional testsuite for JBoss 5">
-		<property name="container" value="jboss5" />
-		<antcall target="start.selenium.server" />
         <testexample name="seamdiscs" />
 		<testexample name="seampay" />
 		<testexample name="seamspace" />
@@ -101,9 +80,11 @@
         <testexample name="tasks" />
 		<testexample name="todo" />
 		<testexample name="ui" />
+		<antcall target="stop.container"/>
 		<antcall target="stop.selenium.server" />
 	</target>
-
+	
+	
 	<target name="test" description="Run tests for single example. Container selection is based on the value of container property">
 		<fail unless="container">Please set container property.</fail>
 		<antcall target="test.${container}" />
@@ -221,6 +202,17 @@
 		<attribute name="path" default="examples/@{name}" />
 		<attribute name="message" default="Running functional tests on @{name} example" />
 		<sequential>
+			<groovy>
+				<![CDATA[
+				def testExamplesRunSoFar = properties['testExamplesRunSoFar'] == null ? 0 : Integer.valueOf(properties['testExamplesRunSoFar']);
+				def jbossDeploymentsRestart = properties['jboss.deployments.restart'] == null ? 0 : Integer.valueOf(properties['jboss.deployments.restart']);
+				if (jbossDeploymentsRestart > 0 && testExamplesRunSoFar > 0 && testExamplesRunSoFar % jbossDeploymentsRestart  == 0 ) {
+				ant.antcall(target:"restart.container");
+				}
+				testExamplesRunSoFar++;
+				properties['testExamplesRunSoFar'] = testExamplesRunSoFar;
+				]]>
+			</groovy>
 			<echo>@{message}</echo>
 			<callExample path="@{path}" target="test" />
 		</sequential>
@@ -255,11 +247,25 @@
 		</sequential>
 	</macrodef>
 	
-	<target name="start.container.before.suite" if="run.container.per.suite">
+	<target name="restart.container" if="run.container.per.suite">
+		<echo>Restarting container</echo>
+		<antcall target="stop.container" >
+		</antcall>
+		<antcall target="start.container" >
+		</antcall>
+	</target>
+
+	<target name="stop.container" if="run.container.per.suite">
+		<echo>Stopping container</echo>
+		<ant antfile="examples/build.xml" target="stop.container.jboss" inheritall="false">
+			<property name="container" value="${container}" />
+		</ant>
+	</target>
+	<target name="start.container" if="run.container.per.suite">
 		<echo>Starting container</echo>
 		<ant antfile="examples/build.xml" target="start.container.jboss" inheritall="false">
 			<property name="container" value="${container}" />
-		</ant>	
+		</ant>
 	</target>
 	
 </project>

Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/build.xml	2010-04-01 09:03:49 UTC (rev 12354)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/build.xml	2010-04-01 10:44:03 UTC (rev 12355)
@@ -251,6 +251,44 @@
 		<propertyset id="jboss5.deploy.properties" />
 	</target>
 
+	<target name="start.container.jboss" depends="container.properties">
+			<echo message="Starting JBoss server" />
+			<java classname="org.jboss.Main" fork="true" spawn="true" dir="${container.home}/bin">
+				<classpath>
+					<pathelement location="${container.home}/bin/run.jar" />
+				</classpath>
+	            <sysproperty key="java.endorsed.dirs" value="${container.home}/lib/endorsed" />
+				<jvmarg line="${container.jvm.arguments}" />
+				<arg line="-c ${jboss.domain} -b ${jboss.host}" />
+			</java>
+			<waitfor maxwait="2" maxwaitunit="minute">
+				<socket server="localhost" port="8080" />
+			</waitfor>
+		</target>
+
+		<target name="stop.container.jboss" depends="container.properties" >
+			<sequential>
+				<echo message="Shutting down JBoss server"/>
+				<java classname="org.jboss.Shutdown" fork="false" dir="${container.home}/bin">
+					<classpath>
+						<pathelement location="${container.home}/bin/shutdown.jar" />
+						<!--<pathelement location="${container.home}/client/jbossall-client.jar" />-->
+					</classpath>
+					<arg value="--shutdown"/>
+					<arg value="-u"/>
+					<arg value="${jboss.jmx.username}"/>
+					<arg value="-p"/>
+					<arg value="${jboss.jmx.password}"/>
+				</java>
+				<waitfor maxwait="300" maxwaitunit="second">
+					<not>
+						<socket server="localhost" port="1099" />
+					</not>
+				</waitfor>
+				<sleep seconds="3"/>
+			</sequential>
+		</target>
+	
 	<!-- Target for obtaining htmlunit  -->
 	<target name="copy.htmlunit" if="depends.htmlunit" unless="copy.htmlunit.done">
 		<copyInlineDependencies id="allexamples" scope="compile" todir="${ftest.lib.dir}">

Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/ftest.properties
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/ftest.properties	2010-04-01 09:03:49 UTC (rev 12354)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/ftest.properties	2010-04-01 10:44:03 UTC (rev 12355)
@@ -54,8 +54,18 @@
 
 # container settings
 jboss5.profile=default
-jboss5.jvm.arguments=-Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512 -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000
+jboss5.jvm.arguments=-Xms512m -Xmx1024m -XX:MaxPermSize=512m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.lang.ClassLoader.allowArraySyntax=true"
 
+run.container.per.suite=true
+jboss.deployments.restart=10
+jboss.domain=default
+jboss.host=localhost
+
+# These credentials are needed for JBoss restart. See ${JBOSS_HOME}/server/${jboss.profile}/conf/props/jmx-console-users.properties
+jboss.jmx.username=admin
+jboss.jmx.password=admin
+
+
 # seam-gen specific properties
 #seamgen.delete.project=true
 



More information about the seam-commits mailing list