Author: andrei_exadel
Date: 2008-09-18 13:11:35 -0400 (Thu, 18 Sep 2008)
New Revision: 10499
Added:
trunk/test-applications/regressionArea/Seam-web/src/main/java/org/
trunk/test-applications/regressionArea/Seam-web/src/main/java/org/ajax4jsf/
trunk/test-applications/regressionArea/Seam-web/src/main/java/org/ajax4jsf/bean/
trunk/test-applications/regressionArea/Seam-web/src/main/java/org/ajax4jsf/bean/Configurator.java
trunk/test-applications/regressionArea/Seam-web/src/main/java/org/ajax4jsf/bean/TemplateBean.java
trunk/test-applications/regressionArea/Seam-web/src/main/java/org/ajax4jsf/template/
trunk/test-applications/regressionArea/Seam-web/src/main/java/org/ajax4jsf/template/Template.java
trunk/test-applications/regressionArea/Seam-web/src/main/java/org/ajax4jsf/template/TestConstants.java
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/layout/controlLayout.xhtml
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/layout/layout.xhtml
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/pages/home.xhtml
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/template/
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/template/dataTable.xhtml
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/template/modalPanel.xhtml
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/template/simple.xhtml
trunk/test-applications/regressionArea/Seam-web/src/test/
trunk/test-applications/regressionArea/Seam-web/src/test/java/
trunk/test-applications/regressionArea/Seam-web/src/test/java/org/
trunk/test-applications/regressionArea/Seam-web/src/test/java/org/richfaces/
trunk/test-applications/regressionArea/Seam-web/src/test/java/org/richfaces/RichSeleniumTest.java
trunk/test-applications/regressionArea/Seam-web/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/regressionArea/Seam-web/src/test/java/org/richfaces/TestAnnotationTransformer.java
trunk/test-applications/regressionArea/Seam-web/src/test/java/org/richfaces/testng/
trunk/test-applications/regressionArea/Seam-web/src/test/java/org/richfaces/testng/SimpleTest.java
trunk/test-applications/regressionArea/Seam-web/src/test/resources/
trunk/test-applications/regressionArea/Seam-web/src/test/resources/testng.xml
Removed:
trunk/test-applications/regressionArea/Seam-web/src/copy-web-pages1.bat
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/WEB-INF/lib/richfaces-impl.jar
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/WEB-INF/lib/richfaces-ui.jar
Modified:
trunk/test-applications/regressionArea/Seam-ear/.settings/org.eclipse.wst.common.component
trunk/test-applications/regressionArea/Seam-ear/pom.xml
trunk/test-applications/regressionArea/Seam-ejb/.settings/org.eclipse.jdt.core.prefs
trunk/test-applications/regressionArea/Seam-ejb/pom.xml
trunk/test-applications/regressionArea/Seam-web/.classpath
trunk/test-applications/regressionArea/Seam-web/.project
trunk/test-applications/regressionArea/Seam-web/.settings/org.eclipse.jdt.core.prefs
trunk/test-applications/regressionArea/Seam-web/.settings/org.eclipse.wst.common.component
trunk/test-applications/regressionArea/Seam-web/pom.xml
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/WEB-INF/faces-config.xml
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/WEB-INF/jboss-web.xml
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/WEB-INF/web.xml
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/home.xhtml
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/index.html
trunk/test-applications/regressionArea/pom.xml
Log:
Add Selenium Test Framework
Modified:
trunk/test-applications/regressionArea/Seam-ear/.settings/org.eclipse.wst.common.component
===================================================================
---
trunk/test-applications/regressionArea/Seam-ear/.settings/org.eclipse.wst.common.component 2008-09-18
15:46:01 UTC (rev 10498)
+++
trunk/test-applications/regressionArea/Seam-ear/.settings/org.eclipse.wst.common.component 2008-09-18
17:11:35 UTC (rev 10499)
@@ -16,7 +16,7 @@
<dependent-module archiveName="../commons-lang-2.3.jar"
deploy-path="lib"
handle="module:/classpath/var/M2_REPO/commons-lang/commons-lang/2.3/commons-lang-2.3.jar">
<dependency-type>uses</dependency-type>
</dependent-module>
- <dependent-module archiveName="../commons-logging-1.0.3.jar"
deploy-path="lib"
handle="module:/classpath/var/M2_REPO/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar">
+ <dependent-module archiveName="../commons-logging-1.0.4.jar"
deploy-path="lib"
handle="module:/classpath/var/M2_REPO/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="../dom4j-1.6.1-jboss.jar"
deploy-path="lib"
handle="module:/classpath/var/M2_REPO/dom4j/dom4j/1.6.1-jboss/dom4j-1.6.1-jboss.jar">
@@ -56,11 +56,11 @@
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="Seam-ejb.ejb" deploy-path="/"
handle="module:/resource/Seam-ejb/Seam-ejb">
- <dependent-object>EjbModule_21322992</dependent-object>
+ <dependent-object>EjbModule_28611526</dependent-object>
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="Seam-web.war" deploy-path="/"
handle="module:/resource/Seam-web/Seam-web">
- <dependent-object>WebModule_14197152</dependent-object>
+ <dependent-object>WebModule_5367420</dependent-object>
<dependency-type>uses</dependency-type>
</dependent-module>
<wb-resource deploy-path="/" source-path="src/main/java"/>
Modified: trunk/test-applications/regressionArea/Seam-ear/pom.xml
===================================================================
--- trunk/test-applications/regressionArea/Seam-ear/pom.xml 2008-09-18 15:46:01 UTC (rev
10498)
+++ trunk/test-applications/regressionArea/Seam-ear/pom.xml 2008-09-18 17:11:35 UTC (rev
10499)
@@ -83,6 +83,38 @@
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.8</version>
+ <scope>test</scope>
+ <type>pom</type>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.8</version>
+ <scope>test</scope>
+ <classifier>jdk15</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.openqa.selenium.client-drivers</groupId>
+ <artifactId>selenium-java-client-driver</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openqa.selenium.server</groupId>
+ <artifactId>selenium-server-coreless</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>jetty</groupId>
+ <artifactId>org.mortbay.jetty</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
</dependencies>
<build>
@@ -109,40 +141,7 @@
</modules>
</configuration>
</plugin>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant-jsch</artifactId>
- <version>1.6.5</version>
- </dependency>
- <dependency>
- <groupId>com.jcraft</groupId>
- <artifactId>jsch</artifactId>
- <version>0.1.29</version>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <phase>pre-integration-test</phase>
- <configuration>
- <tasks>
- <!-- <scp file="${project.build.directory}/APMS-ear.ear"
keyfile="/home/cruisecontrol/.ssh/id_dsa"
todir="apms@apms.eltegra.by:/home/apms/work/jboss-4.2.0.GA/bin/"
password="apms"></scp>-->
- <!-- <scp
- file="${project.build.directory}/APMS-ear-1.0-SNAPSHOT.ear"
- keyfile="/home/cruisecontrol/.ssh/id_dsa"
- todir="apms@apms.eltegra.by:/home/apms/work/jboss-4.2.0.GA/server/default/deploy/"
- password="apms">
- </scp> -->
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
+
</plugins>
<testResources>
<testResource>
@@ -206,13 +205,15 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.3</version>
<configuration>
+ <!-- <classesDirectory>../Seam-web/src/test/java</classesDirectory>
-->
<!-- Skip the normal tests, we'll run them in the integration-test phase
-->
- <skip>true</skip>
- <suiteXmlFiles>
+
+
+ <!-- suiteXmlFiles>
<suiteXmlFile>
resources/testng.xml
</suiteXmlFile>
- </suiteXmlFiles>
+ </suiteXmlFiles-->
</configuration>
<executions>
<execution>
@@ -221,7 +222,9 @@
<goal>test</goal>
</goals>
<configuration>
- <skip>false</skip>
+ <includes>
+ <include>D:/Work/Projects/RichFaces/SVN/trunk/test-applications/regressionArea/Seam-web/src/test/java/org/richfaces/testng/SimpleTest.java</include>
+ </includes>
</configuration>
</execution>
</executions>
Modified:
trunk/test-applications/regressionArea/Seam-ejb/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
trunk/test-applications/regressionArea/Seam-ejb/.settings/org.eclipse.jdt.core.prefs 2008-09-18
15:46:01 UTC (rev 10498)
+++
trunk/test-applications/regressionArea/Seam-ejb/.settings/org.eclipse.jdt.core.prefs 2008-09-18
17:11:35 UTC (rev 10499)
@@ -1,4 +1,4 @@
-#Wed Sep 17 12:51:10 EEST 2008
+#Thu Sep 18 17:10:29 EEST 2008
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.source=1.5
Modified: trunk/test-applications/regressionArea/Seam-ejb/pom.xml
===================================================================
--- trunk/test-applications/regressionArea/Seam-ejb/pom.xml 2008-09-18 15:46:01 UTC (rev
10498)
+++ trunk/test-applications/regressionArea/Seam-ejb/pom.xml 2008-09-18 17:11:35 UTC (rev
10499)
@@ -11,7 +11,17 @@
<name>Seam App EJB Module</name>
<packaging>ejb</packaging>
<dependencies>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-impl</artifactId>
+ <version>3.1.4.GA</version>
+ </dependency>
<dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui</artifactId>
+ <version>3.1.4.GA</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam-remoting</artifactId>
<version>2.0.1.GA</version>
@@ -37,17 +47,8 @@
<artifactId>jsf-facelets</artifactId>
<version>1.1.14</version>
</dependency>
+
<dependency>
- <groupId>org.richfaces.framework</groupId>
- <artifactId>richfaces-impl</artifactId>
- <version>3.1.4.GA</version>
- </dependency>
- <dependency>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>richfaces-ui</artifactId>
- <version>3.1.4.GA</version>
- </dependency>
- <dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
Modified: trunk/test-applications/regressionArea/Seam-web/.classpath
===================================================================
--- trunk/test-applications/regressionArea/Seam-web/.classpath 2008-09-18 15:46:01 UTC
(rev 10498)
+++ trunk/test-applications/regressionArea/Seam-web/.classpath 2008-09-18 17:11:35 UTC
(rev 10499)
@@ -1,8 +1,66 @@
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/main/resources"
excluding="**/*.java"/>
+ <classpathentry kind="src" path="src/test/java"
output="target/test-classes"/>
+ <classpathentry kind="src" path="src/test/resources"
output="target/test-classes" excluding="**/*.java"/>
<classpathentry kind="output" path="target/classes"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var"
path="M2_REPO/ant/ant/1.6.5/ant-1.6.5.jar"
sourcepath="M2_REPO/ant/ant/1.6.5/ant-1.6.5-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/apache/ant/ant/1.7.1/ant-1.7.1.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/apache/ant/ant-launcher/1.7.1/ant-launcher-1.7.1.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/bouncycastle/bcprov-jdk15/135/bcprov-jdk15-135.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/bsh/bsh/1.3.0/bsh-1.3.0.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar"
sourcepath="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar">
+ <attributes>
+ <attribute
value="jar:file:/C:/Documents%20and%20Settings/Andrey/.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-javadoc.jar!/"
name="javadoc_location"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="var"
path="M2_REPO/commons-codec/commons-codec/1.3/commons-codec-1.3.jar"
sourcepath="M2_REPO/commons-codec/commons-codec/1.3/commons-codec-1.3-sources.jar">
+ <attributes>
+ <attribute
value="jar:file:/C:/Documents%20and%20Settings/Andrey/.m2/repository/commons-codec/commons-codec/1.3/commons-codec-1.3-javadoc.jar!/"
name="javadoc_location"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="var"
path="M2_REPO/commons-collections/commons-collections/3.2/commons-collections-3.2.jar"
sourcepath="M2_REPO/commons-collections/commons-collections/3.2/commons-collections-3.2-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/commons-digester/commons-digester/1.8/commons-digester-1.8.jar"
sourcepath="M2_REPO/commons-digester/commons-digester/1.8/commons-digester-1.8-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/commons-lang/commons-lang/2.3/commons-lang-2.3.jar"
sourcepath="M2_REPO/commons-lang/commons-lang/2.3/commons-lang-2.3-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar"
sourcepath="M2_REPO/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-sources.jar">
+ <attributes>
+ <attribute
value="jar:file:/C:/Documents%20and%20Settings/Andrey/.m2/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-javadoc.jar!/"
name="javadoc_location"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="var"
path="M2_REPO/dom4j/dom4j/1.6.1-jboss/dom4j-1.6.1-jboss.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/el/el-api/1.0/el-api-1.0.jar"
sourcepath="M2_REPO/javax/el/el-api/1.0/el-api-1.0-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/codehaus/groovy/maven/gmaven-common/1.0-rc-3/gmaven-common-1.0-rc-3.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/codehaus/groovy/maven/feature/gmaven-feature-api/1.0-rc-3/gmaven-feature-api-1.0-rc-3.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/codehaus/groovy/maven/feature/gmaven-feature-support/1.0-rc-3/gmaven-feature-support-1.0-rc-3.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/codehaus/groovy/maven/runtime/gmaven-runtime-1.5/1.0-rc-3/gmaven-runtime-1.5-1.0-rc-3.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/codehaus/groovy/maven/runtime/gmaven-runtime-api/1.0-rc-3/gmaven-runtime-api-1.0-rc-3.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/codehaus/groovy/maven/runtime/gmaven-runtime-default/1.0-rc-3/gmaven-runtime-default-1.0-rc-3.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/codehaus/groovy/maven/runtime/gmaven-runtime-support/1.0-rc-3/gmaven-runtime-support-1.0-rc-3.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/codehaus/groovy/groovy-all-minimal/1.5.6/groovy-all-minimal-1.5.6.jar"
sourcepath="M2_REPO/org/codehaus/groovy/groovy-all-minimal/1.5.6/groovy-all-minimal-1.5.6-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jboss/el/jboss-el/2.0.1.GA/jboss-el-2.0.1.GA.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jboss/seam/jboss-seam/2.0.1.GA/jboss-seam-2.0.1.GA.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jboss/seam/jboss-seam-debug/2.0.1.GA/jboss-seam-debug-2.0.1.GA.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jboss/seam/jboss-seam-remoting/2.0.1.GA/jboss-seam-remoting-2.0.1.GA.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jboss/seam/jboss-seam-ui/2.0.1.GA/jboss-seam-ui-2.0.1.GA.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/jline/jline/0.9.94/jline-0.9.94.jar"
sourcepath="M2_REPO/jline/jline/0.9.94/jline-0.9.94-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/faces/jsf-api/1.1_02/jsf-api-1.1_02.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/com/sun/facelets/jsf-facelets/1.1.14/jsf-facelets-1.1.14.jar"
sourcepath="M2_REPO/com/sun/facelets/jsf-facelets/1.1.14/jsf-facelets-1.1.14-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/faces/jsf-impl/1.1_02/jsf-impl-1.1_02.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/servlet/jstl/1.0/jstl-1.0.jar"
sourcepath="M2_REPO/javax/servlet/jstl/1.0/jstl-1.0-sources.jar"/>
<classpathentry kind="var"
path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"
sourcepath="M2_REPO/junit/junit/3.8.1/junit-3.8.1-sources.jar"/>
- <classpathentry kind="var"
path="M2_REPO/org/testng/testng/5.5/testng-5.5-jdk15.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/codehaus/plexus/plexus-utils/1.5.5/plexus-utils-1.5.5.jar"
sourcepath="M2_REPO/org/codehaus/plexus/plexus-utils/1.5.5/plexus-utils-1.5.5-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/com/thoughtworks/qdox/qdox/1.6.3/qdox-1.6.3.jar"
sourcepath="M2_REPO/com/thoughtworks/qdox/qdox/1.6.3/qdox-1.6.3-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/richfaces/framework/richfaces-api/3.1.4.GA/richfaces-api-3.1.4.GA.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/richfaces/framework/richfaces-impl/3.1.4.GA/richfaces-impl-3.1.4.GA.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/richfaces/ui/richfaces-ui/3.1.4.GA/richfaces-ui-3.1.4.GA.jar"/>
+ <classpathentry kind="src" path="/Seam-ejb"/>
+ <classpathentry kind="var"
path="M2_REPO/org/openqa/selenium/core/selenium-core/1.0-SNAPSHOT/selenium-core-1.0-SNAPSHOT.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/openqa/selenium/client-drivers/selenium-java-client-driver/1.0-SNAPSHOT/selenium-java-client-driver-1.0-SNAPSHOT.jar"
sourcepath="M2_REPO/org/openqa/selenium/client-drivers/selenium-java-client-driver/1.0-SNAPSHOT/selenium-java-client-driver-1.0-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/openqa/selenium/server/selenium-server/1.0-SNAPSHOT/selenium-server-1.0-SNAPSHOT-standalone.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/openqa/selenium/server/selenium-server-coreless/1.0-SNAPSHOT/selenium-server-coreless-1.0-SNAPSHOT.jar"
sourcepath="M2_REPO/org/openqa/selenium/server/selenium-server-coreless/1.0-SNAPSHOT/selenium-server-coreless-1.0-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/slf4j/slf4j-api/1.5.0/slf4j-api-1.5.0.jar"
sourcepath="M2_REPO/org/slf4j/slf4j-api/1.5.0/slf4j-api-1.5.0-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/testng/testng/5.8/testng-5.8-jdk15.jar"/>
</classpath>
\ No newline at end of file
Modified: trunk/test-applications/regressionArea/Seam-web/.project
===================================================================
--- trunk/test-applications/regressionArea/Seam-web/.project 2008-09-18 15:46:01 UTC (rev
10498)
+++ trunk/test-applications/regressionArea/Seam-web/.project 2008-09-18 17:11:35 UTC (rev
10499)
@@ -1,7 +1,9 @@
<projectDescription>
<name>Seam-web</name>
<comment/>
- <projects/>
+ <projects>
+ <project>Seam-ejb</project>
+ </projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
Modified:
trunk/test-applications/regressionArea/Seam-web/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
trunk/test-applications/regressionArea/Seam-web/.settings/org.eclipse.jdt.core.prefs 2008-09-18
15:46:01 UTC (rev 10498)
+++
trunk/test-applications/regressionArea/Seam-web/.settings/org.eclipse.jdt.core.prefs 2008-09-18
17:11:35 UTC (rev 10499)
@@ -1,4 +1,4 @@
-#Wed Sep 17 12:51:11 EEST 2008
+#Thu Sep 18 17:10:31 EEST 2008
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.source=1.5
Modified:
trunk/test-applications/regressionArea/Seam-web/.settings/org.eclipse.wst.common.component
===================================================================
---
trunk/test-applications/regressionArea/Seam-web/.settings/org.eclipse.wst.common.component 2008-09-18
15:46:01 UTC (rev 10498)
+++
trunk/test-applications/regressionArea/Seam-web/.settings/org.eclipse.wst.common.component 2008-09-18
17:11:35 UTC (rev 10499)
@@ -1,9 +1,11 @@
-<project-modules id="moduleCoreId" project-version="2.0">
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="Seam-web">
- <property name="context-root" value="/SeamApp"/>
+ <property name="context-root" value="/Seam"/>
<wb-resource deploy-path="/"
source-path="src/main/webapp"/>
<property name="java-output-path"
value="/target/classes"/>
<wb-resource deploy-path="/WEB-INF/classes"
source-path="src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes"
source-path="src/main/resources"/>
+<wb-resource deploy-path="/WEB-INF/classes"
source-path="/src/test/resources"/>
</wb-module>
-</project-modules>
\ No newline at end of file
+</project-modules>
Modified: trunk/test-applications/regressionArea/Seam-web/pom.xml
===================================================================
--- trunk/test-applications/regressionArea/Seam-web/pom.xml 2008-09-18 15:46:01 UTC (rev
10498)
+++ trunk/test-applications/regressionArea/Seam-web/pom.xml 2008-09-18 17:11:35 UTC (rev
10499)
@@ -12,13 +12,44 @@
<packaging>war</packaging>
<dependencies>
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <version>5.5</version>
- <scope>test</scope>
- <classifier>jdk15</classifier>
- </dependency>
+ <dependency>
+ <groupId>org.richfaces.test-applications.regressionArea</groupId>
+ <artifactId>Seam-ejb</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.8</version>
+ <scope>test</scope>
+ <type>pom</type>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.8</version>
+ <scope>test</scope>
+ <classifier>jdk15</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.openqa.selenium.client-drivers</groupId>
+ <artifactId>selenium-java-client-driver</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openqa.selenium.server</groupId>
+ <artifactId>selenium-server-coreless</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>jetty</groupId>
+ <artifactId>org.mortbay.jetty</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
</dependencies>
@@ -43,7 +74,110 @@
</webResources>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
</plugins>
</build>
+
+ <profiles>
+ <profile>
+ <id>Test</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <version>0.3.1</version>
+ <executions>
+ <execution>
+ <id>start-container</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ </execution>
+ <!--execution>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>deploy</goal>
+ </goals>
+ </execution-->
+ <execution>
+ <id>stop-container</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <wait>false</wait>
+ <container>
+ <containerId>jboss4x</containerId>
+ <home>D:/Install/Java/jboss-4.2.3.GA</home>
+ <append>false</append>
+ </container>
+ <configuration>
+ <home>D:/Install/Java/jboss-4.2.3.GA/server/default</home>
+ <type>existing</type>
+ <properties>
+ <cargo.hostname>localhost</cargo.hostname>
+
<cargo.jboss.configuration>default</cargo.jboss.configuration>
+ <cargo.rmi.port>1099</cargo.rmi.port>
+ </properties>
+ </configuration>
+ <deployer>
+ <type>local</type>
+ <deployables>
+ <deployable>
+
<groupId>org.richfaces.test-applications.regressionArea</groupId>
+ <artifactId>Seam-ear</artifactId>
+ <type>ear</type>
+ <pingURL>http://localhost:8080/Seam/</pingURL>
+ </deployable>
+ </deployables>
+ </deployer>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <configuration>
+ <!-- Skip the normal tests, we'll run them in the integration-test phase
-->
+ <suiteXmlFiles>
+ <suiteXmlFile>
+ src/test/resources/testng.xml
+ </suiteXmlFile>
+ </suiteXmlFiles>
+ <properties>
+ <property>
+ <name>listener</name>
+ <value>org.richfaces.TestAnnotationTransformer</value>
+ </property>
+ </properties>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
Deleted: trunk/test-applications/regressionArea/Seam-web/src/copy-web-pages1.bat
===================================================================
--- trunk/test-applications/regressionArea/Seam-web/src/copy-web-pages1.bat 2008-09-18
15:46:01 UTC (rev 10498)
+++ trunk/test-applications/regressionArea/Seam-web/src/copy-web-pages1.bat 2008-09-18
17:11:35 UTC (rev 10499)
@@ -1,2 +0,0 @@
-xcopy "main/webapp"
"h:/jbdevstudio/jboss-eap/jboss-as/server/default/deploy/APMS-ear.ear/APMS.war/"
/D /S /E /Y
-
\ No newline at end of file
Added:
trunk/test-applications/regressionArea/Seam-web/src/main/java/org/ajax4jsf/bean/Configurator.java
===================================================================
---
trunk/test-applications/regressionArea/Seam-web/src/main/java/org/ajax4jsf/bean/Configurator.java
(rev 0)
+++
trunk/test-applications/regressionArea/Seam-web/src/main/java/org/ajax4jsf/bean/Configurator.java 2008-09-18
17:11:35 UTC (rev 10499)
@@ -0,0 +1,53 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.ajax4jsf.bean;
+
+
+
+public class Configurator {
+
+ private static final String[] LOAD_STRATEGIES = new String[] {"DEFAULT",
"ALL"};
+
+ private static String loadScriptStrategy = LOAD_STRATEGIES[0];
+
+ private static String loadStyleStrategy = LOAD_STRATEGIES[0];
+
+ private static int currentStrategyIndex = 0;
+
+ public Configurator() {}
+
+ public String getLoadScriptStrategy() {
+ return loadScriptStrategy;
+ }
+
+ public static void setLoadScriptStrategy(String strategy) {
+ loadScriptStrategy = strategy;
+ }
+
+ public String getLoadStyleStrategy() {
+ return loadStyleStrategy;
+ }
+
+ public static void setLoadStyleStrategy(String strategy) {
+ loadStyleStrategy = strategy;
+ }
+
+}
Added:
trunk/test-applications/regressionArea/Seam-web/src/main/java/org/ajax4jsf/bean/TemplateBean.java
===================================================================
---
trunk/test-applications/regressionArea/Seam-web/src/main/java/org/ajax4jsf/bean/TemplateBean.java
(rev 0)
+++
trunk/test-applications/regressionArea/Seam-web/src/main/java/org/ajax4jsf/bean/TemplateBean.java 2008-09-18
17:11:35 UTC (rev 10499)
@@ -0,0 +1,81 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.bean;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.model.SelectItem;
+
+import org.ajax4jsf.template.Template;
+
+
+public class TemplateBean {
+ public static final String PARAM_NAME = "t";
+
+ private Template template = Template.SIMPLE;
+
+ /*
+ * public void initTemplate (ActionEvent event) { Map<String, String>
+ * reqMap =
+ * FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+ * String template = reqMap.get(PARAM_NAME); this.template = template !=
+ * null ? template : "simple"; }
+ */
+
+ public String getTemplateId() {
+ return template.toString();
+ }
+
+ public void setTemplateId(String template) {
+ this.template = Template.valueOf(template);
+ }
+
+ public String getParentId() {
+ return template.getPrefix();
+ }
+
+ /**
+ * @return the template
+ */
+ public String getTemplate() {
+ return "../template/" + template.getName() + ".xhtml";
+ }
+
+ /**
+ * @param template
+ * the template to set
+ */
+ public void setTemplate(Template template) {
+ this.template = template;
+ }
+
+ public List<SelectItem> getAvailableTemplates() {
+ List<SelectItem> retVal = new ArrayList<SelectItem>();
+ for (Template template : Template.values()) {
+ retVal.add(new SelectItem(template.toString(), template.getDesc()));
+ }
+
+ return retVal;
+ }
+
+}
\ No newline at end of file
Added:
trunk/test-applications/regressionArea/Seam-web/src/main/java/org/ajax4jsf/template/Template.java
===================================================================
---
trunk/test-applications/regressionArea/Seam-web/src/main/java/org/ajax4jsf/template/Template.java
(rev 0)
+++
trunk/test-applications/regressionArea/Seam-web/src/main/java/org/ajax4jsf/template/Template.java 2008-09-18
17:11:35 UTC (rev 10499)
@@ -0,0 +1,55 @@
+package org.ajax4jsf.template;
+
+/**
+ * Kids of templates that can be put in harness.
+ * @author carcasser
+ *
+ */
+public enum Template implements TestConstants {
+ SIMPLE (SIMPLE_TEMPLATE_NAME, COMPONENT_PREFIX_SIMPLE, SIMPLE_TEMPLATE_DESC),
+ DATA_TABLE (DATA_TABLE_TEMPLATE_NAME, COMPONENT_PREFIX_INSIDE_TABLE,
DATA_TABLE_TEMPLATE_DESC),
+ MODAL_PANEL (MODAL_PANEL_TEMPLATE_NAME, COMPONENT_PREFIX_SIMPLE,
MODAL_PANEL_TEMPLATE_DESC);
+
+ private String name;
+
+ private String prefix;
+
+ private String desc;
+
+ /**
+ * Private constructor.
+ *
+ * @param name
+ * @param prefix
+ */
+ private Template(String name, String prefix, String desc) {
+ this.name = name;
+ this.prefix = prefix;
+ this.desc = desc;
+ }
+
+ /**
+ * Gets value of name field.
+ * @return value of name field
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Gets value of prefix field.
+ * @return value of prefix field
+ */
+ public String getPrefix() {
+ return prefix;
+ }
+
+ /**
+ * Gets value of desc field.
+ * @return value of desc field
+ */
+ public String getDesc() {
+ return desc;
+ }
+
+}
Added:
trunk/test-applications/regressionArea/Seam-web/src/main/java/org/ajax4jsf/template/TestConstants.java
===================================================================
---
trunk/test-applications/regressionArea/Seam-web/src/main/java/org/ajax4jsf/template/TestConstants.java
(rev 0)
+++
trunk/test-applications/regressionArea/Seam-web/src/main/java/org/ajax4jsf/template/TestConstants.java 2008-09-18
17:11:35 UTC (rev 10499)
@@ -0,0 +1,23 @@
+package org.ajax4jsf.template;
+
+public interface TestConstants {
+
+ /* Constants of component prefixes */
+ public static final String COMPONENT_PREFIX_INSIDE_TABLE =
"_Selenium_Test_DataTable:0:";
+ public static final String COMPONENT_PREFIX_SIMPLE = "";
+
+ /* Constants of template names */
+ public static final String SIMPLE_TEMPLATE_NAME = "simple";
+ public static final String DATA_TABLE_TEMPLATE_NAME = "dataTable";
+ public static final String MODAL_PANEL_TEMPLATE_NAME = "modalPanel";
+
+ /* Constants of template descriptions */
+ public static final String SIMPLE_TEMPLATE_DESC = "Simple";
+ public static final String DATA_TABLE_TEMPLATE_DESC = "DataTable";
+ public static final String MODAL_PANEL_TEMPLATE_DESC = "Modal Panel";
+
+ /* Constants of test configuration */
+ public final static String HOST = "localhost";
+ public final static String PROTOCOL = "http";
+
+}
Modified:
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/WEB-INF/faces-config.xml 2008-09-18
15:46:01 UTC (rev 10498)
+++
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/WEB-INF/faces-config.xml 2008-09-18
17:11:35 UTC (rev 10499)
@@ -5,4 +5,19 @@
<application>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</application>
+
+
+ <managed-bean>
+ <managed-bean-name>configurator</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.bean.Configurator</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+ <managed-bean>
+ <managed-bean-name>templateBean</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.bean.TemplateBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+
</faces-config>
\ No newline at end of file
Modified:
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/WEB-INF/jboss-web.xml
===================================================================
---
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/WEB-INF/jboss-web.xml 2008-09-18
15:46:01 UTC (rev 10498)
+++
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/WEB-INF/jboss-web.xml 2008-09-18
17:11:35 UTC (rev 10499)
@@ -5,7 +5,7 @@
<jboss-web>
<class-loading java2ClassLoadingCompliance="false">
<loader-repository>
- seam.jboss.org:loader=Seam-web.war
+ seam.jboss.org:loader=Seam-web
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
</loader-repository>
</class-loading>
Deleted:
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/WEB-INF/lib/richfaces-impl.jar
===================================================================
(Binary files differ)
Deleted:
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/WEB-INF/lib/richfaces-ui.jar
===================================================================
(Binary files differ)
Modified: trunk/test-applications/regressionArea/Seam-web/src/main/webapp/WEB-INF/web.xml
===================================================================
---
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/WEB-INF/web.xml 2008-09-18
15:46:01 UTC (rev 10498)
+++
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/WEB-INF/web.xml 2008-09-18
17:11:35 UTC (rev 10499)
@@ -19,6 +19,38 @@
<param-name>facelets.SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
+
+ <context-param>
+ <param-name>org.ajax4jsf.xmlparser.ORDER</param-name>
+ <param-value>NONE,TIDY,NEKO</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.xmlparser.TIDY</param-name>
+ <param-value>
+ /faces/TIDY/*
+ </param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.xmlparser.NEKO</param-name>
+ <param-value>
+ /faces/NEKO/*
+ </param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.xmlparser.NONE</param-name>
+ <param-value>
+ /faces/NONE/*
+ </param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>org.richfaces.LoadStyleStrategy</param-name>
+ <param-value>#{configurator.loadStyleStrategy}</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.LoadScriptStrategy</param-name>
+ <param-value>#{configurator.loadScriptStrategy}</param-value>
+ </context-param>
<!-- Seam -->
@@ -68,9 +100,28 @@
</servlet>
<!-- Faces Servlet Mapping -->
+
<servlet-mapping>
- <servlet-name>Faces Servlet</servlet-name>
- <url-pattern>*.seam</url-pattern>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.seam</url-pattern>
</servlet-mapping>
+
+
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/NEKO/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/TIDY/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/NONE/*</url-pattern>
+ </servlet-mapping>
+
+
+
</web-app>
Modified: trunk/test-applications/regressionArea/Seam-web/src/main/webapp/home.xhtml
===================================================================
--- trunk/test-applications/regressionArea/Seam-web/src/main/webapp/home.xhtml 2008-09-18
15:46:01 UTC (rev 10498)
+++ trunk/test-applications/regressionArea/Seam-web/src/main/webapp/home.xhtml 2008-09-18
17:11:35 UTC (rev 10499)
@@ -13,9 +13,9 @@
</head>
<body id="pgHome">
<f:view>
- <h:form>
+ <h:form id="_form">
<rich:panel header="Rich Users">
- <rich:dataTable value="#{usersBean.users}" var="us">
+ <rich:dataTable id="tb" value="#{usersBean.users}"
var="us">
<rich:column>
<f:facet name="header">
<h:outputText value="Name"></h:outputText>
Modified: trunk/test-applications/regressionArea/Seam-web/src/main/webapp/index.html
===================================================================
--- trunk/test-applications/regressionArea/Seam-web/src/main/webapp/index.html 2008-09-18
15:46:01 UTC (rev 10498)
+++ trunk/test-applications/regressionArea/Seam-web/src/main/webapp/index.html 2008-09-18
17:11:35 UTC (rev 10499)
@@ -1,5 +1,5 @@
<html>
<head>
- <meta http-equiv="Refresh" content="0; URL=login.seam">
+ <meta http-equiv="Refresh" content="0;
URL=faces/NEKO/login.xhtml">
</head>
</html>
\ No newline at end of file
Added:
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/layout/controlLayout.xhtml
===================================================================
---
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/layout/controlLayout.xhtml
(rev 0)
+++
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/layout/controlLayout.xhtml 2008-09-18
17:11:35 UTC (rev 10499)
@@ -0,0 +1,32 @@
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+<hr />
+<h:form id="_Selenium_Test_Template_Form">
+<table style="background-color: #F2F2F2">
+<tr>
+<td>
+Current Template:
+</td>
+<td>
+ <h:selectOneMenu value="#{templateBean.templateId}"
id="_Selenium_Test_Template_id">
+ <f:selectItems value="#{templateBean.availableTemplates}" />
+ </h:selectOneMenu>
+</td>
+<td>
+ <h:commandLink id="_Selenium_Test_loadTemplate"
value="Load"></h:commandLink>
+</td>
+</tr>
+</table>
+</h:form>
+<h:form id="_Selenium_Test_ReRender_Form">
+<div>
+ <a
href="#{facesContext.externalContext.requestContextPath}/faces/TIDY/index.xhtml">Home</a>
+</div>
+<div>
+ <a4j:commandLink ajaxSingle="true"
reRender="_Selenium_Test_Common_Grid" value="ReRenderAll"
id="_reRender"/>
+</div>
+</h:form>
+</html>
\ No newline at end of file
Added:
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/layout/layout.xhtml
===================================================================
--- trunk/test-applications/regressionArea/Seam-web/src/main/webapp/layout/layout.xhtml
(rev 0)
+++
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/layout/layout.xhtml 2008-09-18
17:11:35 UTC (rev 10499)
@@ -0,0 +1,117 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+<f:view contentType="text/html">
+<head>
+ <a4j:loadScript
src="resource:///org/ajax4jsf/javascript/scripts/AJAX.js"></a4j:loadScript>
+ <a4j:loadScript
src="resource:///org/ajax4jsf/javascript/scripts/form.js"></a4j:loadScript>
+ <script>
+ var errorMessage = null;
+ var pauseHolder = {};
+ window.onerror = function (message, url, code) {
+ errorMessage = message;
+ };
+ function checkError () {
+ return errorMessage;
+ }
+
+ function pause (miliseconds, id) {
+ pauseHolder[id] = false;
+ window.setTimeout(function () { pauseHolder[id] = true; }, miliseconds);
+ }
+
+ function submitForm () {
+ document.getElementById('_form').submit();
+ }
+
+ function reRenderAll () {
+ document.getElementById('_Selenium_Test_ReRender_Form:_reRender').onclick();
+ return;
+ }
+
+ function loadTemplate (name) {
+ document.getElementById('_Selenium_Test_Template_Form:_Selenium_Test_Template_id').value
= name;
+ document.getElementById('_Selenium_Test_Template_Form:_Selenium_Test_loadTemplate').onclick();
+ return;
+ }
+
+ function getParentId () {
+ return '#{templateBean.parentId}';
+ }
+
+ function writeStatus (mess, failed) {
+ document.getElementById('_Selenium_Test_Status_Message').value = mess;
+ if (failed) {
+ var o = document.getElementById('_Selenium_Test_Status_Message');
+ o.style.backgroundColor= '#F7A784';
+ o.style.fontWeight = 'bold';
+ }else {
+ var o = document.getElementById('_Selenium_Test_Status_Message');
+ o.style.backgroundColor= '';
+ o.style.fontWeight = '';
+ }
+ }
+
+ //Marks ${element.id}_${resultElemIdPostfix} result element as passed test
+ //if resultElemIdPostfix is not specified ${element.id}_result will be used instead
+ function testEvent(element, resultElemIdPostfix) {
+ resultElemIdPostfix = resultElemIdPostfix || 'result';
+ element = document.getElementById(element.id + "_" + resultElemIdPostfix);
+ element.style.cssText = 'background-color: green';
+ element.innerHTML = 'Passed';
+ }
+
+ function resetEventTestResult(id) {
+ element = document.getElementById(id);
+ element.style.cssText = 'background-color: white';
+ element.innerHTML = 'No';
+ }
+
+ function fireMouseEvent(id,eventName, x, y, ctrl) {
+ var e = $(id);
+ var evt;
+ if (document.createEvent) {
+ evt = document.createEvent("MouseEvents");
+ evt.initMouseEvent(eventName, true, true, window,0, x, y, x, y, ctrl, false, false,
false, 0, null);
+ evt.srcElement = e;
+ e.dispatchEvent(evt);
+ }else {
+ if (e[eventName]) {
+ return e[eventName]();
+ }
+ }
+ }
+
+ </script>
+ <style type="text/css">
+ <ui:insert name="style"/>
+ </style>
+</head>
+<body>
+<div style="padding: 10px; font-size: 24px;">Regression Area testing by
Selenium</div><br/>
+
+<div id="_Selenium_Test_ControlPoint1" style="display:
none;">Control1</div>
+<h:panelGrid id="_Selenium_Test_Common_Grid">
+ <div>
+ <b>Status: </b> <input style="border: 0px; color: black; width:
700px" readonly="true" id="_Selenium_Test_Status_Message" />
+ </div>
+ <br/>
+ <div>
+ <ui:insert name="template"/>
+ </div>
+</h:panelGrid>
+
+<div id="_Selenium_Test_ControlPoint2" style="display:
none;">Control2</div>
+
+<ui:insert name="control" />
+
+<script type="text/javascript">
+ window.done=false; A4J.AJAX.AddListener(new
A4J.AJAX.Listener(function(){window.done=true;}));
+</script>
+</body>
+</f:view>
+</html>
\ No newline at end of file
Added: trunk/test-applications/regressionArea/Seam-web/src/main/webapp/pages/home.xhtml
===================================================================
--- trunk/test-applications/regressionArea/Seam-web/src/main/webapp/pages/home.xhtml
(rev 0)
+++
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/pages/home.xhtml 2008-09-18
17:11:35 UTC (rev 10499)
@@ -0,0 +1,27 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:a4j="http://richfaces.org/a4j">
+
+<ui:composition template="#{templateBean.template}">
+ <ui:define name="style">
+
+ </ui:define>
+ <ui:define name="component">
+ <rich:panel header="Rich Users">
+ <rich:dataTable id="tb" value="#{usersBean.users}"
var="us">
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="Name"></h:outputText>
+ </f:facet>
+ <h:outputText value="#{us.name}"></h:outputText>
+ </rich:column>
+ </rich:dataTable>
+ </rich:panel>
+ </ui:define>
+</ui:composition>
+</html>
Added:
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/template/dataTable.xhtml
===================================================================
---
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/template/dataTable.xhtml
(rev 0)
+++
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/template/dataTable.xhtml 2008-09-18
17:11:35 UTC (rev 10499)
@@ -0,0 +1,23 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+<ui:composition template="../layout/layout.xhtml">
+ <ui:define name="template">
+ <rich:dataTable value="1" id="_Selenium_Test_DataTable">
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="Data Table" />
+ </f:facet>
+ <ui:insert name="component" />
+ </rich:column>
+ </rich:dataTable>
+ </ui:define>
+ <ui:define name="control">
+ <ui:include src="../layout/controlLayout.xhtml" />
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Added:
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/template/modalPanel.xhtml
===================================================================
---
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/template/modalPanel.xhtml
(rev 0)
+++
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/template/modalPanel.xhtml 2008-09-18
17:11:35 UTC (rev 10499)
@@ -0,0 +1,23 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+<ui:composition template="../layout/layout.xhtml">
+ <ui:define name="template">
+ <rich:modalPanel id="_Selenium_Test_ModalPanel"
showWhenRendered="true" width="600" height="600">
+ <f:facet name="header" >
+ <h:outputText value="Modal Panel" />
+ </f:facet>
+ <f:facet name="controls" >
+ <a onclick="Richfaces.hideModalPanel('_Selenium_Test_ModalPanel');
return false;"
+ href="#" >Hide the panel</a>
+ </f:facet>
+ <ui:insert name="component" />
+ <ui:include src="../layout/controlLayout.xhtml" />
+ </rich:modalPanel>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Added:
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/template/simple.xhtml
===================================================================
--- trunk/test-applications/regressionArea/Seam-web/src/main/webapp/template/simple.xhtml
(rev 0)
+++
trunk/test-applications/regressionArea/Seam-web/src/main/webapp/template/simple.xhtml 2008-09-18
17:11:35 UTC (rev 10499)
@@ -0,0 +1,16 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+<ui:composition template="../layout/layout.xhtml">
+ <ui:define name="template">
+ <ui:insert name="component" />
+ </ui:define>
+ <ui:define name="control">
+ <ui:include src="../layout/controlLayout.xhtml" />
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Added:
trunk/test-applications/regressionArea/Seam-web/src/test/java/org/richfaces/RichSeleniumTest.java
===================================================================
---
trunk/test-applications/regressionArea/Seam-web/src/test/java/org/richfaces/RichSeleniumTest.java
(rev 0)
+++
trunk/test-applications/regressionArea/Seam-web/src/test/java/org/richfaces/RichSeleniumTest.java 2008-09-18
17:11:35 UTC (rev 10499)
@@ -0,0 +1,11 @@
+package org.richfaces;
+
+public interface RichSeleniumTest {
+
+ public void startSelenium(String browser, String filterPrefix);
+
+ public void stopSelenium();
+
+ public String getTestUrl();
+
+}
Added:
trunk/test-applications/regressionArea/Seam-web/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
---
trunk/test-applications/regressionArea/Seam-web/src/test/java/org/richfaces/SeleniumTestBase.java
(rev 0)
+++
trunk/test-applications/regressionArea/Seam-web/src/test/java/org/richfaces/SeleniumTestBase.java 2008-09-18
17:11:35 UTC (rev 10499)
@@ -0,0 +1,833 @@
+package org.richfaces;
+
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.ajax4jsf.bean.Configurator;
+import org.ajax4jsf.javascript.ScriptUtils;
+import org.ajax4jsf.template.Template;
+import org.openqa.selenium.server.RemoteControlConfiguration;
+import org.openqa.selenium.server.SeleniumServer;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Parameters;
+import org.richfaces.RichSeleniumTest;
+
+import com.thoughtworks.selenium.DefaultSelenium;
+
+/**
+ * The base java class for selenium tests implementation.
+ *
+ * @author Andrey Markavtsov
+ *
+ */
+public abstract class SeleniumTestBase implements RichSeleniumTest {
+
+ /** Specifies the time to wait for page rendering */
+ private static final Integer pageRenderTime = 5000;
+
+ /** Specifies the time to wait for ajax processing */
+ protected static final int ajaxCompletionTime = 3000;
+
+ protected static final String serverPort = "8080";
+
+ protected static final String WINDOW_JS_RESOLVER =
"selenium.browserbot.getCurrentWindow().";
+
+ /** Parent component id */
+ private String parentId;
+
+ /** The default selenium instance */
+ public DefaultSelenium selenium;
+
+ /** Host */
+ public String host;
+
+ /** Port */
+ public String port;
+
+ /** Protocol */
+ public String protocol;
+
+ private String filterPrefix;
+
+ private SeleniumServer seleniumServer;
+
+ private Object[][] data;
+
+ private int seleniumServerPort = 5556;
+
+ /** Defines the name of current j2ee application name */
+ public static final String APPLICATION_NAME = "Seam";
+
+ public SeleniumTestBase() {
+ this("http", "localhost", serverPort);
+ }
+
+ public SeleniumTestBase(String protocol, String host, String port) {
+ this.host = host;
+ this.port = port;
+ this.protocol = protocol;
+ }
+
+ @BeforeSuite
+ public void startSeleniumServer() throws Exception {
+ RemoteControlConfiguration config = new RemoteControlConfiguration();
+ config.setMultiWindow(false);
+ config.setPort(seleniumServerPort);
+ seleniumServer = new SeleniumServer(false, config);
+ seleniumServer.start();
+ }
+
+ @DataProvider(name = "templates")
+ protected Object[][] templates() {
+ return new Object[][] { { Template.SIMPLE }, { Template.DATA_TABLE }, {
Template.MODAL_PANEL } };
+ //return this.data;
+ }
+
+ /**
+ * This method are invoked before selenium tests started
+ */
+ @BeforeClass
+ @Parameters({"browser", "filterPrefix"})
+ public void startSelenium(String browser, String filterPrefix) {
+ synchronized (MUTEX) {
+ this.filterPrefix = filterPrefix;
+ selenium = createSeleniumClient(protocol + "://" + host +
":" + port + "/", browser);
+ selenium.start();
+ selenium.allowNativeXpath("false");
+ }
+ }
+
+ @BeforeTest
+ @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
+ protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy)
throws Exception {
+ Configurator.setLoadScriptStrategy(loadScriptStrategy);
+ Configurator.setLoadStyleStrategy(loadStyleStrategy);
+ }
+
+ /**
+ * This method are invoked after selenium tests completed
+ */
+ @AfterClass(alwaysRun=true)
+ public void stopSelenium() {
+ synchronized (MUTEX) {
+ selenium.stop();
+ selenium = null;
+ }
+ }
+
+ protected void loadTemplates(String templateExpr) {
+ String[] array = new String[]{};
+ if(null != templateExpr) {
+ array = templateExpr.split(",");
+ }
+
+ List<Object[]> list = new ArrayList<Object[]>();
+ for (String string : array) {
+ Object[] elem = new Object[] {Template.valueOf(string)};
+ list.add(elem);
+ }
+
+ this.data = (Object[][]) list.toArray(new Object[0][0]);
+ }
+
+ @AfterSuite
+ public void stopSeleniumServer() throws Exception {
+ seleniumServer.stop();
+ }
+
+ /**
+ * @param url
+ * @param browser
+ * @return
+ */
+ private DefaultSelenium createSeleniumClient(String url, String browser) {
+ return new DefaultSelenium(host, seleniumServerPort, browser, url);
+ }
+
+ private static final Object MUTEX = new Object();
+
+ /**
+ * Renders page
+ */
+ protected void renderPage(Template template) {
+ selenium.open(protocol + "://" + host + ":" + port +
"/" + APPLICATION_NAME + filterPrefix + getTestUrl());
+ selenium.waitForPageToLoad(String.valueOf(pageRenderTime));
+
+ setParentId(template.getPrefix());
+ runScript("loadTemplate('" + template + "');",
false);
+ waitForPageToLoad();
+
+ checkPageRendering(); // At the first we check if page has been
+ // rendered
+ checkJSError(); // At the second we check if JS errors occurred
+
+ reRenderForm(); // ReRender component
+
+ checkPageRendering(); // Check all again
+ checkJSError();
+
+ }
+
+ /**
+ * Writes status message on client side
+ *
+ * @param message
+ */
+ public void writeStatus(String message, boolean isError) {
+ message = message.replace("'", "\\'");
+ StringBuffer buffer = new StringBuffer("writeStatus('");
+ buffer.append(message);
+ if (!isError) {
+ buffer.append("')");
+ }else {
+ buffer.append("',true)");
+ }
+ runScript(buffer.toString());
+ }
+
+ /**
+ * Writes status message on client side
+ *
+ * @param message
+ */
+ public void writeStatus(String message) {
+ writeStatus(message, false);
+ }
+
+ /**
+ * ReRenders the component
+ */
+ public void reRenderForm() {
+
selenium.getEval("selenium.browserbot.getCurrentWindow().reRenderAll();");
+ // clickById("_Selenium_Test_ReRender_Form:_reRender");
+ waitForAjaxCompletion(3000);
+ }
+
+ /**
+ * Performs script defined in parameter
+ *
+ * @param script
+ * @return
+ */
+ public String runScript(String script) {
+ String result = selenium.getEval(WINDOW_JS_RESOLVER + script);
+ checkJSError();
+ return result;
+ }
+
+ /**
+ * Performs script defined in parameter
+ *
+ * @param script
+ * @return
+ */
+ public String runScript(String script, boolean checkEerror) {
+ String result = selenium.getEval(WINDOW_JS_RESOLVER + script);
+ if (checkEerror) {
+ checkJSError();
+ }
+ return result;
+ }
+
+ /**
+ * Checks if JS error occurred. Fails test if yes. This method should be
+ * invoked after each event or any thing which can be a cause of JS error.
+ */
+ public void checkJSError() {
+ String error = selenium.getEval(WINDOW_JS_RESOLVER + "checkError();");
+ if (error != null && !("null".equals(error)) &&
!("".equals(error))) {
+ Assert.fail("Failure by the following Javascript error: " +
error);
+ }
+ }
+
+ /**
+ * Checks if page containing component test has been rendered completely
+ */
+ public void checkPageRendering() {
+ try {
+ String t1 = getTextById("_Selenium_Test_ControlPoint1");
+ String t2 = getTextById("_Selenium_Test_ControlPoint2");
+ if (t1 == null || t2 == null || !"Control1".equals(t1) ||
!"Control2".equals(t2)) {
+ Assert.fail("The page has been not rendered properlly");
+ }
+ } catch (Exception e) {
+ Assert.fail("The page has not been rendered properly due the following
error: " + e);
+ }
+ }
+
+ /**
+ * Waits while AJAX request will be completed
+ *
+ * @param miliseconds -
+ * time to wait
+ */
+ public void waitForAjaxCompletion(int miliseconds) {
+ selenium.waitForCondition(WINDOW_JS_RESOLVER + "done==true",
String.valueOf(miliseconds));
+ runScript("window.done=false");
+ }
+
+ /**
+ * Waits while AJAX request will be completed
+ *
+ * @param miliseconds -
+ * time to wait
+ */
+ public void waitForAjaxCompletion() {
+ waitForAjaxCompletion(ajaxCompletionTime);
+ }
+
+ /**
+ * Waits while simple request will be completed
+ *
+ * @param miliseconds -
+ * time to wait
+ */
+ public void waitForPageToLoad(int miliseconds) {
+ selenium.waitForPageToLoad(String.valueOf(miliseconds));
+ }
+
+ /**
+ * Waits for condition
+ *
+ * @param condition
+ * @param miliseconds
+ */
+ public void waiteForCondition(String condition, int miliseconds) {
+ selenium.waitForCondition(WINDOW_JS_RESOLVER + condition,
String.valueOf(miliseconds));
+ checkJSError();
+ }
+
+ /**
+ * Waits while simple request will be completed
+ *
+ */
+ public void waitForPageToLoad() {
+ selenium.waitForPageToLoad(String.valueOf(pageRenderTime));
+ }
+
+ /**
+ * Asserts DOM node value equals to value defined
+ *
+ * @param id -
+ * DOM element id
+ * @param value -
+ * value defined
+ */
+ public void AssertValueEquals(String id, String value) {
+ String _v = getValueById(id);
+ Assert.assertEquals(_v, value);
+ }
+
+ /**
+ * Asserts DOM node value equals to value defined
+ *
+ * @param id -
+ * DOM element id
+ * @param value -
+ * value defined
+ * @param message = message to be displayed in failure case
+ */
+ public void AssertValueEquals(String id, String value, String message) {
+ String _v = getValueById(id);
+ Assert.assertEquals(_v, value, message);
+ }
+
+ /**
+ * Asserts DOM node value does not equal to value defined
+ *
+ * @param id -
+ * DOM element id
+ * @param value -
+ * value defined
+ */
+ public void AssertValueNotEquals(String id, String value) {
+ String _v = getValueById(id);
+ Assert.assertNotSame(_v, value);
+ }
+
+
+ /**
+ * Asserts DOM node value does not equal to value defined
+ *
+ * @param id -
+ * DOM element id
+ * @param value -
+ * value defined
+ * @param message = message to be displayed in failure case
+ */
+ public void AssertValueNotEquals(String id, String value, String message) {
+ String _v = getValueById(id);
+ Assert.assertNotSame(_v, value, message);
+ }
+
+
+ /**
+ * Asserts DOM node text equals to text defined
+ *
+ * @param locator -
+ * locator an element locator
+ * @param value -
+ * text defined
+ */
+ public void AssertTextEquals(String locator, String value) {
+ String _v = selenium.getText(locator);
+ Assert.assertEquals(_v, value);
+ }
+
+ /**
+ * Asserts DOM node text equals to text defined
+ *
+ * @param id -
+ * DOM element id
+ * @param value -
+ * text defined
+ * @param message = message to be displayed in failure case
+ */
+ public void AssertTextEquals(String id, String value, String message) {
+ String _v = getTextById(id);
+ Assert.assertEquals(_v, value, message);
+ }
+
+
+ /**
+ * Asserts DOM node text does not equal to text defined
+ *
+ * @param id -
+ * DOM element id
+ * @param value -
+ * text defined
+ */
+ public void AssertTextNotEquals(String id, String value) {
+ String _v = getTextById(id);
+ Assert.assertNotSame(_v, value);
+ }
+
+ /**
+ * Asserts DOM node text does not equal to text defined
+ *
+ * @param id -
+ * DOM element id
+ * @param value -
+ * text defined
+ * @param message = message to be displayed in failure case
+ */
+ public void AssertTextNotEquals(String id, String value, String message) {
+ String _v = getTextById(id);
+ Assert.assertNotSame(_v, value, message);
+ }
+
+ /**
+ * Asserts DOM node is visible
+ *
+ * @param id -
+ * DOM element id
+ */
+ public void AssertVisible(String id) {
+ Assert.assertTrue(isVisibleById(id));
+ }
+
+ /**
+ * Asserts DOM node is not present
+ *
+ * @param id -
+ * DOM element id
+ */
+ public void AssertNotPresent(String id) {
+ Assert.assertFalse(isPresentById(id));
+ }
+
+ /**
+ * Asserts DOM node is not visible
+ *
+ * @param id -
+ * DOM element id
+ */
+ public void AssertNotVisible(String id) {
+ Assert.assertFalse(isVisibleById(id));
+ }
+
+ /**
+ * Asserts DOM node is present
+ *
+ * @param id -
+ * DOM element id
+ */
+ public void AssertPresent(String id) {
+ Assert.assertTrue(isPresentById(id));
+ }
+
+ /**
+ * Asserts DOM node is present
+ * @param id - DOM element id
+ */
+ public void AssertRendered(String id) {
+ if (!isPresentById(id)) {
+ Assert.fail("Component " + id + " should be rendered on page");
+ }
+ }
+
+ /**
+ * Asserts DOM node is not present
+ * @param id - DOM element id
+ */
+ public void AssertNotRendered(String id) {
+ if (isPresentById(id)) {
+ Assert.fail("Component " + id + " should not be rendered on
page");
+ }
+ }
+
+ /**
+ * Returns element's text
+ *
+ * @param id -
+ * DOM element id
+ * @return
+ */
+ public String getTextById(String id) {
+ return selenium.getText("id=" + id);
+ }
+
+ /**
+ * Returns element's value
+ *
+ * @param id -
+ * DOM element id
+ * @return
+ */
+ public String getValueById(String id) {
+ return selenium.getValue("id=" + id);
+ }
+
+ /**
+ * Sets a new value for DOM node with specified id.
+ *
+ * @param id -
+ * DOM element id
+ * @param value -
+ * a new DOM element's value
+ */
+ public void setValueById(String id, String value) {
+
runScript(String.format("document.getElementById('%1$s').value='%2$s';",
id, value));
+ }
+
+ /**
+ * Returns element's width
+ *
+ * @param id -
+ * DOM element id
+ * @return
+ */
+ public Number getWidthById(String id) {
+ return selenium.getElementWidth("id=" + id);
+ }
+
+ /**
+ * Returns element's height
+ *
+ * @param id -
+ * DOM element id
+ * @return
+ */
+ public Number getHeightById(String id) {
+ return selenium.getElementHeight("id=" + id);
+ }
+
+ /**
+ * Clicks on element
+ *
+ * @param id -
+ * DOM element id
+ * @return
+ */
+ public void clickById(String id) {
+ selenium.click("id=" + id);
+ checkJSError();
+ }
+
+ /**
+ * Clicks an ajax command and wait for ajax request completion.
+ * @param locator an element locator
+ */
+ public void clickAjaxCommandAndWait(String locator) {
+ selenium.click(locator);
+ waitForAjaxCompletion();
+ }
+
+ /**
+ * This method should be used for click on command controls instead of
+ * 'clickById' method.
+ *
+ * @param commandId
+ */
+ public void clickCommandAndWait(String commandId) {
+ selenium.click("id=" + commandId);
+ waitForPageToLoad();
+ }
+
+ /**
+ * Return true if element is visible
+ *
+ * @param id -
+ * DOM element id
+ * @return
+ */
+ public boolean isVisibleById(String id) {
+ return selenium.isVisible("id=" + id);
+ }
+
+ /**
+ * Returns true if element with given id is present.
+ *
+ * @param id -
+ * DOM element id
+ * @return true if element with given id is present, otherwise - false
+ */
+ public boolean isPresentById(String id) {
+ return selenium.isElementPresent("id=" + id);
+ }
+
+ /**
+ * Invokes JS method on client.
+ *
+ * @param id -
+ * DOM id of component
+ * @param method -
+ * string method name
+ * @param parameters -
+ * parameters
+ * @return
+ */
+ public String invokeFromComponent(String id, String method, Object parameters) {
+ String _return = null;
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("$('");
+ buffer.append(id);
+ buffer.append("').component.");
+ buffer.append(method);
+ buffer.append("(");
+ buffer.append(ScriptUtils.toScript(parameters));
+ buffer.append(");");
+ _return = runScript(buffer.toString());
+ return _return;
+ }
+
+ /**
+ * Creates delay
+ *
+ * @param miliSeconds
+ * @throws InterruptedException
+ */
+ public void delay(int miliSeconds) {
+ try {
+ Thread.sleep(miliSeconds);
+ } catch (Exception e) {
+
+ }
+ }
+
+ /**
+ * Creates pause for defined time in miliSeconds
+ *
+ * @param miliSeconds
+ */
+ public void pause(int miliSeconds, String id) {
+ StringBuffer script = new StringBuffer("pause(");
+ script.append(miliSeconds);
+ script.append(",'");
+ script.append(id);
+ script.append("');");
+ runScript(script.toString());
+ selenium.waitForCondition(WINDOW_JS_RESOLVER + "pauseHolder['" + id
+ "'] == true;", String
+ .valueOf(miliSeconds + 1000));
+ }
+
+ /**
+ * @return the parentId
+ */
+ public String getParentId() {
+ return parentId;
+ }
+
+ /**
+ * @param parentId
+ * the parentId to set
+ */
+ public void setParentId(String parentId) {
+ this.parentId = parentId;
+ }
+
+ /**
+ * Workaround for selenium.type/selenium.typeKeys
+ * @param locator
+ * @param string
+ */
+ public void type(String locator, String string) {
+ selenium.type(locator, "");
+ StringBuffer value = new StringBuffer(selenium.getValue(locator));
+ char[] chars = string.toCharArray();
+ for (int i = 0; i < chars.length; i++) {
+ String key = Character.toString(chars[i]);
+ value.append(key);
+
+ selenium.keyDown(locator, key);
+
+ if(!isFF()) {
+ selenium.type(locator, value.toString());
+ }
+
+ selenium.keyPress(locator, key);
+ selenium.keyUp(locator, key);
+
+ }
+ }
+
+ public void testOnclickEvent(String testElementId, String testElementResultId, String
beforeResult, String afterResult) {
+ writeStatus("Testing onclick event");
+ AssertTextEquals(testElementResultId, beforeResult);
+ selenium.click(testElementId);
+ AssertTextEquals(testElementResultId, afterResult);
+ }
+
+ public void testOnDblclickEvent(String testElementId, String testElementResultId,
String beforeResult, String afterResult) {
+ writeStatus("Testing ondblclick event");
+ AssertTextEquals(testElementResultId, beforeResult);
+ selenium.doubleClick(testElementId);
+ AssertTextEquals(testElementResultId, afterResult);
+ }
+
+ public void testOnfocusEvent(String testElementId, String testElementResultId, String
beforeResult, String afterResult) {
+ writeStatus("Testing onfocus event");
+ AssertTextEquals(testElementResultId, beforeResult);
+ selenium.focus(testElementId);
+ AssertTextEquals(testElementResultId, afterResult);
+ }
+
+ public void testOnkeydownEvent(String testElementId, String testElementResultId,
String beforeResult, String afterResult) {
+ writeStatus("Testing onkeydown event");
+ AssertTextEquals(testElementResultId, beforeResult);
+ selenium.keyDown(testElementId, "1");
+ AssertTextEquals(testElementResultId, afterResult);
+ }
+
+ public void testOnkeypressEvent(String testElementId, String testElementResultId,
String beforeResult, String afterResult) {
+ writeStatus("Testing onkeypress event");
+ AssertTextEquals(testElementResultId, beforeResult);
+ selenium.keyPress(testElementId, "1");
+ AssertTextEquals(testElementResultId, afterResult);
+ }
+
+ public void testOnkeyupEvent(String testElementId, String testElementResultId, String
beforeResult, String afterResult) {
+ writeStatus("Testing onkeyup event");
+ AssertTextEquals(testElementResultId, beforeResult);
+ selenium.keyUp(testElementId, "1");
+ AssertTextEquals(testElementResultId, afterResult);
+ }
+
+ public void testOnmousedownEvent(String testElementId, String testElementResultId,
String beforeResult, String afterResult) {
+ writeStatus("Testing onmousedown event");
+ AssertTextEquals(testElementResultId, beforeResult);
+ selenium.mouseDown(testElementId);
+ AssertTextEquals(testElementResultId, afterResult);
+ }
+
+ public void testOnmousemoveEvent(String testElementId, String testElementResultId,
String beforeResult, String afterResult) {
+ writeStatus("Testing onmousemove event");
+ AssertTextEquals(testElementResultId, beforeResult);
+ selenium.mouseMove(testElementId);
+ AssertTextEquals(testElementResultId, afterResult);
+ }
+
+ public void testOnmouseoutEvent(String testElementId, String testElementResultId,
String beforeResult, String afterResult) {
+ writeStatus("Testing onmouseout event");
+ AssertTextEquals(testElementResultId, beforeResult);
+ selenium.mouseOut(testElementId);
+ AssertTextEquals(testElementResultId, afterResult);
+ }
+
+ public void testOnmouseoverEvent(String testElementId, String testElementResultId,
String beforeResult, String afterResult) {
+ writeStatus("Testing onmouseover event");
+ AssertTextEquals(testElementResultId, beforeResult);
+ selenium.mouseOver(testElementId);
+ AssertTextEquals(testElementResultId, afterResult);
+ }
+
+ public void testOnmouseupEvent(String testElementId, String testElementResultId,
String beforeResult, String afterResult) {
+ writeStatus("Testing onmouseup event");
+ AssertTextEquals(testElementResultId, beforeResult);
+ selenium.mouseUp(testElementId);
+ AssertTextEquals(testElementResultId, afterResult);
+ }
+
+ /**
+ * Method to assert element style attribute with expected
+ * @param elementId - tested element id
+ * @param expectedExpression - expected style attribute
+ */
+ public void assertStyleAttribute(String elementId, String expectedExpression) {
+ String styleAttribute = selenium.getAttribute("//*[@id='" + elementId +
"']/@style");
+ if (!styleAttribute.toLowerCase().contains(expectedExpression.toLowerCase())) {
+ Assert.fail("Element '" + elementId + "' with style
'" + styleAttribute + "' doesn't contain '" +
expectedExpression + "'");
+ }
+ }
+
+ /**
+ * Asserts that expected columns count equals actual one.
+ * @param i the expected columns count
+ * @param tableId id of table to be checked
+ */
+ public void assertColumnsCount(int i, String tableId) {
+ StringBuffer script = new StringBuffer("$('");
+ script.append(tableId);
+ script.append("').rows[0].cells.length");
+
+ String count = runScript(script.toString());
+ Assert.assertEquals(count, String.valueOf(i));
+ }
+
+ /**
+ * Asserts that expected rows count equals actual one.
+ * @param i the expected rows count
+ * @param tableId id of table to be checked
+ */
+ public void assertRowsCount(int i, String tableId) {
+ int count = selenium.getXpathCount("//table[@id='" + tableId +
"']/tbody/tr").intValue();
+ Assert.assertEquals(count, i);
+ }
+
+ /**
+ * Checks whether client is FireFox
+ *
+ * @return true if client is FireFox
+ */
+ public boolean isFF() {
+ return new
Boolean(selenium.getEval("navigator.userAgent.indexOf('Firefox') >
-1"));
+ }
+
+ /**
+ * Returns the url to test page to be opened by selenium
+ *
+ * @return
+ */
+ public abstract String getTestUrl();
+
+ /**
+ * Simulates mouse event for element
+ * @param id - Element ID
+ * @param eventName - Mouse event Name
+ * @param x - X mouse position
+ * @param y - Y mouse position
+ * @return - Event
+ */
+ public String fireMouseEvent(String id, String eventName, int x, int y, boolean ctrl)
{
+ return runScript("fireMouseEvent('" + id + "','" +
eventName + "', "
+ + x + "," + y + ","+ctrl+");");
+ }
+}
Added:
trunk/test-applications/regressionArea/Seam-web/src/test/java/org/richfaces/TestAnnotationTransformer.java
===================================================================
---
trunk/test-applications/regressionArea/Seam-web/src/test/java/org/richfaces/TestAnnotationTransformer.java
(rev 0)
+++
trunk/test-applications/regressionArea/Seam-web/src/test/java/org/richfaces/TestAnnotationTransformer.java 2008-09-18
17:11:35 UTC (rev 10499)
@@ -0,0 +1,28 @@
+package org.richfaces;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+
+import org.testng.internal.annotations.IAnnotationTransformer;
+import org.testng.internal.annotations.ITest;
+import org.testng.internal.annotations.TestAnnotation;
+
+/**
+ * This transformer sets necessary data provider for each test method.
+ *
+ * @author carcasser
+ */
+public class TestAnnotationTransformer implements IAnnotationTransformer {
+
+ /**
+ * @see IAnnotationTransformer#transform(ITest, Class, Constructor, Method)
+ */
+ public void transform(ITest annotation, Class testClass, Constructor testConstructor,
Method testMethod) {
+
+ if ((testClass == null || RichSeleniumTest.class.isAssignableFrom(testClass))
+ && (annotation instanceof TestAnnotation)) {
+ ((TestAnnotation) annotation).setDataProvider("templates");
+ }
+ }
+
+}
\ No newline at end of file
Added:
trunk/test-applications/regressionArea/Seam-web/src/test/java/org/richfaces/testng/SimpleTest.java
===================================================================
---
trunk/test-applications/regressionArea/Seam-web/src/test/java/org/richfaces/testng/SimpleTest.java
(rev 0)
+++
trunk/test-applications/regressionArea/Seam-web/src/test/java/org/richfaces/testng/SimpleTest.java 2008-09-18
17:11:35 UTC (rev 10499)
@@ -0,0 +1,22 @@
+package org.richfaces.testng;
+
+import org.ajax4jsf.template.Template;
+import org.richfaces.SeleniumTestBase;
+import org.testng.annotations.Test;
+
+public class SimpleTest extends SeleniumTestBase{
+
+ @Test
+ public void testAjaxActionParameterComponent(Template template) {
+ renderPage(template);
+ String parentId = getParentId();
+
+ }
+
+
+ @Override
+ public String getTestUrl() {
+ return "pages/home.xhtml";
+ }
+
+}
Added: trunk/test-applications/regressionArea/Seam-web/src/test/resources/testng.xml
===================================================================
--- trunk/test-applications/regressionArea/Seam-web/src/test/resources/testng.xml
(rev 0)
+++
trunk/test-applications/regressionArea/Seam-web/src/test/resources/testng.xml 2008-09-18
17:11:35 UTC (rev 10499)
@@ -0,0 +1,21 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="seleniumTestDANe">
+ <!--test name="IEFunctionalTests">
+ <parameter name="browser" value="*iexplore"/>
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/NEKO/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test-->
+ <test name="FireFoxFunctionalTestsDANe">
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/NEKO/"/>
+ <parameter name="browser" value="*firefox"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+</suite>
Modified: trunk/test-applications/regressionArea/pom.xml
===================================================================
--- trunk/test-applications/regressionArea/pom.xml 2008-09-18 15:46:01 UTC (rev 10498)
+++ trunk/test-applications/regressionArea/pom.xml 2008-09-18 17:11:35 UTC (rev 10499)
@@ -22,7 +22,8 @@
</repository>
</repositories>
-
+
+
<modules>
<module>Seam-ejb</module>
<module>Seam-web</module>