[seam-commits] Seam SVN: r10673 - in branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest: lib and 30 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Apr 28 07:13:00 EDT 2009


Author: manaRH
Date: 2009-04-28 07:13:00 -0400 (Tue, 28 Apr 2009)
New Revision: 10673

Added:
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/lib/ant-launcher.jar
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/lib/ant.jar
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/lib/jboss-test-1.0.5.GA.jar
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build.xml
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/AjaxTest.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/BackButtonTest.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/ChangePasswordTest.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/ConversationTest.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/RegistrationTest.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/SeleniumBookingTest$1.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/SeleniumBookingTest$2.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/SeleniumBookingTest$3.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/SeleniumBookingTest.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/SimpleBookingTest.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/numberguess/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/numberguess/selenium/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/numberguess/selenium/CommonNumberGuessTest.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/seampay/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/seampay/selenium/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/seampay/selenium/PaymentTest.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/selenium/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/selenium/SeamSelenium$1.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/selenium/SeamSelenium$2.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/selenium/SeamSelenium.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/selenium/SeamSeleniumTest.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/DatabaseTest.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/GenerateEntitiesTest$1.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/GenerateEntitiesTest.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/HotDeploymentNewFormTest.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/HotDeploymentStaticTest.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/NewActionTest.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/NewFormTest.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/NewProjectTest.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/PersonTest.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/SeamGenTest.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/SeleniumSeamGenTest.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/VehicleTest.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/generate-entities.sql
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/utils/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/utils/SeamGenAdapter$1.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/utils/SeamGenAdapter.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/utils/SeleniumTestListener.class
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/readme.txt
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/richfaces.xml
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/smoke.xml
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/DatabaseTest.java
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/GenerateEntitiesTest.java
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/HotDeploymentNewFormTest.java
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/HotDeploymentStaticTest.java
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/NewActionTest.java
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/NewFormTest.java
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/NewProjectTest.java
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/PersonTest.java
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/SeamGenTest.java
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/SeleniumSeamGenTest.java
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/VehicleTest.java
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/generate-entities.sql
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/utils/
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/utils/SeamGenAdapter.java
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/utils/SeleniumTestListener.java
Modified:
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/ftest.properties
   branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSelenium.java
Log:
JBPAPP-1899

Modified: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/ftest.properties
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/ftest.properties	2009-04-28 07:36:10 UTC (rev 10672)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/ftest.properties	2009-04-28 11:13:00 UTC (rev 10673)
@@ -29,7 +29,7 @@
 selenium.browser.port=8080
 selenium.browser.url=http://127.0.0.1:8080
 selenium.speed=0
-selenium.timeout=30000
+selenium.timeout=120000
 
 # enter any commands wanted for the testng run
 selenium.testng.jvmargs=-Dfoo
@@ -43,8 +43,33 @@
 jboss.deploy.target=deploy
 jboss.undeploy.target=undeploy
 # default wait times
-jboss.deploy.waittime=120
+jboss.deploy.waittime=300
 # default wait urls
 jboss.example.ready.check.url=seam-${example.name}/
 
+# seam-gen specific properties
+#seamgen.delete.project=true
+# workspace for new projects
+workspace.home=/home/mnovotny/tmp
+# seam-gen project properties
+database.type=mysql
+database.exists=y
+database.drop=n
+driver.jar=/usr/share/java/mysql.jar
+driver.license.jar=
+hibernate.connection.username=medium
+hibernate.connection.password=medium
+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\:///test
+model.package=com.example
+action.package=com.example
+test.package=com.example.test
+richfaces.skin=classic
+jboss.domain=default
+seam.dir=/home/mnovotny/workspaces/jboss/jboss-seam-fp
 

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/lib/ant-launcher.jar
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/lib/ant-launcher.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/lib/ant.jar
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/lib/ant.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/lib/jboss-test-1.0.5.GA.jar
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/lib/jboss-test-1.0.5.GA.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/AjaxTest.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/AjaxTest.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/BackButtonTest.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/BackButtonTest.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/ChangePasswordTest.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/ChangePasswordTest.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/ConversationTest.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/ConversationTest.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/RegistrationTest.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/RegistrationTest.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/SeleniumBookingTest$1.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/SeleniumBookingTest$1.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/SeleniumBookingTest$2.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/SeleniumBookingTest$2.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/SeleniumBookingTest$3.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/SeleniumBookingTest$3.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/SeleniumBookingTest.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/SeleniumBookingTest.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/SimpleBookingTest.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/booking/selenium/SimpleBookingTest.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/numberguess/selenium/CommonNumberGuessTest.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/numberguess/selenium/CommonNumberGuessTest.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/seampay/selenium/PaymentTest.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/seampay/selenium/PaymentTest.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/selenium/SeamSelenium$1.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/selenium/SeamSelenium$1.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/selenium/SeamSelenium$2.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/selenium/SeamSelenium$2.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/selenium/SeamSelenium.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/selenium/SeamSelenium.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/selenium/SeamSeleniumTest.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/example/common/test/selenium/SeamSeleniumTest.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/DatabaseTest.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/DatabaseTest.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/GenerateEntitiesTest$1.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/GenerateEntitiesTest$1.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/GenerateEntitiesTest.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/GenerateEntitiesTest.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/HotDeploymentNewFormTest.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/HotDeploymentNewFormTest.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/HotDeploymentStaticTest.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/HotDeploymentStaticTest.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/NewActionTest.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/NewActionTest.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/NewFormTest.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/NewFormTest.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/NewProjectTest.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/NewProjectTest.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/PersonTest.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/PersonTest.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/SeamGenTest.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/SeamGenTest.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/SeleniumSeamGenTest.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/SeleniumSeamGenTest.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/VehicleTest.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/VehicleTest.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/generate-entities.sql
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/generate-entities.sql	                        (rev 0)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/generate-entities.sql	2009-04-28 11:13:00 UTC (rev 10673)
@@ -0,0 +1,26 @@
+# This script is executed prior to "generate-entitiesTest" phase of a testsuite to feed the database with test data.
+#
+# by Jozef Hartinger
+#
+
+# drop itentity management tables from previous run
+DROP TABLE IF EXISTS user_account;
+DROP TABLE IF EXISTS user_account_role;
+DROP TABLE IF EXISTS user_permission;
+DROP TABLE IF EXISTS user_role;
+DROP TABLE IF EXISTS user_role_group;
+
+# empty testing tables
+DELETE FROM Vehicle;
+DELETE FROM Person;
+
+# Person table inserts
+INSERT INTO Person (username, name, birthdate, address) values ('johny', 'John Doe', '2009-01-01', 'test address'); # updatePersonTest
+INSERT INTO Person (username, name, birthdate, address) values ('jane', 'Jane Doe', '2009-01-01', 'test address'); # removePersonTest
+INSERT INTO Person (username, name, birthdate, address) values ('jharting', 'Jozef Hartinger', '1987-01-01', 'Purkynova 99, Brno'); # selectVehicleTest
+
+# Vehicle table inserts
+INSERT INTO Vehicle (make, model, year, registration, state) values ('Honda', 'Civic', '2008', '11111111', 'CZ'); # updateVehicleTest
+INSERT INTO Vehicle (make, model, year, registration, state) values ('Nissan', '350z', '2006', '22222222', 'CZ'); # removeVehicleTest
+INSERT INTO Vehicle (make, model, year, registration, state) values ('Audi', 'A5', '2009', '99999991', 'CZ'); # searchTest
+INSERT INTO Vehicle (make, model, year, registration, state) values ('Audi', 'A4', '2009', '99999992', 'CZ'); # searchTest
\ No newline at end of file

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/utils/SeamGenAdapter$1.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/utils/SeamGenAdapter$1.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/utils/SeamGenAdapter.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/utils/SeamGenAdapter.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/utils/SeleniumTestListener.class
===================================================================
(Binary files differ)


