[seam-commits] Seam SVN: r12465 - in branches/enterprise/JBPAPP_5_0: src/test/ftest and 2 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Apr 13 10:19:58 EDT 2010


Author: jharting
Date: 2010-04-13 10:19:58 -0400 (Tue, 13 Apr 2010)
New Revision: 12465

Modified:
   branches/enterprise/JBPAPP_5_0/.project
   branches/enterprise/JBPAPP_5_0/src/test/ftest/ftest.properties
   branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/build.xml
   branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/IdentityManagementTest.java
   branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/SeleniumSeamGenTest.java
Log:
minor

Modified: branches/enterprise/JBPAPP_5_0/.project
===================================================================
--- branches/enterprise/JBPAPP_5_0/.project	2010-04-13 12:23:07 UTC (rev 12464)
+++ branches/enterprise/JBPAPP_5_0/.project	2010-04-13 14:19:58 UTC (rev 12465)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
-	<name>jboss-seam</name>
+	<name>Seam_EAP5</name>
 	<comment></comment>
 	<projects>
 	</projects>

Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/ftest.properties
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/ftest.properties	2010-04-13 12:23:07 UTC (rev 12464)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/ftest.properties	2010-04-13 14:19:58 UTC (rev 12465)
@@ -25,7 +25,7 @@
 # Selenium testng specific 
 selenium.server.port=14444
 selenium.host=localhost
-selenium.browser=*firefoxproxy
+selenium.browser=*firefox /usr/lib64/firefox-3.5.8/firefox
 #selenium.browser=*iexploreproxy
 selenium.browser.port=8080
 selenium.browser.url=http://127.0.0.1:8080
@@ -50,11 +50,11 @@
 
 # container locations - must be set
 # independent from ${seam.dir}/build.properties
-jboss5.home=/home/mnovotny/apps/jboss-eap-5.0/jboss-as
+jboss5.home=/home/jharting/jboss/testing/EAP-5.0.1.CR2/jboss-eap-5.0/jboss-as
 
 # container settings
 jboss5.profile=default
-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"
+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
@@ -71,29 +71,28 @@
 
 # If set to true, the container is launched automatically prior to testsuite execution and shut down after it finishes
 # The container has to be run manually otherwise 
-seamgen.control.container=false
+#seamgen.control.container=false
 
 # workspace for new projects
-workspace.home=/home/mnovotny/tmp
+workspace.home=/home/jharting/temp/2
 
 # seam-gen project properties
 database.type=mysql
 database.exists=y
 database.drop=n
-driver.jar=/usr/share/java/mysql.jar
+driver.jar=/home/jharting/jboss/mysql-connector-java-5.1.11-bin.jar
 driver.license.jar=
-hibernate.connection.username=seam
-hibernate.connection.password=seam
+hibernate.connection.username=seamgen
+hibernate.connection.password=seamgen
 hibernate.connection.driver_class=com.mysql.jdbc.Driver
 hibernate.connection.dataSource_class=com.mysql.jdbc.jdbc2.optional.MysqlDataSource
 hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
 hibernate.default_catalog.null=
 hibernate.default_schema.null=
 hibernate.dialect=org.hibernate.dialect.MySQLDialect
-hibernate.connection.url=jdbc\:mysql\:///seamdb
+hibernate.connection.url=jdbc\:mysql\:///seam
 model.package=com.example
 action.package=com.example
 test.package=com.example.test
 richfaces.skin=classic
-jboss.domain=default
 # ant.exec=/usr/bin/ant

Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/build.xml	2010-04-13 12:23:07 UTC (rev 12464)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/build.xml	2010-04-13 14:19:58 UTC (rev 12465)
@@ -121,6 +121,7 @@
 	<macrodef name="run.selenium.test">
 		<attribute name="suite" />
 		<sequential>
+			<ant target="start.container"/>
 			<!--<ant antfile="${seam.dir}/build.xml" target="copyseam"/>
 			<ant antfile="${seam.dir}/build.xml" target="copyseamdependencies"/>-->
 			<taskdef resource="testngtasks" classpathref="classpath.test" />
@@ -130,7 +131,21 @@
 				<sysproperty key="seam.dir" value="${seam.dir}" />
 				<sysproperty key="ftest.config.location" value="${ftest.config.location}" />
 			</testng>
+			<ant target="stop.container"/>
 		</sequential>
 	</macrodef>
+	
+	<target name="start.container" if="run.container.per.suite">
+		<echo>Starting container</echo>
+		<ant antfile="${ftest.dir}/examples/build.xml" target="start.container.jboss" inheritall="false">
+			<property name="container" value="${container}" />
+		</ant>
+	</target>
+	<target name="stop.container" if="run.container.per.suite">
+		<echo>Stopping container</echo>
+		<ant antfile="${ftest.dir}/examples/build.xml" target="stop.container.jboss" inheritall="false">
+			<property name="container" value="${container}" />
+		</ant>
+	</target>
 
 </project>

Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/IdentityManagementTest.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/IdentityManagementTest.java	2010-04-13 12:23:07 UTC (rev 12464)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/IdentityManagementTest.java	2010-04-13 14:19:58 UTC (rev 12465)
@@ -63,7 +63,7 @@
    {
       seamGen.addIdentityManagement();
       seamGen.restart();
-      waitForAppToDeploy(HOME_PAGE, FOOTER);
+      waitForAppToDeploy(HOME_PAGE, IDENTITY_MANAGEMENT);
 
       // execute testing import script
       InputStream is = getClass().getResourceAsStream("/org/jboss/seam/test/functional/seamgen/identity-management.sql");

Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/SeleniumSeamGenTest.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/SeleniumSeamGenTest.java	2010-04-13 12:23:07 UTC (rev 12464)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/SeleniumSeamGenTest.java	2010-04-13 14:19:58 UTC (rev 12465)
@@ -130,22 +130,35 @@
    public void waitForAppToDeploy(String url, String element)
    {
       int step = 5000;
-      int i = DEPLOY_TIMEOUT;
+      int remainingTime = DEPLOY_TIMEOUT;
+      /*
+       * When using restart(), the application might be still available (not undeployed yet) when this method
+       * is executed, which result in a premature finish of this wait method. As a result, 
+       * a next test method fails since the application is in the middle of deployment.
+       * Therefore, we need to make sure we do not hit the "pre redeploy" state. We do this by requiring
+       * several successful page hits separated by 5 seconds.
+       */
+      int successes = 0;
+      int requiredSuccesses = 4; 
 
       SeamSelenium browser = startBrowser();
 
       browser.open(url);
       try
       {
-         while (!browser.isElementPresent(element))
+         while (successes < requiredSuccesses)
          {
-            i -= step;
-            if (i <= 0)
+            remainingTime -= step;
+            if (remainingTime <= 0)
             {
                throw new RuntimeException("Timeout waiting for " + element + " at " + url);
             }
             Thread.sleep(step);
             browser.open(url); // try again
+            if (browser.isElementPresent(element))
+            {
+               successes++;
+            }
          }
       }
       catch (InterruptedException ie)



More information about the seam-commits mailing list