[seam-commits] Seam SVN: r11361 - in branches/community/Seam_2_2/src/test/ftest: examples and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Aug 11 04:42:30 EDT 2009


Author: oskutka at redhat.com
Date: 2009-08-11 04:42:30 -0400 (Tue, 11 Aug 2009)
New Revision: 11361

Modified:
   branches/community/Seam_2_2/src/test/ftest/build.xml
   branches/community/Seam_2_2/src/test/ftest/examples/build.xml
   branches/community/Seam_2_2/src/test/ftest/ftest.ci.properties
   branches/community/Seam_2_2/src/test/ftest/ftest.properties
Log:
JBSEAM-4293 Make JBoss restart after a specified number of ftests run to prevent OutOfMemoryError

Modified: branches/community/Seam_2_2/src/test/ftest/build.xml
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/build.xml	2009-08-10 23:27:39 UTC (rev 11360)
+++ branches/community/Seam_2_2/src/test/ftest/build.xml	2009-08-11 08:42:30 UTC (rev 11361)
@@ -42,6 +42,9 @@
 		</fileset>
 	</path>
 
+	<!-- TODO : should the libs be in seam/lib and managed with mvn? -->
+	<taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpath="../../../lib/groovy-all.jar"/>
+
 	<target name="testall" description="Run functional testsuite based on container property">
 		<fail unless="container">Please set container property.</fail>
 		<antcall target="testall.${container}" />
@@ -49,7 +52,7 @@
 
 	<target name="testall.jboss4" description="Run functional testsuite for JBoss 4">
 		<property name="container" value="jboss4" />
-		<antcall target="start.container.before.suite" />
+		<antcall target="start.container" />
 		<antcall target="start.selenium.server" />
 		<!-- Execute tests for all examples jboss-->
 		<testexample name="blog" />
@@ -82,11 +85,12 @@
 		<testexample name="wicket" />
 		<testexample name="wicket-runtime" />
 		<antcall target="stop.selenium.server" />
+		<antcall target="stop.container" />
 	</target>
 	
 	<target name="testall.jboss5" description="Run functional testsuite for JBoss 5">
 		<property name="container" value="jboss5" />
-		<antcall target="start.container.before.suite" />
+		<antcall target="start.container" />
 		<antcall target="start.selenium.server" />
 		<!-- Execute tests for all examples jboss-->
 		<testexample name="blog" />
@@ -119,6 +123,7 @@
 		<testexample name="wicket" />
 		<testexample name="wicket-runtime" />
 		<antcall target="stop.selenium.server" />
+		<antcall target="stop.container" />
 	</target>
 
 	<target name="testall.jboss-embedded" description="Run functional testsuite for JBoss Embedded">
@@ -159,7 +164,7 @@
 		<property name="container" value="jboss4" />
 		<antcall target="test.single.example" />
 	</target>
-	
+
 	<target name="test.jboss5" description="Run tests for single example on JBoss 5">
 		<property name="container" value="jboss5" />
 		<antcall target="test.single.example" />
@@ -279,6 +284,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>
@@ -312,8 +328,22 @@
 			</ant>
 		</sequential>
 	</macrodef>
+
+	<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="start.container.before.suite" if="run.container.per.suite">
+	<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}" />

Modified: branches/community/Seam_2_2/src/test/ftest/examples/build.xml
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/examples/build.xml	2009-08-10 23:27:39 UTC (rev 11360)
+++ branches/community/Seam_2_2/src/test/ftest/examples/build.xml	2009-08-11 08:42:30 UTC (rev 11361)
@@ -223,4 +223,25 @@
 		<server:start name="${container.profile}" />
 	</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="--server"/>
+				<arg value="jnp://localhost:1099"/>
+				<arg value="--shutdown"/>
+			</java>
+			<waitfor maxwait="300" maxwaitunit="second">
+				<not>
+					<socket server="localhost" port="1099" />
+				</not>
+			</waitfor>
+			<sleep seconds="3"/>
+		</sequential>
+	</target>
+
 </project>

Modified: branches/community/Seam_2_2/src/test/ftest/ftest.ci.properties
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/ftest.ci.properties	2009-08-10 23:27:39 UTC (rev 11360)
+++ branches/community/Seam_2_2/src/test/ftest/ftest.ci.properties	2009-08-11 08:42:30 UTC (rev 11361)
@@ -52,6 +52,9 @@
 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
 
+run.container.per.suite=true
+jboss.deployments.restart=10
+
 # seam-gen specific properties
 seamgen.delete.project=true
 

Modified: branches/community/Seam_2_2/src/test/ftest/ftest.properties
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/ftest.properties	2009-08-10 23:27:39 UTC (rev 11360)
+++ branches/community/Seam_2_2/src/test/ftest/ftest.properties	2009-08-11 08:42:30 UTC (rev 11361)
@@ -65,6 +65,9 @@
 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
 
+run.container.per.suite=true
+jboss.deployments.restart=10
+
 # seam-gen specific properties
 #seamgen.delete.project=true
 



More information about the seam-commits mailing list