Property changes on: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build/classes/org/jboss/seam/test/functional/seamgen/utils/SeleniumTestListener.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build.xml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build.xml	                        (rev 0)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/build.xml	2009-04-28 11:13:00 UTC (rev 10673)
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+<project name="ftest.seamgen" basedir="." default="build" xmlns:server="http://jboss.org/ns/test/ant/server">
+
+	<!-- Location of Seam -->
+	<dirname property="seam.dir" file="${ant.file.ftest.seamgen}/../../../../" />
+	
+	<!-- default property setup -->
+	<property name="ftest.dir" value="${seam.dir}/src/test/ftest" />
+	<property name="common.src.dir" value="${ftest.dir}/src/main" />
+	<property name="src.dir" value="src/main" />
+	<property name="build.dir" value="build" />
+	<property name="classes.dir" value="${build.dir}/classes" />
+	<property name="test.output.dir" value="${seam.dir}/test-output" />
+	<property name="ftest.lib.dir" value="${ftest.dir}/lib" />
+
+	<property file="${seam.dir}/src/test/ftest/ftest.properties" />
+	
+	<!-- common path setup -->
+
+	<path id="classpath.build">
+		<fileset dir="${ftest.lib.dir}" includes="**/*.jar" />
+	</path>
+
+	<path id="classpath.test">
+		<path refid="classpath.build" />
+		<path location="${classes.dir}" />
+		<fileset dir="${seam.dir}/lib/gen" includes="*.jar" />
+		<fileset file="${java.home}/../lib/tools.jar"/>
+		<fileset file="${driver.jar}"/>
+		<!-- TODO why do we need this? -->
+		<fileset dir="${seam.dir}/lib" includes="*.jar" />
+	</path>
+
+	<target name="clean" description="Delete all generated files">
+		<delete dir="${build.dir}" />
+		<delete dir="${test.output.dir}" />
+		<delete dir="${report.dir}" />
+		<delete dir="${log.dir}" />
+	</target>
+
+	<target name="build" depends="build.common" description="Compiles the Test">
+		<mkdir dir="${classes.dir}" />
+		<javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath.build" debug="true" />
+		<copy todir="${classes.dir}">
+			<fileset dir="${src.dir}">
+				<exclude name="**/*.java" />
+			</fileset>
+		</copy>
+	</target>
+
+	<target name="build.common" description="Compiles the common selenium test code">
+		<mkdir dir="${classes.dir}" />
+		<javac srcdir="${common.src.dir}" destdir="${classes.dir}" classpathref="classpath.build" debug="true" />
+		<copy todir="${classes.dir}">
+			<fileset dir="${src.dir}">
+				<include name="**/SeamSelenium.java" />
+			</fileset>
+		</copy>
+	</target>
+
+	<target name="seam-gen.testsuite" depends="build" description="Run Richfaces testsuite">
+		<run.selenium.test suite="richfaces" />
+	</target>
+
+	<target name="seam-gen.smoke.testsuite" depends="build" description="Run smoke testsuite">
+		<run.selenium.test suite="smoke" />
+	</target>
+
+	<macrodef name="run.selenium.test">
+		<attribute name="suite" />
+		<sequential>
+			<!--<ant antfile="${seam.dir}/build.xml" target="copyseam"/>-->
+			<taskdef resource="testngtasks" classpathref="classpath.test" />
+			<!-- execute testng tests -->
+			<testng haltonfailure="false" outputdir="${test.output.dir}" classpathref="classpath.test">
+				<xmlfileset file="@{suite}.xml" />
+				<sysproperty key="seam.dir" value="${seam.dir}" />
+			</testng>
+		</sequential>
+	</macrodef>
+
+</project>

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/readme.txt
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/readme.txt	                        (rev 0)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/readme.txt	2009-04-28 11:13:00 UTC (rev 10673)
@@ -0,0 +1,105 @@
+#
+ # JBoss, Home of Professional Open Source
+ # Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ # by the @authors tag. See the copyright.txt in the distribution for a
+ # full listing of individual contributors.
+ #
+ # This is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU Lesser General Public License as
+ # published by the Free Software Foundation; either version 2.1 of
+ # the License, or (at your option) any later version.
+ #
+ # This software is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ # Lesser General Public License for more details.
+ #
+ # You should have received a copy of the GNU Lesser General Public
+ # License along with this software; if not, write to the Free
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ # 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ # 
+ 
+Seam-gen functional testsuite
+------------------------------------
+
+UNDER DEVELOPMENT NOT COMPLETE
+
+How to run the testsuite:
+----------------------
+To run seam-gen functional testsuite, please follow these steps:
+
+1.) Export following script to MySQL database
+
+CREATE TABLE `Person` (
+  `username` varchar(10) NOT NULL,
+  `name` varchar(100) NOT NULL,
+  `birthdate` date default NULL,
+  `address` varchar(600) NOT NULL,
+  PRIMARY KEY  (`username`)
+) ENGINE=InnoDB;
+
+CREATE TABLE `Vehicle` (
+  `ownerUsername` varchar(10) default NULL,
+  `make` varchar(50) NOT NULL,
+  `model` varchar(50) NOT NULL,
+  `year` int(11) NOT NULL,
+  `registration` varchar(8) NOT NULL,
+  `state` varchar(2) NOT NULL,
+  PRIMARY KEY USING BTREE (`registration`,`state`),
+  KEY `ownerUsername` (`ownerUsername`),
+  CONSTRAINT `owner` FOREIGN KEY (`ownerUsername`) REFERENCES `Person` (`username`)
+) ENGINE=InnoDB;
+
+
+2.) Check setup in ../ftest.properties
+	a) check that selenium.browser property is set to your desired browser
+	b) check that container property is set to either jboss4 or jboss5
+	c) check that jboss*.deploy.waittime is set to sensible value
+	d) check that jboss*.home points to the location of your application server
+	e) check that seamgen.delete.project property is set to true if you want the generated applications
+		to be deleted immediately after testrun
+	f) check that workspace.home property points to a folder where generated applications should be stored temporarily
+	g) check that seam-gen project properties (at the end of ftest.properties) are set correctly.
+		Pay special attention to database connection related properties (Configure to use MySQL with exported tables).
+		
+3.) Start application server. Make sure there are no application deployed from previous test run.
+#TODO automate this step
+
+4.) Run tests.
+	Run "ant seam-gen.testsuite" to test seam-gen.		
+	
+	The matrix describing these testsuites follows:
+	---------------------------------------------
+	|						EAR			WAR		|
+	|use deploy target		X			X		|
+	|use explode target		X			X		|
+	---------------------------------------------
+	
+	
+5.) Run "ant testreport" in ${seam.dir} to generate nice looking testreports. 
+	For every failed test, there is a screenshot and HTML source stored in test-output/functional-framework	
+
+
+Known Limitations:
+---------------------
+* Container must be started (preferably with nothing deployed)
+
+Running tests from Eclipse
+---------------------
+In order to run the testsuite from IDE, you need testng plugin http://testng.org/doc/eclipse.html
+The procedure of running the testsuite from Eclipse is identical to instructions above, however you must replace step 3 with
+following steps:
+a) Rightclick on the testsuite's xml file, choose 'Run As' and then 'Run Configurations'
+b) Modify the classpath to contain ${seam.dir}/lib/gen folder as well as mysql driver jar file
+c) Run the testsuite by rightclick -> 'Run As' -> 'TestNG Suite'
+
+
+Testsuite customization
+---------------------
+To customize the testsuite, edit particular xml file in this folder.
+You can use following parameters to influence seam-gen application type:
+1.) type - set to ear or war, ear is the default value
+2.) explode - set to true or false, if set to false, application will be deployed and undeployed using (un)deploy target.
+	(un)explode target will be used otherwise. True is the default value.
+3.) suffix - value of this parameter will be appended to the application name.

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/richfaces.xml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/richfaces.xml	                        (rev 0)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/richfaces.xml	2009-04-28 11:13:00 UTC (rev 10673)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+<suite name="seam-gen RichFaces suite" parallel="false" verbose="3">
+	<listeners>
+		<listener
+			class-name="org.jboss.seam.test.functional.seamgen.utils.SeleniumTestListener" />
+	</listeners>
+	<parameter name="suffix" value="001" />
+	<test name="RichFaces exploded Ear Test">
+		<parameter name="type" value="ear" />
+		<classes>
+			<class name="org.jboss.seam.test.functional.seamgen.NewProjectTest" />
+			<class name="org.jboss.seam.test.functional.seamgen.NewActionTest" />
+			<class name="org.jboss.seam.test.functional.seamgen.NewFormTest" />
+			<class
+				name="org.jboss.seam.test.functional.seamgen.HotDeploymentStaticTest" />
+			<class name="org.jboss.seam.test.functional.seamgen.PersonTest" />
+			<class name="org.jboss.seam.test.functional.seamgen.VehicleTest" />
+		</classes>
+	</test>
+	<test name="RichFaces exploded War Test">
+		<parameter name="type" value="war" />
+		<classes>
+			<class name="org.jboss.seam.test.functional.seamgen.NewProjectTest" />
+			<class name="org.jboss.seam.test.functional.seamgen.NewActionTest" />
+			<class name="org.jboss.seam.test.functional.seamgen.NewFormTest" />
+			<class
+				name="org.jboss.seam.test.functional.seamgen.HotDeploymentNewFormTest" />
+			<class
+				name="org.jboss.seam.test.functional.seamgen.HotDeploymentStaticTest" />
+			<class name="org.jboss.seam.test.functional.seamgen.PersonTest" />
+			<class name="org.jboss.seam.test.functional.seamgen.VehicleTest" />
+		</classes>
+	</test>
+	<test name="RichFaces Ear Test">
+		<parameter name="type" value="ear" />
+		<parameter name="explode" value="false" />
+		<classes>
+			<class name="org.jboss.seam.test.functional.seamgen.NewProjectTest" />
+			<class name="org.jboss.seam.test.functional.seamgen.NewActionTest" />
+			<class name="org.jboss.seam.test.functional.seamgen.NewFormTest" />
+			<class name="org.jboss.seam.test.functional.seamgen.PersonTest" />
+			<class name="org.jboss.seam.test.functional.seamgen.VehicleTest" />
+		</classes>
+	</test>
+	<test name="RichFaces War Test">
+		<parameter name="type" value="war" />
+		<parameter name="explode" value="false" />
+		<classes>
+			<class name="org.jboss.seam.test.functional.seamgen.NewProjectTest" />
+			<class name="org.jboss.seam.test.functional.seamgen.NewActionTest" />
+			<class name="org.jboss.seam.test.functional.seamgen.NewFormTest" />
+			<class name="org.jboss.seam.test.functional.seamgen.PersonTest" />
+			<class name="org.jboss.seam.test.functional.seamgen.VehicleTest" />
+		</classes>
+	</test>
+</suite>

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/smoke.xml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/smoke.xml	                        (rev 0)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/smoke.xml	2009-04-28 11:13:00 UTC (rev 10673)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+<suite name="seam-gen smoke testsuite" parallel="false" verbose="3">
+	<listeners>
+		<listener
+			class-name="org.jboss.seam.test.functional.seamgen.utils.SeleniumTestListener"></listener>
+	</listeners>
+	<parameter name="suffix" value="smoke001"/>
+	<test name="RichFaces exploded Ear Test">
+		<parameter name="type" value="ear" />
+		<classes>
+			<class name="org.jboss.seam.test.functional.seamgen.NewProjectTest" />
+		</classes>
+	</test>
+	<test name="RichFaces exploded War Test">
+		<parameter name="type" value="war" />
+		<classes>
+			<class name="org.jboss.seam.test.functional.seamgen.NewProjectTest" />
+		</classes>
+	</test>
+	<test name="RichFaces Ear Test">
+		<parameter name="type" value="ear" />
+		<parameter name="explode" value="false" />
+		<classes>
+			<class name="org.jboss.seam.test.functional.seamgen.NewProjectTest" />
+		</classes>
+	</test>
+	<test name="RichFaces War Test">
+		<parameter name="type" value="war" />
+		<parameter name="explode" value="false" />
+		<classes>
+			<class name="org.jboss.seam.test.functional.seamgen.NewProjectTest" />
+		</classes>
+	</test>
+</suite>
\ No newline at end of file

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/DatabaseTest.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/DatabaseTest.java	                        (rev 0)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/DatabaseTest.java	2009-04-28 11:13:00 UTC (rev 10673)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.test.functional.seamgen;
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.sql.Connection;
+import java.sql.DriverManager;
+
+/**
+ * Every test that uses database and needs import script to be executed should
+ * extend this class.
+ * 
+ * @author Jozef Hartinger
+ * 
+ */
+public class DatabaseTest extends SeleniumSeamGenTest
+{
+
+   /**
+    * Execute import script against the database defined in import.sql
+    */
+   public void executeImportScript(InputStream is)
+   {
+      Connection conn = null;
+      try
+      {
+         Class.forName(ftestProperties.getProperty("hibernate.connection.driver_class"));
+         String url = ftestProperties.getProperty("hibernate.connection.url");
+         conn = DriverManager.getConnection(url, ftestProperties.getProperty("hibernate.connection.username"), ftestProperties.getProperty("hibernate.connection.username"));
+         BufferedReader reader = new BufferedReader(new InputStreamReader(is));
+         String line = reader.readLine();
+         while (line != null)
+         {
+            if (!line.equals(new String())) // don't execute empty lines
+            {
+               conn.createStatement().execute(line);
+            }
+            line = reader.readLine();
+         }
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException("Database import script failed.", e);
+      }
+      finally
+      {
+         try
+         {
+            conn.close();
+         }
+         catch (Exception e)
+         {
+         }
+      }
+   }
+
+}

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/GenerateEntitiesTest.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/GenerateEntitiesTest.java	                        (rev 0)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/GenerateEntitiesTest.java	2009-04-28 11:13:00 UTC (rev 10673)
@@ -0,0 +1,176 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.test.functional.seamgen;
+
+import java.io.InputStream;
+import java.util.Date;
+
+import org.testng.annotations.BeforeGroups;
+
+import com.thoughtworks.selenium.Wait;
+
+/**
+ * This class and its subclasses test seam-gen's "generate-entities" feature.
+ * Every test method should be part of "generate-entitiesTest" in order to get
+ * entities generated before its execution.
+ * 
+ * @author Jozef Hartinger
+ * 
+ */
+public class GenerateEntitiesTest extends DatabaseTest
+{
+
+   public static final String PERSON_LINK = "id=PersonId";
+   public static final String PERSON_USERNAME = "id=person:usernameField:username";
+   public static final String PERSON_ADDRESS = "id=person:addressField:address";
+   public static final String PERSON_BIRTHDAY = "id=person:birthdateField:birthdate";
+   public static final String PERSON_NAME = "id=person:nameField:name";
+   public static final String PERSON_SAVE = "id=person:save";
+   public static final String PERSON_CANCEL = "id=person:cancel";
+   public static final String PERSON_DELETE = "id=person:delete";
+   public static final String PERSON_UPDATE = "id=person:update";
+   public static final int PERSON_IDENTIFIER_SIZE = 10;
+
+   public static final String PERSON_LIST_EDIT_BUTTON_BY_NAME = "xpath=//table[@id='personList']/tbody/tr[normalize-space(td[1]/text()) = '%s']//a[matches(@id, 'personList:\\d+:personEdit')]";
+   public static final String PERSON_LIST_VIEW_BUTTON_BY_NAME = "xpath=//table[@id='personList']/tbody/tr[normalize-space(td[1]/text()) = '%s']//a[matches(@id, 'personList:\\d+:person')]";
+   public static final String PERSON_LIST_RESULT_COUNT = "//table[@id='personList']/tbody/tr";
+
+   public static final String VEHICLE_REGISTRATION = "id=vehicle:registrationField:registration";
+   public static final String VEHICLE_STATE = "id=vehicle:stateField:state";
+   public static final String VEHICLE_MAKE = "id=vehicle:makeField:make";
+   public static final String VEHICLE_MODEL = "id=vehicle:modelField:model";
+   public static final String VEHICLE_YEAR = "id=vehicle:yearField:year";
+   public static final String VEHICLE_LINK = "id=VehicleId";
+   public static final String VEHICLE_SAVE = "id=vehicle:save";
+   public static final String VEHICLE_CANCEL = "id=vehicle:cancel";
+   public static final String VEHICLE_DELETE = "id=vehicle:delete";
+   public static final String VEHICLE_UPDATE = "id=vehicle:update";
+   public static final int VEHICLE_IDENTIFIER_SIZE = 8;
+
+   public static final String ENTITY_CREATE_BUTTON = "id=create";
+   public static final String ENTITY_EDIT = "id=edit";
+   public static final String ENTITY_DONE = "id=done";
+   public static final String ENTITY_SELECT_PARENT_BUTTON = "xpath=//*[contains(@id, 'selectParent')]";
+   public static final String VEHICLE_LIST_EDIT_BUTTON_BY_REGISTRATION = "xpath=//table[@id='vehicleList']/tbody/tr[normalize-space(td[1]/text()) = \"%s\"]//a[matches(@id, 'vehicleList:\\d+:vehicleEdit')]";
+   public static final String VEHICLE_LIST_VIEW_BUTTON_BY_REGISTRATION = "xpath=//table[@id='vehicleList']/tbody/tr[normalize-space(td[1]/text()) = \"%s\"]//a[matches(@id, 'vehicleList:\\d+:vehicle')]";
+   public static final String VEHICLE_LIST_RESULT_COUNT = "//table[@id='vehicleList']/tbody/tr";
+   public static final String VEHICLE_LIST_ROW_BY_OWNER_NAME = "xpath=//table[@id='vehicleList']/tbody/tr[normalize-space(td[1]/text()) = \"%s\"]/td[normalize-space(text()) = \"%s\"]";
+
+   /**
+    * Execute generate-entities.sql script, run ./seam generate-entities, deploy
+    * the application and wait for it to load.
+    * 
+    */
+   @BeforeGroups(groups = "generate-entitiesTest")
+   public void generateEntitiesTest()
+   {
+      // open and execute import script
+      InputStream importScript = getClass().getResourceAsStream("/org/jboss/seam/test/functional/seamgen/generate-entities.sql");
+      executeImportScript(importScript);
+
+      seamGen.generateEntities();
+      seamGen.restart();
+      waitForAppToDeploy(HOME_PAGE, PERSON_LINK);
+   }
+
+   /**
+    * Submit new person.
+    */
+   public void createNewPerson(String username, String address, Date birthday, String name)
+   {
+      browser.clickAndWait(PERSON_LINK);
+      browser.clickAndWait(ENTITY_CREATE_BUTTON);
+      fillPersonEditPage(username, address, birthday, name);
+      browser.clickAndWait(PERSON_SAVE);
+   }
+
+   /**
+    * Fill user details. Browser must be navigated to user's detail page before
+    * executing this method. This method does not submit the form.
+    */
+   public void fillPersonEditPage(String username, String address, Date birthday, String name)
+   {
+      browser.type(PERSON_USERNAME, username);
+      browser.type(PERSON_ADDRESS, address);
+      selectDate(birthday);
+      browser.type(PERSON_NAME, name);
+   }
+
+   /**
+    * Select a date using icefaces or richfaces calendar component. Selecting
+    * hardcoded values is only implemented yet.
+    */
+   public void selectDate(Date date)
+   {
+      // TODO
+      final String richFaces = "id=person:birthdateField:birthdateDayCell24";
+      final String iceFaces = "id=person:birthdateField:birthdate_calendar_1569";
+      final String icefacesCalendarButton = "person:birthdateField:birthdate_calendarButton";
+
+      if (browser.isElementPresent(richFaces))
+      {
+         browser.click(richFaces);
+      }
+      else if (browser.isElementPresent(icefacesCalendarButton))
+      {
+         browser.click(icefacesCalendarButton);
+         new Wait()
+         {
+
+            @Override
+            public boolean until()
+            {
+               return browser.isElementPresent(iceFaces);
+            }
+         }.wait("Calendar did not appear.", Long.valueOf(SELENIUM_TIMEOUT));
+         browser.click(iceFaces);
+      }
+      else
+      {
+         throw new RuntimeException("Unable to select date." + browser.getHtmlSource());
+      }
+   }
+
+   /**
+    * Submit new vehicle
+    */
+   public void createNewVehicle(String registration, String state, String make, String model, String year)
+   {
+      browser.clickAndWait(VEHICLE_LINK);
+      browser.clickAndWait(ENTITY_CREATE_BUTTON);
+      fillVehicleEditPage(registration, state, make, model, year);
+      browser.clickAndWait(VEHICLE_SAVE);
+   }
+
+   /**
+    * Fill vehicle details. Browser must be navigated to vehicle's detail page before
+    * executing this method. This method does not submit the form.
+    */
+   public void fillVehicleEditPage(String registration, String state, String make, String model, String year)
+   {
+      browser.type(VEHICLE_REGISTRATION, registration);
+      browser.type(VEHICLE_STATE, state);
+      browser.type(VEHICLE_MAKE, make);
+      browser.type(VEHICLE_MODEL, model);
+      browser.type(VEHICLE_YEAR, year);
+   }
+}

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/HotDeploymentNewFormTest.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/HotDeploymentNewFormTest.java	                        (rev 0)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/HotDeploymentNewFormTest.java	2009-04-28 11:13:00 UTC (rev 10673)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.test.functional.seamgen;
+
+import static org.testng.Assert.assertTrue;
+import org.testng.annotations.Test;
+
+/**
+ * This test verifies hot deployment of JavaBean components. This class should
+ * only be used to test WAR packaged Seam applications.
+ * 
+ * @author Jozef Hartinger
+ * 
+ */
+public class HotDeploymentNewFormTest extends NewFormTest
+{
+
+   @Override
+   protected void prepareData()
+   {
+      newComponentProperties = new String[] { "hi", "HiLocal", "Hi", "hi", "hiPage" };
+   }
+
+   @Override
+   protected void deployNewComponent()
+   {
+      seamGen.hotDeploy();
+   }
+
+   @Override
+   @Test(groups = { "newFormGroup" }, dependsOnGroups = { "newProjectGroup" })
+   public void testNewComponent()
+   {
+      String username = "admin";
+      String password = "password";
+
+      login(username, password);
+
+      super.testNewComponent();
+
+      assertTrue(isLoggedIn(), "User should be logged in by now. Hot deployment failure.");
+   }
+
+}

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/HotDeploymentStaticTest.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/HotDeploymentStaticTest.java	                        (rev 0)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/HotDeploymentStaticTest.java	2009-04-28 11:13:00 UTC (rev 10673)
@@ -0,0 +1,103 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.test.functional.seamgen;
+
+import java.io.BufferedReader;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+import static org.testng.Assert.assertTrue;
+
+/**
+ * This test verifies hot deployment of static resources. It modifies home.xhtml
+ * page and verifies that changes are reflected within the running app. All is done
+ * within user session to detect if the whole application was restarted or not.
+ * 
+ * @author Jozef Hartinger
+ * 
+ */
+public class HotDeploymentStaticTest extends SeleniumSeamGenTest
+{
+
+   private String newFeature;
+
+   @BeforeClass
+   public void modifyHomePage() throws IOException, InterruptedException
+   {
+      String homePageLocation = WORKSPACE + "/" + APP_NAME + "/view/home.xhtml";
+      newFeature = "Works flawlessly as it is tested by Selenium";
+
+      BufferedReader reader = null;
+      StringBuilder homePageContentBuilder = new StringBuilder();
+      try
+      {
+         reader = new BufferedReader(new InputStreamReader(new FileInputStream(homePageLocation)));
+         // load file content into String
+         String line = reader.readLine();
+         while (line != null)
+         {
+            homePageContentBuilder.append(line);
+            line = reader.readLine();
+         }
+      }
+      finally
+      {
+         reader.close();
+      }
+
+      String homePageContent = homePageContentBuilder.toString();
+
+      // add new item into the feature list
+      homePageContent = homePageContent.replaceAll("<li>Internationalization support</li>", "<li>Internationalization support</li>\n<li>" + newFeature + "</li>");
+
+      // write new content
+      Writer writer = null;
+      try
+      {
+         writer = new OutputStreamWriter(new FileOutputStream(homePageLocation));
+         writer.write(homePageContent);
+         writer.flush();
+      }
+      finally
+      {
+         writer.close();
+      }
+
+      seamGen.deploy();
+   }
+
+   @Test(dependsOnGroups = { "newProjectGroup" })
+   public void hotDeploymentOfFaceletTemplateTest()
+   {
+
+      login();
+
+      assertTrue(browser.isTextPresent(newFeature), "New feature not found. Hot deployment failure.");
+      assertTrue(isLoggedIn(), "Session lost. Hot deployment failure.");
+   }
+}

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/NewActionTest.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/NewActionTest.java	                        (rev 0)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/NewActionTest.java	2009-04-28 11:13:00 UTC (rev 10673)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.test.functional.seamgen;
+
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.assertTrue;
+
+/**
+ * This class verifies functionality of "new-action command".
+ * @author Jozef Hartinger
+ *
+ */
+public class NewActionTest extends SeleniumSeamGenTest
+{
+
+   protected String[] newComponentProperties;
+   
+   @BeforeClass
+   public void createNewAction() throws InterruptedException {
+      prepareData();
+      generateNewComponent();
+      deployNewComponent();
+      waitForAppToDeploy(getComponentPath(), FOOTER);
+   }
+
+
+   @Test(groups = { "newActionGroup" }, dependsOnGroups = { "newProjectGroup" })
+   public void testNewComponent()
+   {
+      String form = "id=" + newComponentProperties[0] + "Form";
+      String button = form + ":" + newComponentProperties[3];
+      
+      browser.open(getComponentPath());
+
+      assertTrue(browser.isElementPresent(FOOTER), "Footer not found.");
+      assertTrue(browser.isElementPresent(form), form + " not found.");
+      assertTrue(browser.isElementPresent(button), button + " not found.");
+
+      browser.clickAndWait(button);
+
+      assertTrue(browser.isElementPresent(MESSAGES));
+      assertTrue(browser.getText(MESSAGES).contains(newComponentProperties[3]));
+   }
+
+   public void generateNewComponent()
+   {
+      seamGen.newAction(newComponentProperties);
+   }
+   
+   protected void prepareData() {
+      newComponentProperties = new String[]{ "ping", "PingLocal", "Ping", "ping", "pingPage" };
+   }
+   
+   public String getComponentPath() {
+      return "/" + APP_NAME + "/" + newComponentProperties[4] + ".seam";
+   }
+   
+   protected void deployNewComponent() {
+      seamGen.restart();
+   }
+}

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/NewFormTest.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/NewFormTest.java	                        (rev 0)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/NewFormTest.java	2009-04-28 11:13:00 UTC (rev 10673)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.test.functional.seamgen;
+
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.assertEquals;
+
+import org.testng.annotations.Test;
+
+/**
+ * This class verifies functionality of "new-action command".
+ * @author Jozef Hartinger
+ *
+ */
+public class NewFormTest extends NewActionTest
+{
+   
+   @Override
+   @Test(groups = { "newFormGroup" }, dependsOnGroups = { "newProjectGroup" })
+   public void testNewComponent()
+   {
+      
+      String form = "id=" + newComponentProperties[0] + "Form";
+      String button = form + ":" + newComponentProperties[3];
+      String field = form + ":" + "valueField:value";
+      String value = "world";
+      
+      browser.open(getComponentPath());
+
+      assertTrue(browser.isElementPresent(FOOTER), "Footer not found.");
+      assertTrue(browser.isElementPresent(form), form + " not found.");
+      assertTrue(browser.isElementPresent(field), field + " not found.");
+      assertTrue(browser.isElementPresent(button), button + " not found.");
+
+      browser.type(field, value);
+      browser.clickAndWait(button);
+
+      assertTrue(browser.isElementPresent(MESSAGES), "Message not found.");
+      assertEquals(browser.getText(MESSAGES), newComponentProperties[3] + " " + value, "Unexpected form output.");
+   }
+
+   @Override
+   protected void prepareData() {
+      newComponentProperties = new String[]{ "hello", "HelloLocal", "Hello", "hello", "helloPage" };
+   }
+ 
+   @Override
+   public void generateNewComponent()
+   {
+      seamGen.newForm(newComponentProperties);
+   }
+}

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/NewProjectTest.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/NewProjectTest.java	                        (rev 0)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/NewProjectTest.java	2009-04-28 11:13:00 UTC (rev 10673)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.test.functional.seamgen;
+
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+import org.testng.annotations.BeforeGroups;
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.assertTrue;
+
+/**
+ * This class is responsible for creating new project and verifying that deployment
+ * and basic functionality works.
+ * 
+ * @author Jozef Hartinger
+ * 
+ */
+public class NewProjectTest extends SeleniumSeamGenTest
+{
+
+   @BeforeGroups(groups = { "newProjectGroup" })
+   public void setup() throws FileNotFoundException, IOException, InterruptedException
+   {
+
+      // save properties
+      seamGenProperties.store(new FileOutputStream(SEAMGEN_PROPERTIES_FILE), "Created by seam-gen functional testsuite.");
+      seamGen.createProject();
+      seamGen.deploy();
+      waitForAppToDeploy(HOME_PAGE, FOOTER);
+   }
+
+   @Test(groups = { "newProjectGroup" })
+   public void validLoginTest()
+   {
+      login();
+      // verify login
+      assertTrue(browser.isElementPresent(LOGOUT), "Logout link expected.");
+      assertTrue(browser.getText(SIGNED_USER).contains(DEFAULT_USERNAME), "Username not found. " + browser.getText(SIGNED_USER) + " found instead.");
+      // logout
+      browser.clickAndWait(LOGOUT);
+      assertTrue(browser.isElementPresent(LOGIN), "Login link expected.");
+      assertTrue(browser.isElementPresent(HOME), "Home link expected.");
+   }
+
+   @Test(groups = { "newProjectGroup" })
+   public void invalidLoginTest()
+   {
+      String username = "badUser";
+      String password = "password";
+
+      login(username, password);
+      // verify login
+      assertTrue(browser.isElementPresent(LOGIN), "User should not be logged in.");
+      assertTrue(browser.getText(MESSAGES).contains(LOGIN_FAILED_MESSAGE), LOGIN_FAILED_MESSAGE + " expected.");
+   }
+}

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/PersonTest.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/PersonTest.java	                        (rev 0)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/PersonTest.java	2009-04-28 11:13:00 UTC (rev 10673)
@@ -0,0 +1,123 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.test.functional.seamgen;
+
+import java.util.Date;
+
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.assertEquals;
+
+/**
+ * This test verifies CRUD functionality on the Person table.
+ * @author Jozef Hartinger
+ *
+ */
+public class PersonTest extends GenerateEntitiesTest
+{
+
+   public static final String SEARCH_USERNAME = "xpath=//input[matches(@id, 'personSearch:.+:username')]";
+   public static final String SEARCH_SUBMIT = "personSearch:search";
+   public static final String SEARCH_RESET = "personSearch:reset";
+
+   public static final String VIEW_USERNAME = "xpath=id('username')/div/span[2]";
+   public static final String VIEW_ADDRESS = "xpath=id('address')/div/span[2]";
+   public static final String VIEW_NAME = "xpath=id('name')/div/span[2]";
+
+   @Test(groups = "generate-entitiesTest", dependsOnGroups = { "newProjectGroup" })
+   public void newPersonTest()
+   {
+      login();
+      String username = "tester";
+      String address = "test address";
+      String name = "John Doe";
+      createNewPerson(username, address, new Date(), name);
+
+      assertTrue(browser.isElementPresent(MESSAGES), "Confirmation message expected.");
+      assertEquals(browser.getText(MESSAGES), "Successfully created", "Unexpected confirmation message");
+
+      // search for the person
+      browser.clickAndWait(ENTITY_DONE);
+      int result = search(username);
+      assertEquals(result, 1, "Unexpected count of search results after creating new user");
+      // verify view page
+      browser.clickAndWait(String.format(PERSON_LIST_VIEW_BUTTON_BY_NAME, username));
+      verifyViewPage(username, address, name);
+   }
+
+   @Test(groups = "generate-entitiesTest", dependsOnGroups = { "newProjectGroup" })
+   public void updatePersonTest()
+   {
+      String username = "johny";
+      String address = "updated address";
+      String name = "Test User";
+
+      login();
+      browser.clickAndWait(PERSON_LINK);
+      String editButton = String.format(PERSON_LIST_EDIT_BUTTON_BY_NAME, username);
+      browser.clickAndWait(editButton);
+      // update the entity
+      fillPersonEditPage(username, address, new Date(), name);
+      browser.clickAndWait(PERSON_UPDATE);
+      // verify
+      assertTrue(browser.isElementPresent(MESSAGES), "Confirmation message expected.");
+      assertEquals(browser.getText(MESSAGES), "Successfully updated", "Unexpected confirmation message");
+      verifyViewPage(username, address, name);
+   }
+
+   @Test(groups = "generate-entitiesTest", dependsOnGroups = { "newProjectGroup" })
+   public void removePersonTest()
+   {
+      String username = "jane";
+
+      login();
+      browser.clickAndWait(PERSON_LINK);
+      String editButton = String.format(PERSON_LIST_EDIT_BUTTON_BY_NAME, username);
+      browser.clickAndWait(editButton);
+      // delete the person
+      browser.clickAndWait(PERSON_DELETE);
+
+      assertTrue(browser.isElementPresent(MESSAGES), "Confirmation message expected.");
+      assertEquals(browser.getText(MESSAGES), "Successfully deleted", "Unexpected confirmation message");
+
+      // search for the user
+      int result = search(username);
+      assertEquals(result, 0, "Unexpected count of search results after removing the user");
+
+   }
+
+   public int search(String pattern)
+   {
+      browser.type(SEARCH_USERNAME, pattern);
+      browser.clickAndWait(SEARCH_SUBMIT);
+      return browser.getXpathCount(PERSON_LIST_RESULT_COUNT).intValue();
+   }
+
+   public void verifyViewPage(String username, String address, String name)
+   {
+      assertEquals(browser.getText(VIEW_USERNAME), username);
+      assertEquals(browser.getText(VIEW_ADDRESS), address);
+      assertEquals(browser.getText(VIEW_NAME), name);
+   }
+
+}

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/SeamGenTest.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/SeamGenTest.java	                        (rev 0)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/SeamGenTest.java	2009-04-28 11:13:00 UTC (rev 10673)
@@ -0,0 +1,198 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.test.functional.seamgen;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Properties;
+
+import org.jboss.seam.test.functional.seamgen.utils.SeamGenAdapter;
+import org.openqa.selenium.server.RemoteControlConfiguration;
+import org.openqa.selenium.server.SeleniumServer;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Optional;
+import org.testng.annotations.Parameters;
+
+/**
+ * Base class for seam-gen functional tests.
+ * @author Jozef Hartinger
+ */
+public class SeamGenTest
+{
+
+   protected static SeamGenAdapter seamGen;
+   protected static Properties seamGenProperties;
+   protected static Properties ftestProperties = new Properties();
+
+   protected static String SEAM_DIR;
+   protected static String SEAM_FTEST_PROPERTIES_FILE;
+   protected static String SEAMGEN_BUILDFILE;
+   protected static String SEAMGEN_PROPERTIES_FILE;
+   protected static String WORKSPACE;
+
+   // container specific properties
+   protected static String CONTAINER;
+   protected static String CONTAINER_LOCATION;
+   protected static int DEPLOY_TIMEOUT;
+
+   protected static boolean ICEFACES;
+   protected static boolean WAR;
+
+   protected static boolean DELETE_PROJECT;
+
+   protected static String TEST_SEAMGEN_PROPERTIES_FILE;
+
+   // Selenium related constants
+   protected static String SELENIUM_HOST;
+   protected static String SELENIUM_BROWSER;
+   protected static String SELENIUM_BROWSER_URL;
+   protected static int SELENIUM_SERVER_PORT;
+   protected static String SELENIUM_SPEED;
+   protected static String SELENIUM_TIMEOUT;
+   protected static long SELENIUM_ICEFACES_WAIT_TIME;
+
+   protected static String OUTPUT_DIR;
+
+   // Test application specific constants
+   protected static String APP_NAME;
+   protected static String HOME_PAGE;
+
+   // Selenium server instance
+   protected static SeleniumServer seleniumServer;
+
+   @BeforeSuite
+   @Parameters("seam.dir")
+   public void beforeSuite(@Optional(".") String seamDir) throws Exception {
+      // Seam location
+      SEAM_DIR = seamDir;
+      SEAM_FTEST_PROPERTIES_FILE = SEAM_DIR + "/src/test/ftest/ftest.properties";
+      SEAMGEN_BUILDFILE = SEAM_DIR + "/seam-gen/build.xml";
+      SEAMGEN_PROPERTIES_FILE = SEAM_DIR + "/seam-gen/build.properties";
+      OUTPUT_DIR =  SEAM_DIR + "/test-output/functional-framework/";
+      
+      loadFtestProperties();
+      createOutputDir();
+      startSeleniumServer();
+   }
+   
+   @AfterSuite
+   public void afterSuite() {
+      seleniumServer.stop();
+   }
+   
+   @BeforeTest
+   @Parameters( { "icefaces", "type", "suffix", "explode" })
+   public void setUp(@Optional("false") boolean icefaces, @Optional("ear") String type, @Optional("") String suffix, @Optional("true") boolean explode) throws Exception
+   {
+      ICEFACES = icefaces;
+      WAR = type.equalsIgnoreCase("war");
+      APP_NAME = "seamGenTestApp" + (ICEFACES ? "Ice" : "Rich") + (WAR ? "War" : "Ear") + (explode? "E" : "D") + suffix;
+      HOME_PAGE = "/" + APP_NAME + "/home.seam";
+
+      setSeamGenProperties();
+
+      seamGen = new SeamGenAdapter(SEAMGEN_BUILDFILE);
+      seamGen.setExplode(explode);
+
+   }
+
+   @AfterTest
+   public void tearDown()
+   {
+      if (DELETE_PROJECT)
+      {
+         seamGen.deleteProject();
+      }
+      else
+      {
+         seamGen.undeploy();
+      }
+   }
+
+   private void loadFtestProperties() throws FileNotFoundException, IOException
+   {
+      // load general properties
+      ftestProperties.load(new FileInputStream(SEAM_FTEST_PROPERTIES_FILE));
+
+      WORKSPACE = ftestProperties.getProperty("workspace.home");
+
+      // container specific
+      CONTAINER = ftestProperties.getProperty("container", "jboss5");
+      CONTAINER_LOCATION = ftestProperties.getProperty(CONTAINER + ".home");
+      DEPLOY_TIMEOUT = Integer.parseInt(ftestProperties.getProperty(CONTAINER + ".deploy.waittime")) * 1000; // miliseconds
+      DELETE_PROJECT = Boolean.valueOf(ftestProperties.getProperty("seamgen.delete.project", "false"));
+
+      // load selenium constants
+      SELENIUM_HOST = ftestProperties.getProperty("selenium.host");
+      SELENIUM_BROWSER = ftestProperties.getProperty("selenium.browser");
+      SELENIUM_BROWSER_URL = ftestProperties.getProperty("selenium.browser.url");
+      SELENIUM_SERVER_PORT = Integer.parseInt(ftestProperties.getProperty("selenium.server.port"));
+      SELENIUM_SPEED = ftestProperties.getProperty("selenium.speed");
+      SELENIUM_TIMEOUT = ftestProperties.getProperty("selenium.timeout");
+      SELENIUM_ICEFACES_WAIT_TIME = Long.valueOf(ftestProperties.getProperty("selenium.icefaces.wait.time", "2000"));
+   }
+
+   private void setSeamGenProperties()
+   {
+      seamGenProperties = new Properties();
+      
+      String[] propertiesToCopy = { "database.type", "database.exists", "database.drop", "driver.jar", "driver.license.jar", "hibernate.connection.username", "hibernate.connection.password", "hibernate.connection.driver_class", "hibernate.connection.dataSource_class", "hibernate.cache.provider_class", "hibernate.default_catalog.null", "hibernate.default_schema.null", "hibernate.dialect", "hibernate.connection.url", "model.package", "action.package", "test.package", "richfaces.skin", "icefaces.home", "jboss.home" };
+
+      for (String property : propertiesToCopy)
+      {
+         if (ftestProperties.get(property) != null)
+         {
+            seamGenProperties.put(property, ftestProperties.get(property));
+         }
+      }
+
+      // override with ftest.properties
+      seamGenProperties.put("workspace.home", WORKSPACE);
+      seamGenProperties.put("jboss.home", CONTAINER_LOCATION);
+      seamGenProperties.put("icefaces", ICEFACES ? "y" : "n");
+      seamGenProperties.put("project.type", WAR ? "war" : "ear");
+      seamGenProperties.put("project.name", APP_NAME);
+   }
+
+   private void startSeleniumServer() throws Exception
+   {
+      RemoteControlConfiguration rcc = new RemoteControlConfiguration();
+      rcc.setPort(SELENIUM_SERVER_PORT);
+      rcc.setLogOutFileName(OUTPUT_DIR + "/selenium-server.log");
+      seleniumServer = new SeleniumServer(rcc);
+      seleniumServer.start();
+   }
+
+   private void createOutputDir()
+   {
+      File dir = new File(OUTPUT_DIR);
+      if (!dir.exists())
+      {
+         dir.mkdir();
+      }
+   }
+}

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/SeleniumSeamGenTest.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/SeleniumSeamGenTest.java	                        (rev 0)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/SeleniumSeamGenTest.java	2009-04-28 11:13:00 UTC (rev 10673)
@@ -0,0 +1,159 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.test.functional.seamgen;
+
+import static org.testng.Assert.assertTrue;
+
+import org.jboss.seam.example.common.test.selenium.SeamSelenium;
+import org.testng.annotations.BeforeMethod;
+
+/**
+ * Base class for Selenium seam-gen tests. Separate browser instance is created
+ * prior to each test method execution. Browser instances are stopped by
+ * SeleniumTestListener.
+ * 
+ * @author Jozef Hartinger
+ * 
+ */
+public class SeleniumSeamGenTest extends SeamGenTest
+{
+   // home page
+   public static final String LOGIN = "id=menuLoginId";
+   public static final String LOGOUT = "id=menuLogoutId";
+   public static final String HOME = "id=menuHomeId";
+   public static final String SIGNED_USER = "id=menuWelcomeId";
+   // login page
+   public static final String LOGIN_USERNAME = "id=loginForm:username";
+   public static final String LOGIN_PASSWORD = "id=loginForm:password";
+   public static final String LOGIN_REMEMBER_ME = "id=loginForm:rememberMe";
+   public static final String LOGIN_SUBMIT = "id=loginForm:submit";
+   public static final String LOGIN_FAILED_MESSAGE = "Login failed";
+
+   public static final String MESSAGES = "id=messages";
+   public static final String FOOTER = "xpath=//div[@class = 'footer']";
+   public static final String MESSAGE_WELCOME = "xpath=//h1[text() = 'Welcome to Seam!']";
+
+   public static final String DEFAULT_USERNAME = "admin";
+   public static final String DEFAULT_PASSWORD = "";
+
+   public static SeamSelenium browser;
+
+   /**
+    * Start new browser instance and store it into static variable. Moreover,
+    * open application home page.
+    */
+   public void initBrowser()
+   {
+      browser = startBrowser();
+      browser.open(HOME_PAGE);
+   }
+
+   /**
+    * Create new browser instance.
+    */
+   public SeamSelenium startBrowser()
+   {
+      SeamSelenium newBrowser = new SeamSelenium(SELENIUM_HOST, SELENIUM_SERVER_PORT, SELENIUM_BROWSER, SELENIUM_BROWSER_URL);
+      newBrowser.start();
+      newBrowser.allowNativeXpath("false");
+      newBrowser.setSpeed(SELENIUM_SPEED);
+      newBrowser.setTimeout(SELENIUM_TIMEOUT);
+      if (ICEFACES)
+      {
+         newBrowser.setIcefacesDetection(true);
+      }
+      newBrowser.setIcefacesWaitTime(SELENIUM_ICEFACES_WAIT_TIME);
+      return newBrowser;
+   }
+
+   public void stopBrowser()
+   {
+      browser.stop();
+   }
+
+   public void login(String username, String password)
+   {
+      assertTrue(browser.isElementPresent(LOGIN), "Login link expected.");
+      browser.clickAndWait(LOGIN);
+      browser.type(LOGIN_USERNAME, username);
+      browser.type(LOGIN_PASSWORD, password);
+      browser.clickAndWait(LOGIN_SUBMIT);
+   }
+
+   public void login()
+   {
+      login(DEFAULT_USERNAME, DEFAULT_PASSWORD);
+   }
+
+   public boolean isLoggedIn()
+   {
+      return browser.isElementPresent(SIGNED_USER) && browser.isElementPresent(LOGOUT) && !browser.isElementPresent(LOGIN);
+   }
+
+   public void logout()
+   {
+      browser.clickAndWait(LOGOUT);
+   }
+
+   @BeforeMethod
+   public void beforeMethod()
+   {
+      initBrowser();
+   }
+
+   /**
+    * Wait for application (or it's part) to deploy. Separate Selenium browser
+    * instance is used to poll server for specified URL, waiting for specified
+    * element to appear.
+    */
+   public void waitForAppToDeploy(String url, String element)
+   {
+      int step = 5000;
+      int i = DEPLOY_TIMEOUT;
+
+      SeamSelenium browser = startBrowser();
+
+      browser.open(url);
+      try
+      {
+         while (!browser.isElementPresent(element))
+         {
+            i -= step;
+            if (i <= 0)
+            {
+               throw new RuntimeException("Timeout waiting for " + element + " at " + url);
+            }
+            Thread.sleep(step);
+            browser.open(url); // try again
+         }
+      }
+      catch (InterruptedException ie)
+      {
+         throw new RuntimeException(ie);
+      }
+      finally
+      {
+         browser.stop();
+      }
+   }
+
+}

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/VehicleTest.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/VehicleTest.java	                        (rev 0)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/VehicleTest.java	2009-04-28 11:13:00 UTC (rev 10673)
@@ -0,0 +1,167 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.test.functional.seamgen;
+
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.assertEquals;
+
+/**
+ * This class tests CRUD on the Vehicle database table.
+ * @author Jozef Hartinger
+ *
+ */
+public class VehicleTest extends GenerateEntitiesTest
+{
+
+   public static final String SEARCH_REGISTRATION = "xpath=//input[matches(@id, 'vehicleSearch:.+:registration')]";
+   public static final String SEARCH_SUBMIT = "vehicleSearch:search";
+   public static final String SEARCH_RESET = "vehicleSearch:reset";
+
+   public static final String VIEW_REGISTRATION = "xpath=id('registration')/div/span[2]";
+   public static final String VIEW_STATE = "xpath=id('state')/div/span[2]";
+   public static final String VIEW_MAKE = "xpath=id('make')/div/span[2]";
+   public static final String VIEW_MODEL = "xpath=id('model')/div/span[2]";
+   public static final String VIEW_YEAR = "xpath=id('year')/div/span[2]";
+
+   @Test(groups = "generate-entitiesTest", dependsOnGroups = { "newProjectGroup" })
+   public void newVehicleTest()
+   {
+      login();
+      String registration = "44444444";
+      String state = "SK";
+      String make = "Honda";
+      String model = "Civic";
+      String year = "2008";
+      createNewVehicle(registration, state, make, model, year);
+
+      assertTrue(browser.isElementPresent(MESSAGES), "Confirmation message expected.");
+      assertEquals(browser.getText(MESSAGES), "Successfully created", "Unexpected confirmation message");
+
+      // search for the vehicle
+      browser.clickAndWait(ENTITY_DONE);
+      int result = search(registration);
+      assertEquals(result, 1, "Unexpected count of search results after creating new vehicle");
+      // verify view page
+      browser.clickAndWait(String.format(VEHICLE_LIST_VIEW_BUTTON_BY_REGISTRATION, registration));
+      verifyViewPage(registration, state, make, model, year);
+   }
+
+   @Test(groups = "generate-entitiesTest", dependsOnGroups = { "newProjectGroup" }, dependsOnMethods = { "newVehicleTest" })
+   public void updateVehicleTest()
+   {
+      String registration = "11111111";
+      String state = "CZ";
+      String make = "Mazda";
+      String model = "6";
+      String year = "2005";
+
+      login();
+      browser.clickAndWait(VEHICLE_LINK);
+      String editButton = String.format(VEHICLE_LIST_EDIT_BUTTON_BY_REGISTRATION, registration);
+      browser.clickAndWait(editButton);
+      // update the entity
+      fillVehicleEditPage(registration, state, make, model, year);
+      browser.clickAndWait(VEHICLE_UPDATE);
+      // verify
+      assertTrue(browser.isElementPresent(MESSAGES), "Confirmation message expected.");
+      assertEquals(browser.getText(MESSAGES), "Successfully updated", "Unexpected confirmation message");
+      verifyViewPage(registration, state, make, model, year);
+   }
+
+   @Test(groups = "generate-entitiesTest", dependsOnGroups = { "newProjectGroup" })
+   public void removeVehicleTest()
+   {
+      String registration = "22222222";
+
+      login();
+      browser.clickAndWait(VEHICLE_LINK);
+      String editButton = String.format(VEHICLE_LIST_EDIT_BUTTON_BY_REGISTRATION, registration);
+      browser.clickAndWait(editButton);
+      // delete the person
+      browser.clickAndWait(VEHICLE_DELETE);
+
+      assertTrue(browser.isElementPresent(MESSAGES), "Confirmation message expected.");
+      assertEquals(browser.getText(MESSAGES), "Successfully deleted", "Unexpected confirmation message");
+
+      // search for the user
+      int result = search(registration);
+      assertEquals(result, 0, "Unexpected count of search results after removing the user");
+   }
+
+   @Test(groups = "generate-entitiesTest", dependsOnGroups = { "newProjectGroup" })
+   public void selectVehicleTest()
+   {
+
+      String username = "jharting";
+
+      login();
+      // create new vehicle
+      String registration = "33333333";
+      String state = "SK";
+      String make = "Mazda";
+      String model = "RX-8";
+      String year = "2008";
+      createNewVehicle(registration, state, make, model, year);
+      // select person
+      browser.clickAndWait(ENTITY_EDIT);
+      browser.clickAndWait(ENTITY_SELECT_PARENT_BUTTON);
+      browser.clickAndWait(String.format(PERSON_LIST_VIEW_BUTTON_BY_NAME, username));
+      browser.clickAndWait(VEHICLE_UPDATE);
+      // verify update is OK
+      assertTrue(browser.isElementPresent(MESSAGES), "Confirmation message expected.");
+      assertEquals(browser.getText(MESSAGES), "Successfully updated", "Unexpected confirmation message");
+      browser.clickAndWait(ENTITY_DONE);
+      // search for vehicle
+      int result = search(registration);
+      assertEquals(result, 1, "Unexpected count of search results after assigning a vehicle owner");
+      // verify person is assigned to vehicle
+      assertTrue(browser.isElementPresent(String.format(VEHICLE_LIST_ROW_BY_OWNER_NAME, registration, username)), "Person not assigned to vehicle.");
+   }
+
+   @Test(groups = "generate-entitiesTest", dependsOnGroups = { "newProjectGroup" })
+   public void searchTest()
+   {
+      final String searchString = "9999999"; // should return two Audis
+
+      login();
+      browser.clickAndWait(VEHICLE_LINK);
+      assertEquals(search(searchString), 2, "Unexpected number of search results for " + searchString);
+   }
+
+   public int search(String pattern)
+   {
+      browser.type(SEARCH_REGISTRATION, pattern);
+      browser.clickAndWait(SEARCH_SUBMIT);
+      return browser.getXpathCount(VEHICLE_LIST_RESULT_COUNT).intValue();
+   }
+
+   public void verifyViewPage(String registration, String state, String make, String model, String year)
+   {
+      assertEquals(browser.getText(VIEW_REGISTRATION), registration);
+      assertEquals(browser.getText(VIEW_STATE), state);
+      assertEquals(browser.getText(VIEW_MAKE), make);
+      assertEquals(browser.getText(VIEW_MODEL), model);
+      assertEquals(browser.getText(VIEW_YEAR), year);
+   }
+}

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/generate-entities.sql
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/generate-entities.sql	                        (rev 0)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/generate-entities.sql	2009-04-28 11:13:00 UTC (rev 10673)
@@ -0,0 +1,26 @@
+# This script is executed prior to "generate-entitiesTest" phase of a testsuite to feed the database with test data.
+#
+# by Jozef Hartinger
+#
+
+# drop itentity management tables from previous run
+DROP TABLE IF EXISTS user_account;
+DROP TABLE IF EXISTS user_account_role;
+DROP TABLE IF EXISTS user_permission;
+DROP TABLE IF EXISTS user_role;
+DROP TABLE IF EXISTS user_role_group;
+
+# empty testing tables
+DELETE FROM Vehicle;
+DELETE FROM Person;
+
+# Person table inserts
+INSERT INTO Person (username, name, birthdate, address) values ('johny', 'John Doe', '2009-01-01', 'test address'); # updatePersonTest
+INSERT INTO Person (username, name, birthdate, address) values ('jane', 'Jane Doe', '2009-01-01', 'test address'); # removePersonTest
+INSERT INTO Person (username, name, birthdate, address) values ('jharting', 'Jozef Hartinger', '1987-01-01', 'Purkynova 99, Brno'); # selectVehicleTest
+
+# Vehicle table inserts
+INSERT INTO Vehicle (make, model, year, registration, state) values ('Honda', 'Civic', '2008', '11111111', 'CZ'); # updateVehicleTest
+INSERT INTO Vehicle (make, model, year, registration, state) values ('Nissan', '350z', '2006', '22222222', 'CZ'); # removeVehicleTest
+INSERT INTO Vehicle (make, model, year, registration, state) values ('Audi', 'A5', '2009', '99999991', 'CZ'); # searchTest
+INSERT INTO Vehicle (make, model, year, registration, state) values ('Audi', 'A4', '2009', '99999992', 'CZ'); # searchTest
\ No newline at end of file

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/utils/SeamGenAdapter.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/utils/SeamGenAdapter.java	                        (rev 0)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/utils/SeamGenAdapter.java	2009-04-28 11:13:00 UTC (rev 10673)
@@ -0,0 +1,204 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.test.functional.seamgen.utils;
+
+import java.io.File;
+import java.io.PrintStream;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.DefaultLogger;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.ProjectHelper;
+import org.apache.tools.ant.input.InputHandler;
+import org.apache.tools.ant.input.InputRequest;
+
+/**
+ * This class wraps seam-gen ant script in order to be easily usable from Java.
+ * Methods of this class corespond to seam-gen targets. Note that deploy and
+ * undeploy methods are using explode variants of the targets if icefaces
+ * variable is set to true which it is by default.
+ * 
+ * @author Jozef Hartinger
+ * 
+ */
+public class SeamGenAdapter
+{
+
+   private String buildfile;
+   private DefaultLogger log;
+   private boolean explode = true;
+
+   public SeamGenAdapter(String buildfile)
+   {
+      this(buildfile, System.out, System.err);
+   }
+
+   public SeamGenAdapter(String buildfile, PrintStream out, PrintStream err)
+   {
+      this.buildfile = buildfile;
+      log = new DefaultLogger();
+      log.setOutputPrintStream(out);
+      log.setErrorPrintStream(err);
+      log.setMessageOutputLevel(Project.MSG_INFO);
+   }
+
+   public Project getAntCall()
+   {
+      Project ant = new Project();
+      ant.init();
+      ProjectHelper.configureProject(ant, new File(buildfile));
+      // ant.addBuildListener(log);
+      return ant;
+   }
+
+   public void createProject()
+   {
+      getAntCall().executeTarget("create-project");
+   }
+
+   public void deleteProject()
+   {
+      getAntCall().executeTarget("delete-project");
+   }
+
+   public void newAction(String[] properties)
+   {
+      Project project = getAntCall();
+      project.setInputHandler(getInputHandler(properties));
+      project.executeTarget("new-action");
+   }
+
+   public void newForm(String[] properties)
+   {
+      Project project = getAntCall();
+      project.setInputHandler(getInputHandler(properties));
+      project.executeTarget("new-form");
+   }
+
+   public void generateEntities()
+   {
+      getAntCall().executeTarget("generate-entities");
+   }
+
+   /**
+    * Deploy the application. Using either explode or deploy target, depending
+    * on explode property.
+    */
+   public void deploy()
+   {
+      if (explode)
+      {
+         getAntCall().executeTarget("explode");
+      }
+      else
+      {
+         getAntCall().executeTarget("deploy");
+      }
+   }
+
+   /**
+    * Undeploy the application. Using either unexplode or undeploy target,
+    * depending on explode property.
+    */
+   public void undeploy()
+   {
+      if (explode)
+      {
+         getAntCall().executeTarget("unexplode");
+      }
+      else
+      {
+         getAntCall().executeTarget("undeploy");
+      }
+   }
+
+   public void hotDeploy()
+   {
+      if (explode)
+      {
+         getAntCall().executeTarget("explode");
+      }
+      else
+      {
+         throw new IllegalStateException("Unable to hot deploy non-exploded archive");
+      }
+   }
+
+   public void restart()
+   {
+      getAntCall().executeTarget("restart");
+   }
+
+   public void addIdentityManagement()
+   {
+      getAntCall().executeTarget("add-identity-management");
+   }
+
+   private InputHandler getInputHandler(final String[] properties)
+   {
+      return new InputHandler()
+      {
+         public void handleInput(InputRequest request) throws BuildException
+         {
+            if (request.getPrompt().contains("Enter the Seam component name"))
+            {
+               request.setInput(properties[0]);
+            }
+            else if (request.getPrompt().contains("Enter the local interface name"))
+            {
+               request.setInput(properties[1]);
+            }
+            else if (request.getPrompt().contains("Enter the bean class name"))
+            {
+               request.setInput(properties[2]);
+            }
+            else if (request.getPrompt().contains("Enter the action method name"))
+            {
+               request.setInput(properties[3]);
+            }
+            else if (request.getPrompt().contains("Enter the page name"))
+            {
+               request.setInput(properties[4]);
+            }
+            else
+            {
+               throw new RuntimeException("Unexpected prompt " + request.getPrompt());
+            }
+         }
+      };
+   }
+
+   public boolean isExplode()
+   {
+      return explode;
+   }
+
+   /**
+    * Set "deploy" or "explode" variant of deployment. "Explode" is used by
+    * default.
+    */
+   public void setExplode(boolean explode)
+   {
+      this.explode = explode;
+   }
+
+}

Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/utils/SeleniumTestListener.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/utils/SeleniumTestListener.java	                        (rev 0)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/utils/SeleniumTestListener.java	2009-04-28 11:13:00 UTC (rev 10673)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.test.functional.seamgen.utils;
+
+import org.jboss.seam.test.functional.seamgen.SeleniumSeamGenTest;
+import org.testng.ITestContext;
+import org.testng.ITestListener;
+import org.testng.ITestResult;
+
+/**
+ * Test listener. Captures screenshot and HTML source into the output directory
+ * if test fails. Furthermore, this class is responsible for stopping the
+ * browser instance after the test.
+ * 
+ * @author Jozef Hartinger
+ * 
+ */
+public class SeleniumTestListener extends SeleniumSeamGenTest implements ITestListener
+{
+
+   public void onFinish(ITestContext arg0)
+   {
+   }
+
+   public void onStart(ITestContext arg0)
+   {
+   }
+
+   public void onTestFailedButWithinSuccessPercentage(ITestResult arg0)
+   {
+   }
+
+   public void onTestFailure(ITestResult arg0)
+   {
+      String logPath = OUTPUT_DIR + APP_NAME + "/" + arg0.getName();
+      browser.captureScreenshot(logPath + ".png");
+      browser.logHTMLContext(logPath + ".html");
+      stopBrowser();
+   }
+
+   public void onTestSkipped(ITestResult arg0)
+   {
+      stopBrowser();
+   }
+
+   public void onTestStart(ITestResult arg0)
+   {
+   }
+
+   public void onTestSuccess(ITestResult arg0)
+   {
+      stopBrowser();
+   }
+}

Modified: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSelenium.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSelenium.java	2009-04-28 07:36:10 UTC (rev 10672)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSelenium.java	2009-04-28 11:13:00 UTC (rev 10673)
@@ -21,7 +21,12 @@
  */ 
 package org.jboss.seam.example.common.test.selenium;
 
+import java.io.BufferedWriter;
+import java.io.FileOutputStream;
+import java.io.OutputStreamWriter;
+
 import com.thoughtworks.selenium.DefaultSelenium;
+import com.thoughtworks.selenium.Wait;
 
 /**
  * This class slightly enhaces a Selenium API for controlling a browser.
@@ -32,6 +37,11 @@
 {
    
    protected String timeout = "30000";
+   private boolean icefacesDetection = false;
+   private long icefacesWaitTime = 1000;
+   
+   private final String ICEFACES_CONNECTION_STATUS = "xpath=//div[@class='iceOutConStat connectionStatus']";
+   private final String ICEFACES_IDLE_VISIBLE = "xpath=//div[@class='iceOutConStatInactv connectionStatusInactv'][@style='visibility: visible;']";
 
    public SeamSelenium(String serverHost, int serverPort, String browserStartCommand, String browserURL)
    {
@@ -49,11 +59,94 @@
     * @param locator
     */
    public void clickAndWait(String locator) {
-      super.click(locator);
-      super.waitForPageToLoad(timeout);
+      click(locator);
+      waitForPageToLoad();
    }
    
+   public String getTimeout()
+   {
+      return timeout;
+   }
+   public void waitForPageToLoad()
+   {
+      waitForPageToLoad(timeout);
+   }
+   @Override
+   public void waitForPageToLoad(String timeout)
+   {
+      if (icefacesDetection && isElementPresent(ICEFACES_CONNECTION_STATUS))
+      {
+         waitForIcefaces(icefacesWaitTime, Long.valueOf(timeout));
+      }
+      else
+      {
+         super.waitForPageToLoad(timeout);
+      }
+   }
+   
    /**
+    * Switch icefaces detection on/off
+    * 
+    * @param icefacesDetection
+    */
+   public void setIcefacesDetection(boolean icefacesDetection)
+   {
+      this.icefacesDetection = icefacesDetection;
+   }
+   
+   /**
+    * This wait time will be used when waiting for response after invoking
+    * icefaces action
+    * 
+    * @param icefacesWaitTime
+    */
+   public void setIcefacesWaitTime(long icefacesWaitTime)
+   {
+      this.icefacesWaitTime = icefacesWaitTime;
+   }
+   
+   /**
+    * Captures a screenshot and stores it into a file. Active windows is
+    * maximized before capturing a screenshot.
+    */
+   @Override
+   public void captureScreenshot(String path)
+   {
+      windowMaximize();
+      super.captureScreenshot(path);
+   }
+   /**
+    * Logs HTML body into a file.
+    * 
+    * @param path
+    */
+   public void logHTMLContext(String path)
+   {
+      String source = getHtmlSource();
+      BufferedWriter writer = null;
+      try
+      {
+         writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path)));
+         writer.write(source);
+         writer.flush();
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException("Unable to save HTML body", e);
+      }
+      finally
+      {
+         try
+         {
+            writer.close();
+         }
+         catch (Exception e)
+         {
+         }
+      }
+   }
+   
+   /**
     * Simulates a user pressing "back" button and waits for page to load. Default timeout can be changed by setTimeout() method.
     */
    public void goBackAndWait() {
@@ -69,4 +162,32 @@
       super.waitForPageToLoad(timeout);
    }
    
+   private void waitForIcefaces(Long waitTime, Long timeout)
+   {
+      new Wait()
+      {
+         @Override
+         public boolean until()
+         {
+            return isElementPresent(ICEFACES_IDLE_VISIBLE);
+         }
+      }.wait("Timeout while waiting for icefaces idle state.", timeout);
+      try
+      {
+         Thread.sleep(icefacesWaitTime);
+      }
+      catch (InterruptedException e)
+      {
+         e.printStackTrace();
+      }
+      new Wait()
+      {
+         @Override
+         public boolean until()
+         {
+            return isElementPresent("xpath=//body");
+         }
+      }.wait("Timeout while waiting for document body after icefaces click.", timeout);
+   }
+   
 }




More information about the seam-commits mailing list