Seam SVN: r15589 - in branches/enterprise/WFK-2_1: bom and 1 other directory.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2013-09-20 12:54:22 -0400 (Fri, 20 Sep 2013)
New Revision: 15589
Modified:
branches/enterprise/WFK-2_1/bom/pom.xml
branches/enterprise/WFK-2_1/pom.xml
Log:
switched from JDF BOMs to plain deps and managed jgroups upgrade https://issues.jboss.org/browse/WFK2-162
Modified: branches/enterprise/WFK-2_1/bom/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/bom/pom.xml 2013-09-13 14:11:17 UTC (rev 15588)
+++ branches/enterprise/WFK-2_1/bom/pom.xml 2013-09-20 16:54:22 UTC (rev 15589)
@@ -36,12 +36,32 @@
<version.drools>5.3.0.BRMS</version.drools>
<version.resteasy>2.3.6.Final-redhat-1</version.resteasy>
<version.spring>3.1.4.RELEASE</version.spring>
- <version.jsf2>2.1.19-redhat-1</version.jsf2>
- <!-- <version.webdriver>0.9.7376</version.webdriver> -->
- <version.infinispan>5.2.6.Final-redhat-1</version.infinispan>
+ <version.richfaces>4.3.2.Final-redhat-1</version.richfaces>
+ <version.org.slf4j>1.7.2-redhat-1</version.org.slf4j>
+
+ <version.org.jboss.spec.jboss.javaee.6.0>3.0.2.Final-redhat-3</version.org.jboss.spec.jboss.javaee.6.0>
+
+ <!-- hibernate version properties -->
+ <version.org.hibernate>4.2.0.SP1-redhat-1</version.org.hibernate>
+ <version.org.hibernate.common>4.0.1.Final-redhat-2</version.org.hibernate.common>
+ <version.org.hibernate.javax.persistence>1.0.1.Final-redhat-2</version.org.hibernate.javax.persistence>
+ <version.org.hibernate.search>4.3.0.Final-redhat-wfk-3</version.org.hibernate.search>
+ <version.org.hibernate.validator>4.3.1.Final-redhat-1</version.org.hibernate.validator>
+
+ <version.infinispan>5.2.7.Final-redhat-1</version.infinispan>
+ <version.org.jgroups>3.2.10.Final-redhat-2</version.org.jgroups>
+ <version.slf4j>1.7.2-redhat-1</version.slf4j>
+ <!-- Test frameworks -->
<version.junit>4.10</version.junit>
- <version.testng>5.14.10</version.testng>
- <version.org.jboss.bom>1.0.4.Final-redhat-wfk-3</version.org.jboss.bom>
+ <version.org.testng>5.14.10</version.org.testng>
+
+ <!-- Versions of Arquillian and Shrinkwrap -->
+ <version.org.jboss.arquillian>1.1.0.Final</version.org.jboss.arquillian>
+ <version.org.jboss.arquillian.extension.drone>1.1.1.Final</version.org.jboss.arquillian.extension.drone>
+ <version.org.jboss.arquillian.graphene>1.0.0.Final</version.org.jboss.arquillian.graphene>
+ <version.org.jboss.as.arquillian.container>7.2.0.Final</version.org.jboss.as.arquillian.container>
+ <version.org.jboss.shrinkwrap.resolver>2.0.0</version.org.jboss.shrinkwrap.resolver>
+
<!-- ***************** -->
<!-- Repository Deployment URLs -->
<!-- ***************** -->
@@ -55,27 +75,169 @@
that versions are only specified here, not in sub project poms. All dependencies
for all modules should be listed out here -->
<dependencies>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${version.org.slf4j}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.spec</groupId>
+ <artifactId>jboss-javaee-6.0</artifactId>
+ <version>${version.org.jboss.spec.jboss.javaee.6.0}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
- <dependency>
- <groupId>org.jboss.bom</groupId>
- <artifactId>jboss-javaee-6.0-with-hibernate</artifactId>
- <version>${version.org.jboss.bom}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
+ <!-- Hibernate ORM sub-modules -->
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <version>${version.org.hibernate}</version>
+ <!-- this already part of JDK6 -->
+ <exclusions>
+ <exclusion>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ <version>${version.org.hibernate}</version>
+
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-envers</artifactId>
+ <version>${version.org.hibernate}</version>
+ </dependency>
- <dependency>
- <groupId>org.jboss.bom</groupId>
- <artifactId>jboss-javaee-6.0-with-tools</artifactId>
- <version>${version.org.jboss.bom}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <version>${version.org.hibernate.validator}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-search</artifactId>
+ <version>${version.org.hibernate.search}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-search-analyzers</artifactId>
+ <version>${version.org.hibernate.search}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-search-engine</artifactId>
+ <version>${version.org.hibernate.search}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-search-infinispan</artifactId>
+ <version>${version.org.hibernate.search}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-search-orm</artifactId>
+ <version>${version.org.hibernate.search}</version>
+ </dependency>
+
+ <!-- Shrinkwrap resolver -->
+ <dependency>
+ <groupId>org.jboss.shrinkwrap.resolver</groupId>
+ <artifactId>shrinkwrap-resolver-bom</artifactId>
+ <version>${version.org.jboss.shrinkwrap.resolver}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+ <!-- Arquillian lets test you your applications in real environment -->
+ <dependency>
+ <groupId>org.jboss.arquillian</groupId>
+ <artifactId>arquillian-bom</artifactId>
+ <version>${version.org.jboss.arquillian}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+ <!-- Arquillian Drone adds support for visual testing of your
+ application -->
+ <dependency>
+ <groupId>org.jboss.arquillian.extension</groupId>
+ <artifactId>arquillian-drone-bom</artifactId>
+ <version>${version.org.jboss.arquillian.extension.drone}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+ <!-- Arquillian Drone bindings for DefaultSelenium based browsers -->
+ <dependency>
+ <groupId>org.jboss.arquillian.extension</groupId>
+ <artifactId>arquillian-drone-selenium-depchain</artifactId>
+ <version>${version.org.jboss.arquillian.extension.drone}</version>
+ <type>pom</type>
+ </dependency>
+
+ <!-- Arquillian Drone bindings for WebDriver based browsers -->
+ <dependency>
+ <groupId>org.jboss.arquillian.extension</groupId>
+ <artifactId>arquillian-drone-webdriver-depchain</artifactId>
+ <version>${version.org.jboss.arquillian.extension.drone}</version>
+ <type>pom</type>
+ </dependency>
+
+ <!-- Arquillian Graphene is an enhanced tool based on Selenium
+ allowing you to test AJAX more easily -->
+ <dependency>
+ <groupId>org.jboss.arquillian.graphene</groupId>
+ <artifactId>arquillian-graphene</artifactId>
+ <version>${version.org.jboss.arquillian.graphene}</version>
+ <type>pom</type>
+ </dependency>
+
+ <!-- Arquillian support for JBoss AS7 container -->
+ <!-- Note: Managed version of container allows Arquillian to
+ control startup and shutdown of the container -->
+ <dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-arquillian-container-managed</artifactId>
+ <version>${version.org.jboss.as.arquillian.container}</version>
+ </dependency>
+
+ <!-- Arquillian support for JBoss AS7 container -->
+ <!-- Note: Remote version of container allows Arquillian to connect
+ to already running container -->
+ <dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-arquillian-container-remote</artifactId>
+ <version>${version.org.jboss.as.arquillian.container}</version>
+ </dependency>
+
+ <!-- Recommended JUnit version -->
+ <!-- Note that JUnit is preferred framework -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${version.junit}</version>
+ </dependency>
+
+ <!-- Recommended TestNG version -->
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>${version.org.testng}</version>
+ </dependency>
+
<dependency>
- <groupId>org.jboss.bom</groupId>
- <artifactId>jboss-javaee-6.0-with-richfaces</artifactId>
- <version>${version.org.jboss.bom}</version>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-bom</artifactId>
+ <version>${version.richfaces}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@@ -783,30 +945,6 @@
</dependency>
<dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <version>${version.testng}</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${version.junit}</version>
- </dependency>
-
- <dependency>
- <groupId>org.seleniumhq.selenium</groupId>
- <artifactId>selenium-server</artifactId>
- <version>2.25.0</version>
- </dependency>
-
- <dependency>
- <groupId>org.seleniumhq.selenium</groupId>
- <artifactId>selenium-java</artifactId>
- <version>2.25.0</version>
- </dependency>
-
- <dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>functional-tests</artifactId>
<version>${version.seam}</version>
@@ -837,11 +975,11 @@
</exclusions>
</dependency>
- <dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- <version>${version.jsf2}</version>
- </dependency>
+ <dependency>
+ <groupId>org.jgroups</groupId>
+ <artifactId>jgroups</artifactId>
+ <version>${version.org.jgroups}</version>
+ </dependency>
<dependency>
<groupId>org.infinispan</groupId>
Modified: branches/enterprise/WFK-2_1/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/pom.xml 2013-09-13 14:11:17 UTC (rev 15588)
+++ branches/enterprise/WFK-2_1/pom.xml 2013-09-20 16:54:22 UTC (rev 15589)
@@ -46,13 +46,11 @@
<!-- Version string properties -->
<version.seam>2.3.2.Final-redhat-1</version.seam>
- <version.testng>5.14.10</version.testng>
<version.jacoco>0.5.8.201207111220</version.jacoco>
- <version.jbossas7>7.2.0.Final</version.jbossas7>
+ <version.jbossas7>7.2.1.Final-redhat-10</version.jbossas7>
+ <version.arquillian-jbossas7-container>7.2.0.Final</version.arquillian-jbossas7-container>
<version.emma>2.0.5312</version.emma>
- <version.junit>4.8.2</version.junit>
<version.richfaces.cdk>4.3.1.Final-redhat-2</version.richfaces.cdk>
- <version.slf4j>1.6.1</version.slf4j>
<!-- ***************** -->
<!-- Repository Deployment URLs -->
@@ -76,15 +74,7 @@
<scope>import</scope>
</dependency>
- <!-- thirdparty dependencies -->
<dependency>
- <groupId>antlr</groupId>
- <artifactId>antlr</artifactId>
- <version>2.7.6</version>
- </dependency>
-
-
- <dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.7.0</version>
@@ -105,52 +95,22 @@
<dependency>
<groupId>emma</groupId>
<artifactId>emma</artifactId>
- <version>2.0.5312</version>
+ <version>${version.emma}</version>
</dependency>
-
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <version>${version.testng}</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${version.junit}</version>
- </dependency>
<dependency>
- <groupId>org.seleniumhq.selenium</groupId>
- <artifactId>selenium-server</artifactId>
- <version>2.21.0</version>
- </dependency>
-
- <dependency>
- <groupId>org.seleniumhq.selenium</groupId>
- <artifactId>selenium-java</artifactId>
- <version>2.21.0</version>
- </dependency>
-
- <dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-arquillian-container-managed</artifactId>
- <version>${version.jbossas7}</version>
+ <version>${version.arquillian-jbossas7-container}</version>
</dependency>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-arquillian-container-remote</artifactId>
- <version>${version.jbossas7}</version>
+ <version>${version.arquillian-jbossas7-container}</version>
</dependency>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>${version.slf4j}</version>
- </dependency>
-
- <dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.2.5-redhat-5</version>
11 years, 2 months
[seam2/jboss-seam] aec331: examples quickstartification and ftest graphene mi...
by GitHub
Branch: refs/heads/Seam_2_3
Home: https://github.com/seam2/jboss-seam
Commit: aec331dbf4b94401603213fb28b0979630cf7156
https://github.com/seam2/jboss-seam/commit/aec331dbf4b94401603213fb28b097...
Author: Marek Schmidt <maschmid(a)redhat.com>
Date: 2013-09-12 (Thu, 12 Sep 2013)
Changed paths:
R examples/blog/blog-tests/pom.xml
M examples/booking/booking-ftest/src/test/resources/ftest.properties
R examples/booking/booking-tests/pom.xml
R examples/contactlist/contactlist-tests/pom.xml
M examples/drools/drools-ear/pom.xml
M examples/drools/drools-ejb/pom.xml
A examples/drools/drools-ejb/src/test/java/org/jboss/seam/example/numberguess/test/DroolsNumberGuessTest.java
A examples/drools/drools-ejb/src/test/resources/arquillian.xml
A examples/drools/drools-ejb/src/test/resources/components.xml
A examples/drools/drools-ejb/src/test/resources/jboss-deployment-structure.xml
A examples/drools/drools-ejb/src/test/resources/pageflow.jpdl.xml
A examples/drools/drools-ejb/src/test/resources/web.xml
A examples/drools/drools-ftest/pom.xml
A examples/drools/drools-ftest/src/test/resources/arquillian.xml
A examples/drools/drools-ftest/src/test/resources/ftest.properties
R examples/drools/drools-tests/pom.xml
R examples/drools/drools-tests/src/test/java/org/jboss/seam/example/numberguess/test/DroolsNumberGuessTest.java
R examples/drools/drools-tests/src/test/resources-ftest/testng.xml
R examples/drools/drools-tests/src/test/resources-integration/arquillian.xml
R examples/drools/drools-tests/src/test/resources-integration/web.xml
R examples/drools/drools-tests/src/test/resources/drools.properties
M examples/drools/drools-web/pom.xml
M examples/drools/pom.xml
M examples/dvdstore/dvdstore-ear/pom.xml
M examples/dvdstore/dvdstore-ejb/pom.xml
A examples/dvdstore/dvdstore-ejb/src/test/java/com/jboss/dvd/seam/test/BestSellersTest.java
A examples/dvdstore/dvdstore-ejb/src/test/java/com/jboss/dvd/seam/test/Deployments.java
A examples/dvdstore/dvdstore-ejb/src/test/java/com/jboss/dvd/seam/test/OrderTest.java
A examples/dvdstore/dvdstore-ejb/src/test/java/com/jboss/dvd/seam/test/ProductUnitTest.java
A examples/dvdstore/dvdstore-ejb/src/test/java/com/jboss/dvd/seam/test/SearchTest.java
A examples/dvdstore/dvdstore-ejb/src/test/java/com/jboss/dvd/seam/test/StoreManagerTest.java
A examples/dvdstore/dvdstore-ejb/src/test/resources/arquillian.xml
A examples/dvdstore/dvdstore-ejb/src/test/resources/components.xml
A examples/dvdstore/dvdstore-ejb/src/test/resources/jboss-deployment-structure.xml
A examples/dvdstore/dvdstore-ejb/src/test/resources/jboss-seam-dvdstore-ds.xml
A examples/dvdstore/dvdstore-ejb/src/test/resources/pages.xml
A examples/dvdstore/dvdstore-ejb/src/test/resources/persistence.xml
A examples/dvdstore/dvdstore-ejb/src/test/resources/web.xml
A examples/dvdstore/dvdstore-ftest/pom.xml
A examples/dvdstore/dvdstore-ftest/src/test/java/org/jboss/seam/example/dvd/test/graphene/GrapheneDvdTest.java
A examples/dvdstore/dvdstore-ftest/src/test/java/org/jboss/seam/example/dvd/test/graphene/LoginTest.java
A examples/dvdstore/dvdstore-ftest/src/test/java/org/jboss/seam/example/dvd/test/graphene/Person.java
A examples/dvdstore/dvdstore-ftest/src/test/java/org/jboss/seam/example/dvd/test/graphene/RegistrationTest.java
A examples/dvdstore/dvdstore-ftest/src/test/java/org/jboss/seam/example/dvd/test/graphene/SearchTest.java
A examples/dvdstore/dvdstore-ftest/src/test/java/org/jboss/seam/example/dvd/test/graphene/ShoppingCartTest.java
A examples/dvdstore/dvdstore-ftest/src/test/resources/arquillian.xml
A examples/dvdstore/dvdstore-ftest/src/test/resources/ftest.properties
R examples/dvdstore/dvdstore-tests/pom.xml
R examples/dvdstore/dvdstore-tests/src/main/webapp/WEB-INF/components.xml
R examples/dvdstore/dvdstore-tests/src/main/webapp/WEB-INF/web.xml
R examples/dvdstore/dvdstore-tests/src/test/java/com/jboss/dvd/seam/test/BestSellersTest.java
R examples/dvdstore/dvdstore-tests/src/test/java/com/jboss/dvd/seam/test/OrderTest.java
R examples/dvdstore/dvdstore-tests/src/test/java/com/jboss/dvd/seam/test/ProductUnitTest.java
R examples/dvdstore/dvdstore-tests/src/test/java/com/jboss/dvd/seam/test/SearchTest.java
R examples/dvdstore/dvdstore-tests/src/test/java/com/jboss/dvd/seam/test/StoreManagerTest.java
R examples/dvdstore/dvdstore-tests/src/test/java/org/jboss/seam/example/dvd/test/selenium/LoginTest.java
R examples/dvdstore/dvdstore-tests/src/test/java/org/jboss/seam/example/dvd/test/selenium/Person.java
R examples/dvdstore/dvdstore-tests/src/test/java/org/jboss/seam/example/dvd/test/selenium/RegistrationTest.java
R examples/dvdstore/dvdstore-tests/src/test/java/org/jboss/seam/example/dvd/test/selenium/SearchTest.java
R examples/dvdstore/dvdstore-tests/src/test/java/org/jboss/seam/example/dvd/test/selenium/SeleniumDvdTest.java
R examples/dvdstore/dvdstore-tests/src/test/java/org/jboss/seam/example/dvd/test/selenium/ShoppingCartTest.java
R examples/dvdstore/dvdstore-tests/src/test/resources-ftest/testng.xml
R examples/dvdstore/dvdstore-tests/src/test/resources-integration/arquillian.xml
R examples/dvdstore/dvdstore-tests/src/test/resources-integration/web.xml
R examples/dvdstore/dvdstore-tests/src/test/resources/dvd.properties
M examples/dvdstore/dvdstore-web/pom.xml
M examples/dvdstore/pom.xml
R examples/excel/excel-tests/pom.xml
R examples/groovybooking/groovybooking-tests/pom.xml
M examples/guice/guice-ear/pom.xml
M examples/guice/guice-ejb/pom.xml
A examples/guice/guice-ejb/src/test/java/org/jboss/seam/example/guice/test/GuiceTest.java
A examples/guice/guice-ejb/src/test/java/org/jboss/seam/example/guice/test/JuiceTestBar.java
A examples/guice/guice-ejb/src/test/resources/arquillian.xml
A examples/guice/guice-ejb/src/test/resources/components.xml
A examples/guice/guice-ejb/src/test/resources/jboss-deployment-structure.xml
A examples/guice/guice-ejb/src/test/resources/web.xml
A examples/guice/guice-ftest/pom.xml
A examples/guice/guice-ftest/src/test/java/org/jboss/seam/example/guice/test/graphene/GuiceFunctionalTest.java
A examples/guice/guice-ftest/src/test/resources/arquillian.xml
A examples/guice/guice-ftest/src/test/resources/ftest.properties
R examples/guice/guice-tests/pom.xml
R examples/guice/guice-tests/src/test/java/org/jboss/seam/example/guice/test/GuiceTest.java
R examples/guice/guice-tests/src/test/java/org/jboss/seam/example/guice/test/JuiceTestBar.java
R examples/guice/guice-tests/src/test/java/org/jboss/seam/example/guice/test/selenium/GuiceTest.java
R examples/guice/guice-tests/src/test/resources-ftest/testng.xml
R examples/guice/guice-tests/src/test/resources-integration/arquillian.xml
R examples/guice/guice-tests/src/test/resources-integration/web.xml
M examples/guice/guice-web/pom.xml
M examples/guice/pom.xml
R examples/hibernate/hibernate-tests/pom.xml
M examples/icefaces/icefaces-ear/pom.xml
M examples/icefaces/icefaces-ejb/pom.xml
A examples/icefaces/icefaces-ejb/src/test/java/org/jboss/seam/example/booking/test/BookingTest.java
A examples/icefaces/icefaces-ejb/src/test/java/org/jboss/seam/example/booking/test/ChangePasswordTest.java
A examples/icefaces/icefaces-ejb/src/test/java/org/jboss/seam/example/booking/test/Deployments.java
A examples/icefaces/icefaces-ejb/src/test/java/org/jboss/seam/example/booking/test/LoginTest.java
A examples/icefaces/icefaces-ejb/src/test/resources/arquillian.xml
A examples/icefaces/icefaces-ejb/src/test/resources/components.xml
A examples/icefaces/icefaces-ejb/src/test/resources/jboss-deployment-structure.xml
A examples/icefaces/icefaces-ejb/src/test/resources/pages.xml
A examples/icefaces/icefaces-ejb/src/test/resources/persistence.xml
A examples/icefaces/icefaces-ejb/src/test/resources/web.xml
A examples/icefaces/icefaces-ftest/pom.xml
A examples/icefaces/icefaces-ftest/src/test/resources/arquillian.xml
A examples/icefaces/icefaces-ftest/src/test/resources/ftest.properties
R examples/icefaces/icefaces-tests/pom.xml
R examples/icefaces/icefaces-tests/src/test/java/org/jboss/seam/example/booking/test/BookingTest.java
R examples/icefaces/icefaces-tests/src/test/java/org/jboss/seam/example/booking/test/ChangePasswordTest.java
R examples/icefaces/icefaces-tests/src/test/java/org/jboss/seam/example/booking/test/Deployments.java
R examples/icefaces/icefaces-tests/src/test/java/org/jboss/seam/example/booking/test/LoginTest.java
R examples/icefaces/icefaces-tests/src/test/resources-ftest/testng-jboss4.xml
R examples/icefaces/icefaces-tests/src/test/resources-ftest/testng-jboss5.xml
R examples/icefaces/icefaces-tests/src/test/resources-integration/arquillian.xml
R examples/icefaces/icefaces-tests/src/test/resources-integration/web.xml
R examples/icefaces/icefaces-tests/src/test/resources/icefaces.properties
M examples/icefaces/icefaces-web/pom.xml
M examples/icefaces/pom.xml
R examples/itext/itext-tests/pom.xml
R examples/jee6/jee6-tests/pom.xml
R examples/jpa/jpa-tests/pom.xml
R examples/mail/mail-tests/pom.xml
R examples/messages/messages-tests/pom.xml
M examples/metawidget/booking/booking-ear/pom.xml
M examples/metawidget/booking/booking-ejb/pom.xml
A examples/metawidget/booking/booking-ftest/pom.xml
A examples/metawidget/booking/booking-ftest/src/test/resources/arquillian.xml
A examples/metawidget/booking/booking-ftest/src/test/resources/ftest.properties
R examples/metawidget/booking/booking-tests/pom.xml
R examples/metawidget/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/BookingTest.java
R examples/metawidget/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/ChangePasswordTest.java
R examples/metawidget/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/Deployments.java
R examples/metawidget/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/LoginTest.java
R examples/metawidget/booking/booking-tests/src/test/resources-ftest/testng-cluster.xml
R examples/metawidget/booking/booking-tests/src/test/resources-ftest/testng.xml
R examples/metawidget/booking/booking-tests/src/test/resources-integration/arquillian.xml
R examples/metawidget/booking/booking-tests/src/test/resources/metawidget-booking.properties
M examples/metawidget/booking/booking-web/pom.xml
M examples/metawidget/booking/pom.xml
A examples/metawidget/groovybooking/groovybooking-ftest/pom.xml
A examples/metawidget/groovybooking/groovybooking-ftest/src/test/resources/arquillian.xml
A examples/metawidget/groovybooking/groovybooking-ftest/src/test/resources/ftest.properties
R examples/metawidget/groovybooking/groovybooking-tests/pom.xml
R examples/metawidget/groovybooking/groovybooking-tests/src/test/resources-ftest/testng.xml
R examples/metawidget/groovybooking/groovybooking-tests/src/test/resources/metawidget-groovybooking.properties
M examples/metawidget/groovybooking/groovybooking-web/pom.xml
M examples/metawidget/groovybooking/pom.xml
R examples/nestedbooking/nestedbooking-tests/pom.xml
M examples/numberguess/numberguess-ear/pom.xml
M examples/numberguess/numberguess-ejb/pom.xml
A examples/numberguess/numberguess-ejb/src/test/java/org/jboss/seam/example/numberguess/test/NumberGuessTest.java
A examples/numberguess/numberguess-ejb/src/test/resources/arquillian.xml
A examples/numberguess/numberguess-ejb/src/test/resources/cheat.jpdl.xml
A examples/numberguess/numberguess-ejb/src/test/resources/components.xml
A examples/numberguess/numberguess-ejb/src/test/resources/jboss-deployment-structure.xml
A examples/numberguess/numberguess-ejb/src/test/resources/pageflow.jpdl.xml
A examples/numberguess/numberguess-ejb/src/test/resources/pages.xml
A examples/numberguess/numberguess-ejb/src/test/resources/web.xml
A examples/numberguess/numberguess-ftest/pom.xml
A examples/numberguess/numberguess-ftest/src/test/java/org/jboss/seam/example/numberguess/test/graphene/NumberguessFunctionalTest.java
A examples/numberguess/numberguess-ftest/src/test/resources/arquillian.xml
A examples/numberguess/numberguess-ftest/src/test/resources/ftest.properties
R examples/numberguess/numberguess-tests/pom.xml
R examples/numberguess/numberguess-tests/src/test/java/org/jboss/seam/example/numberguess/test/Deployments.java
R examples/numberguess/numberguess-tests/src/test/java/org/jboss/seam/example/numberguess/test/NumberGuessTest.java
R examples/numberguess/numberguess-tests/src/test/java/org/jboss/seam/example/numberguess/test/selenium/NumberGuessTest.java
R examples/numberguess/numberguess-tests/src/test/resources-ftest/testng.xml
R examples/numberguess/numberguess-tests/src/test/resources-integration/arquillian.xml
R examples/numberguess/numberguess-tests/src/test/resources-integration/testng.xml
R examples/numberguess/numberguess-tests/src/test/resources-integration/web.xml
R examples/numberguess/numberguess-tests/src/test/resources/numberguess.properties
R examples/numberguess/numberguess-tests/src/test/resources/seam.properties
M examples/numberguess/numberguess-web/pom.xml
M examples/numberguess/pom.xml
R examples/openid/openid-tests/pom.xml
M examples/pom.xml
R examples/quartz/quartz-tests/pom.xml
R examples/quartz/quartz-tests/src/test/java/org/jboss/seam/example/quartz/test/Deployments.java
R examples/registration/registration-tests/pom.xml
R examples/remoting/chatroom/chatroom-tests/pom.xml
A examples/remoting/gwt/gwt-ftest/pom.xml
A examples/remoting/gwt/gwt-ftest/src/test/java/org/jboss/seam/example/remoting/gwt/test/graphene/GwtFunctionalTest.java
A examples/remoting/gwt/gwt-ftest/src/test/resources/arquillian.xml
R examples/remoting/gwt/gwt-tests/pom.xml
R examples/remoting/gwt/gwt-tests/src/test/java/org/jboss/seam/example/remoting/gwt/test/selenium/GwtTest.java
R examples/remoting/gwt/gwt-tests/src/test/resources-ftest/testng.xml
R examples/remoting/helloworld/helloworld-tests/pom.xml
R examples/restbay/restbay-tests/pom.xml
A examples/rss/rss-ftest/pom.xml
A examples/rss/rss-ftest/src/test/java/org/jboss/seam/example/rss/test/xml/SeamXMLRSSTest.java
A examples/rss/rss-ftest/src/test/resources/arquillian.xml
R examples/rss/rss-tests/pom.xml
R examples/rss/rss-tests/src/test/java/org/jboss/seam/example/rss/test/xml/SeamXMLRSSTest.java
R examples/rss/rss-tests/src/test/resources-ftest/testng.xml
R examples/seambay/seambay-tests/pom.xml
R examples/seamdiscs/seamdiscs-tests/pom.xml
R examples/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/Deployments.java
R examples/seampay/seampay-tests/pom.xml
R examples/seamspace/seamspace-tests/pom.xml
R examples/spring/spring-tests/pom.xml
R examples/tasks/tasks-tests/pom.xml
M examples/todo/pom.xml
M examples/todo/todo-ear/pom.xml
M examples/todo/todo-ejb/pom.xml
A examples/todo/todo-ejb/src/test/java/org/jboss/seam/example/todo/test/TodoTest.java
A examples/todo/todo-ejb/src/test/resources/arquillian.xml
A examples/todo/todo-ejb/src/test/resources/components.xml
A examples/todo/todo-ejb/src/test/resources/jboss-deployment-structure.xml
A examples/todo/todo-ejb/src/test/resources/web.xml
A examples/todo/todo-ftest/pom.xml
A examples/todo/todo-ftest/src/test/java/org/jboss/seam/example/todo/test/graphene/TodoFunctionalTest.java
A examples/todo/todo-ftest/src/test/resources/arquillian.xml
A examples/todo/todo-ftest/src/test/resources/ftest.properties
R examples/todo/todo-tests/pom.xml
R examples/todo/todo-tests/src/test/java/org/jboss/seam/example/todo/test/TodoTest.java
R examples/todo/todo-tests/src/test/java/org/jboss/seam/example/todo/test/selenium/SeleniumTodoTest.java
R examples/todo/todo-tests/src/test/resources-ftest/testng.xml
R examples/todo/todo-tests/src/test/resources-integration/arquillian.xml
R examples/todo/todo-tests/src/test/resources/WEB-INF/components.xml
R examples/todo/todo-tests/src/test/resources/seam.properties
M examples/todo/todo-web/pom.xml
R examples/ui/ui-tests/pom.xml
M examples/wicket/pom.xml
M examples/wicket/wicket-ear/pom.xml
A examples/wicket/wicket-ftest/pom.xml
A examples/wicket/wicket-ftest/src/test/java/org/jboss/seam/example/wicket/test/graphene/WicketSimpleBookingTest.java
A examples/wicket/wicket-ftest/src/test/resources/arquillian.xml
A examples/wicket/wicket-ftest/src/test/resources/ftest.properties
R examples/wicket/wicket-tests/pom.xml
R examples/wicket/wicket-tests/src/test/java/org/jboss/seam/example/wicket/test/selenium/WicketSimpleBookingTest.java
R examples/wicket/wicket-tests/src/test/resources-ftest/testng.xml
R examples/wicket/wicket-tests/src/test/resources/seam.properties
R examples/wicket/wicket-tests/src/test/resources/wicket.properties
M examples/wicket/wicket-web/pom.xml
M functional-tests/src/main/java/org/jboss/seam/example/common/test/SeamGrapheneTest.java
M functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/BookingFunctionalTestBase.java
A functional-tests/src/main/java/org/jboss/seam/example/common/test/numberguess/graphene/CommonNumberguessFunctionalTest.java
Log Message:
-----------
examples quickstartification and ftest graphene migration
11 years, 2 months
Seam SVN: r15588 - in branches/enterprise/WFK-2_1: examples/blog and 274 other directories.
by seam-commits@lists.jboss.org
Author: rsmeral
Date: 2013-09-13 10:11:17 -0400 (Fri, 13 Sep 2013)
New Revision: 15588
Added:
branches/enterprise/WFK-2_1/examples/blog/blog-ftest/
branches/enterprise/WFK-2_1/examples/blog/blog-ftest/pom.xml
branches/enterprise/WFK-2_1/examples/blog/blog-ftest/src/
branches/enterprise/WFK-2_1/examples/blog/blog-ftest/src/test/
branches/enterprise/WFK-2_1/examples/blog/blog-ftest/src/test/java/
branches/enterprise/WFK-2_1/examples/blog/blog-ftest/src/test/java/org/
branches/enterprise/WFK-2_1/examples/blog/blog-ftest/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/blog/blog-ftest/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/blog/blog-ftest/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/blog/blog-ftest/src/test/java/org/jboss/seam/example/blog/
branches/enterprise/WFK-2_1/examples/blog/blog-ftest/src/test/java/org/jboss/seam/example/blog/test/
branches/enterprise/WFK-2_1/examples/blog/blog-ftest/src/test/java/org/jboss/seam/example/blog/test/graphene/
branches/enterprise/WFK-2_1/examples/blog/blog-ftest/src/test/java/org/jboss/seam/example/blog/test/graphene/BlogFunctionalTest.java
branches/enterprise/WFK-2_1/examples/blog/blog-ftest/src/test/resources/
branches/enterprise/WFK-2_1/examples/blog/blog-ftest/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/blog/blog-ftest/src/test/resources/ftest.properties
branches/enterprise/WFK-2_1/examples/booking/booking-ftest/
branches/enterprise/WFK-2_1/examples/booking/booking-ftest/pom.xml
branches/enterprise/WFK-2_1/examples/booking/booking-ftest/src/
branches/enterprise/WFK-2_1/examples/booking/booking-ftest/src/test/
branches/enterprise/WFK-2_1/examples/booking/booking-ftest/src/test/resources/
branches/enterprise/WFK-2_1/examples/booking/booking-ftest/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/booking/booking-ftest/src/test/resources/ftest.properties
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/pom.xml
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/java/
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/java/org/
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/java/org/jboss/seam/example/contactlist/
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/java/org/jboss/seam/example/contactlist/test/
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/java/org/jboss/seam/example/contactlist/test/graphene/
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/java/org/jboss/seam/example/contactlist/test/graphene/CommentTest.java
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/java/org/jboss/seam/example/contactlist/test/graphene/ContactCRUDTest.java
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/java/org/jboss/seam/example/contactlist/test/graphene/ContactlistFunctionalTestBase.java
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/java/org/jboss/seam/example/contactlist/test/graphene/Person.java
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/resources/
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/resources/ftest.properties
branches/enterprise/WFK-2_1/examples/excel/excel-ftest/
branches/enterprise/WFK-2_1/examples/excel/excel-ftest/pom.xml
branches/enterprise/WFK-2_1/examples/excel/excel-ftest/src/
branches/enterprise/WFK-2_1/examples/excel/excel-ftest/src/test/
branches/enterprise/WFK-2_1/examples/excel/excel-ftest/src/test/java/
branches/enterprise/WFK-2_1/examples/excel/excel-ftest/src/test/java/org/
branches/enterprise/WFK-2_1/examples/excel/excel-ftest/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/excel/excel-ftest/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/excel/excel-ftest/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/excel/excel-ftest/src/test/java/org/jboss/seam/example/excel/
branches/enterprise/WFK-2_1/examples/excel/excel-ftest/src/test/java/org/jboss/seam/example/excel/test/
branches/enterprise/WFK-2_1/examples/excel/excel-ftest/src/test/java/org/jboss/seam/example/excel/test/graphene/
branches/enterprise/WFK-2_1/examples/excel/excel-ftest/src/test/java/org/jboss/seam/example/excel/test/graphene/ExcelFunctionalTest.java
branches/enterprise/WFK-2_1/examples/excel/excel-ftest/src/test/resources/
branches/enterprise/WFK-2_1/examples/excel/excel-ftest/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/groovybooking/groovybooking-ftest/
branches/enterprise/WFK-2_1/examples/groovybooking/groovybooking-ftest/pom.xml
branches/enterprise/WFK-2_1/examples/groovybooking/groovybooking-ftest/src/
branches/enterprise/WFK-2_1/examples/groovybooking/groovybooking-ftest/src/test/
branches/enterprise/WFK-2_1/examples/groovybooking/groovybooking-ftest/src/test/resources/
branches/enterprise/WFK-2_1/examples/groovybooking/groovybooking-ftest/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/groovybooking/groovybooking-ftest/src/test/resources/ftest.properties
branches/enterprise/WFK-2_1/examples/hibernate/hibernate-ftest/
branches/enterprise/WFK-2_1/examples/hibernate/hibernate-ftest/pom.xml
branches/enterprise/WFK-2_1/examples/hibernate/hibernate-ftest/src/
branches/enterprise/WFK-2_1/examples/hibernate/hibernate-ftest/src/test/
branches/enterprise/WFK-2_1/examples/hibernate/hibernate-ftest/src/test/resources/
branches/enterprise/WFK-2_1/examples/hibernate/hibernate-ftest/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/hibernate/hibernate-ftest/src/test/resources/ftest.properties
branches/enterprise/WFK-2_1/examples/itext/itext-ftest/
branches/enterprise/WFK-2_1/examples/itext/itext-ftest/pom.xml
branches/enterprise/WFK-2_1/examples/itext/itext-ftest/src/
branches/enterprise/WFK-2_1/examples/itext/itext-ftest/src/test/
branches/enterprise/WFK-2_1/examples/itext/itext-ftest/src/test/java/
branches/enterprise/WFK-2_1/examples/itext/itext-ftest/src/test/java/org/
branches/enterprise/WFK-2_1/examples/itext/itext-ftest/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/itext/itext-ftest/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/itext/itext-ftest/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/itext/itext-ftest/src/test/java/org/jboss/seam/example/itext/
branches/enterprise/WFK-2_1/examples/itext/itext-ftest/src/test/java/org/jboss/seam/example/itext/test/
branches/enterprise/WFK-2_1/examples/itext/itext-ftest/src/test/java/org/jboss/seam/example/itext/test/graphene/
branches/enterprise/WFK-2_1/examples/itext/itext-ftest/src/test/java/org/jboss/seam/example/itext/test/graphene/ItextFunctionalTest.java
branches/enterprise/WFK-2_1/examples/itext/itext-ftest/src/test/resources/
branches/enterprise/WFK-2_1/examples/itext/itext-ftest/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/jee6/jee6-ftest/
branches/enterprise/WFK-2_1/examples/jee6/jee6-ftest/pom.xml
branches/enterprise/WFK-2_1/examples/jee6/jee6-ftest/src/
branches/enterprise/WFK-2_1/examples/jee6/jee6-ftest/src/test/
branches/enterprise/WFK-2_1/examples/jee6/jee6-ftest/src/test/resources/
branches/enterprise/WFK-2_1/examples/jee6/jee6-ftest/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/jee6/jee6-ftest/src/test/resources/ftest.properties
branches/enterprise/WFK-2_1/examples/jpa/jpa-ftest/
branches/enterprise/WFK-2_1/examples/jpa/jpa-ftest/pom.xml
branches/enterprise/WFK-2_1/examples/jpa/jpa-ftest/src/
branches/enterprise/WFK-2_1/examples/jpa/jpa-ftest/src/test/
branches/enterprise/WFK-2_1/examples/jpa/jpa-ftest/src/test/resources/
branches/enterprise/WFK-2_1/examples/jpa/jpa-ftest/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/jpa/jpa-ftest/src/test/resources/ftest.properties
branches/enterprise/WFK-2_1/examples/mail/mail-ftest/
branches/enterprise/WFK-2_1/examples/mail/mail-ftest/pom.xml
branches/enterprise/WFK-2_1/examples/mail/mail-ftest/src/
branches/enterprise/WFK-2_1/examples/mail/mail-ftest/src/test/
branches/enterprise/WFK-2_1/examples/mail/mail-ftest/src/test/java/
branches/enterprise/WFK-2_1/examples/mail/mail-ftest/src/test/java/org/
branches/enterprise/WFK-2_1/examples/mail/mail-ftest/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/mail/mail-ftest/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/mail/mail-ftest/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/mail/mail-ftest/src/test/java/org/jboss/seam/example/mail/
branches/enterprise/WFK-2_1/examples/mail/mail-ftest/src/test/java/org/jboss/seam/example/mail/test/
branches/enterprise/WFK-2_1/examples/mail/mail-ftest/src/test/java/org/jboss/seam/example/mail/test/graphene/
branches/enterprise/WFK-2_1/examples/mail/mail-ftest/src/test/java/org/jboss/seam/example/mail/test/graphene/MailFunctionalTest.java
branches/enterprise/WFK-2_1/examples/mail/mail-ftest/src/test/resources/
branches/enterprise/WFK-2_1/examples/mail/mail-ftest/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/mail/mail-ftest/src/test/resources/ftest.properties
branches/enterprise/WFK-2_1/examples/messages/messages-ftest/
branches/enterprise/WFK-2_1/examples/messages/messages-ftest/pom.xml
branches/enterprise/WFK-2_1/examples/messages/messages-ftest/src/
branches/enterprise/WFK-2_1/examples/messages/messages-ftest/src/test/
branches/enterprise/WFK-2_1/examples/messages/messages-ftest/src/test/java/
branches/enterprise/WFK-2_1/examples/messages/messages-ftest/src/test/java/org/
branches/enterprise/WFK-2_1/examples/messages/messages-ftest/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/messages/messages-ftest/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/messages/messages-ftest/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/messages/messages-ftest/src/test/java/org/jboss/seam/example/messages/
branches/enterprise/WFK-2_1/examples/messages/messages-ftest/src/test/java/org/jboss/seam/example/messages/test/
branches/enterprise/WFK-2_1/examples/messages/messages-ftest/src/test/java/org/jboss/seam/example/messages/test/graphene/
branches/enterprise/WFK-2_1/examples/messages/messages-ftest/src/test/java/org/jboss/seam/example/messages/test/graphene/MessagesFunctionalTest.java
branches/enterprise/WFK-2_1/examples/messages/messages-ftest/src/test/resources/
branches/enterprise/WFK-2_1/examples/messages/messages-ftest/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/messages/messages-ftest/src/test/resources/ftest.properties
branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/
branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/pom.xml
branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/src/
branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/src/test/
branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/src/test/java/
branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/src/test/java/org/
branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/src/test/java/org/jboss/seam/example/nestedbooking/
branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/src/test/java/org/jboss/seam/example/nestedbooking/test/
branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/src/test/java/org/jboss/seam/example/nestedbooking/test/graphene/
branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/src/test/java/org/jboss/seam/example/nestedbooking/test/graphene/NestedConversationTest.java
branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/src/test/java/org/jboss/seam/example/nestedbooking/test/graphene/NestedSimpleBookingTest.java
branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/src/test/resources/
branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/src/test/resources/ftest.properties
branches/enterprise/WFK-2_1/examples/openid/openid-ftest/
branches/enterprise/WFK-2_1/examples/openid/openid-ftest/pom.xml
branches/enterprise/WFK-2_1/examples/openid/openid-ftest/src/
branches/enterprise/WFK-2_1/examples/openid/openid-ftest/src/test/
branches/enterprise/WFK-2_1/examples/openid/openid-ftest/src/test/java/
branches/enterprise/WFK-2_1/examples/openid/openid-ftest/src/test/java/org/
branches/enterprise/WFK-2_1/examples/openid/openid-ftest/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/openid/openid-ftest/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/openid/openid-ftest/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/openid/openid-ftest/src/test/java/org/jboss/seam/example/openid/
branches/enterprise/WFK-2_1/examples/openid/openid-ftest/src/test/java/org/jboss/seam/example/openid/test/
branches/enterprise/WFK-2_1/examples/openid/openid-ftest/src/test/java/org/jboss/seam/example/openid/test/graphene/
branches/enterprise/WFK-2_1/examples/openid/openid-ftest/src/test/java/org/jboss/seam/example/openid/test/graphene/OpenIdFunctionalTest.java
branches/enterprise/WFK-2_1/examples/openid/openid-ftest/src/test/resources/
branches/enterprise/WFK-2_1/examples/openid/openid-ftest/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/openid/openid-ftest/src/test/resources/ftest.properties
branches/enterprise/WFK-2_1/examples/quartz/quartz-ftest/
branches/enterprise/WFK-2_1/examples/quartz/quartz-ftest/pom.xml
branches/enterprise/WFK-2_1/examples/quartz/quartz-ftest/src/
branches/enterprise/WFK-2_1/examples/quartz/quartz-ftest/src/test/
branches/enterprise/WFK-2_1/examples/quartz/quartz-ftest/src/test/java/
branches/enterprise/WFK-2_1/examples/quartz/quartz-ftest/src/test/java/org/
branches/enterprise/WFK-2_1/examples/quartz/quartz-ftest/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/quartz/quartz-ftest/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/quartz/quartz-ftest/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/quartz/quartz-ftest/src/test/java/org/jboss/seam/example/quartz/
branches/enterprise/WFK-2_1/examples/quartz/quartz-ftest/src/test/java/org/jboss/seam/example/quartz/test/
branches/enterprise/WFK-2_1/examples/quartz/quartz-ftest/src/test/java/org/jboss/seam/example/quartz/test/graphene/
branches/enterprise/WFK-2_1/examples/quartz/quartz-ftest/src/test/java/org/jboss/seam/example/quartz/test/graphene/QuartzPaymentTest.java
branches/enterprise/WFK-2_1/examples/quartz/quartz-ftest/src/test/resources/
branches/enterprise/WFK-2_1/examples/quartz/quartz-ftest/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/quartz/quartz-ftest/src/test/resources/ftest.properties
branches/enterprise/WFK-2_1/examples/registration/registration-ftest/
branches/enterprise/WFK-2_1/examples/registration/registration-ftest/pom.xml
branches/enterprise/WFK-2_1/examples/registration/registration-ftest/src/
branches/enterprise/WFK-2_1/examples/registration/registration-ftest/src/test/
branches/enterprise/WFK-2_1/examples/registration/registration-ftest/src/test/java/
branches/enterprise/WFK-2_1/examples/registration/registration-ftest/src/test/java/org/
branches/enterprise/WFK-2_1/examples/registration/registration-ftest/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/registration/registration-ftest/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/registration/registration-ftest/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/registration/registration-ftest/src/test/java/org/jboss/seam/example/registration/
branches/enterprise/WFK-2_1/examples/registration/registration-ftest/src/test/java/org/jboss/seam/example/registration/test/
branches/enterprise/WFK-2_1/examples/registration/registration-ftest/src/test/java/org/jboss/seam/example/registration/test/graphene/
branches/enterprise/WFK-2_1/examples/registration/registration-ftest/src/test/java/org/jboss/seam/example/registration/test/graphene/RegistrationFunctionalTest.java
branches/enterprise/WFK-2_1/examples/registration/registration-ftest/src/test/resources/
branches/enterprise/WFK-2_1/examples/registration/registration-ftest/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/registration/registration-ftest/src/test/resources/ftest.properties
branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/
branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/pom.xml
branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/src/
branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/src/test/
branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/src/test/java/
branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/src/test/java/org/
branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/src/test/java/org/jboss/seam/example/remoting/
branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/src/test/java/org/jboss/seam/example/remoting/chatroom/
branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/src/test/java/org/jboss/seam/example/remoting/chatroom/test/
branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/src/test/java/org/jboss/seam/example/remoting/chatroom/test/graphene/
branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/src/test/java/org/jboss/seam/example/remoting/chatroom/test/graphene/ChatroomFunctionalTest.java
branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/src/test/resources/
branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/src/test/resources/ftest.properties
branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/
branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/pom.xml
branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/src/
branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/src/main/
branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/src/main/resources/
branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/src/test/
branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/src/test/java/
branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/src/test/java/org/
branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/src/test/java/org/jboss/seam/example/remoting/
branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/src/test/java/org/jboss/seam/example/remoting/helloworld/
branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/src/test/java/org/jboss/seam/example/remoting/helloworld/test/
branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/src/test/java/org/jboss/seam/example/remoting/helloworld/test/graphene/
branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/src/test/java/org/jboss/seam/example/remoting/helloworld/test/graphene/HelloworldFunctionalTest.java
branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/src/test/resources/
branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/src/test/resources/ftest.properties
branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/
branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/pom.xml
branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/
branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/
branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/
branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/
branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/
branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/
branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/
branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/BidTest.java
branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/ComplexBidTest.java
branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/RegistrationTest.java
branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/SeamBayFunctionalTestBase.java
branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/SearchTest.java
branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/SellTest.java
branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/WebServicesTest.java
branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/resources/
branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/resources/ftest.properties
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ftest/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ftest/pom.xml
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ftest/src/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ftest/src/test/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ftest/src/test/java/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ftest/src/test/java/org/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ftest/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ftest/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ftest/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ftest/src/test/java/org/jboss/seam/example/seamdiscs/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ftest/src/test/java/org/jboss/seam/example/seamdiscs/test/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ftest/src/test/java/org/jboss/seam/example/seamdiscs/test/graphene/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ftest/src/test/java/org/jboss/seam/example/seamdiscs/test/graphene/SeamDiscsFunctionalTest.java
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ftest/src/test/java/org/jboss/seam/example/seamdiscs/test/graphene/SeamDiscsFunctionalTestBase.java
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ftest/src/test/resources/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ftest/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/seampay/seampay-ftest/
branches/enterprise/WFK-2_1/examples/seampay/seampay-ftest/pom.xml
branches/enterprise/WFK-2_1/examples/seampay/seampay-ftest/src/
branches/enterprise/WFK-2_1/examples/seampay/seampay-ftest/src/test/
branches/enterprise/WFK-2_1/examples/seampay/seampay-ftest/src/test/resources/
branches/enterprise/WFK-2_1/examples/seampay/seampay-ftest/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/seampay/seampay-ftest/src/test/resources/ftest.properties
branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/
branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/pom.xml
branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/
branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/main/
branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/main/resources/
branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/
branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/
branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/
branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/
branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/
branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/
branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/BlogTest.java
branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/FriendRequestTest.java
branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/LoginTest.java
branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/RoleTest.java
branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/SeamSpaceFunctionalTestBase.java
branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/UserTest.java
branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/resources/
branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/resources/ftest.properties
branches/enterprise/WFK-2_1/examples/spring/spring-ftest/
branches/enterprise/WFK-2_1/examples/spring/spring-ftest/pom.xml
branches/enterprise/WFK-2_1/examples/spring/spring-ftest/src/
branches/enterprise/WFK-2_1/examples/spring/spring-ftest/src/test/
branches/enterprise/WFK-2_1/examples/spring/spring-ftest/src/test/java/
branches/enterprise/WFK-2_1/examples/spring/spring-ftest/src/test/java/org/
branches/enterprise/WFK-2_1/examples/spring/spring-ftest/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/spring/spring-ftest/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/spring/spring-ftest/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/spring/spring-ftest/src/test/java/org/jboss/seam/example/spring/
branches/enterprise/WFK-2_1/examples/spring/spring-ftest/src/test/java/org/jboss/seam/example/spring/test/
branches/enterprise/WFK-2_1/examples/spring/spring-ftest/src/test/java/org/jboss/seam/example/spring/test/graphene/
branches/enterprise/WFK-2_1/examples/spring/spring-ftest/src/test/java/org/jboss/seam/example/spring/test/graphene/SpringChangePasswordTest.java
branches/enterprise/WFK-2_1/examples/spring/spring-ftest/src/test/resources/
branches/enterprise/WFK-2_1/examples/spring/spring-ftest/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/spring/spring-ftest/src/test/resources/ftest.properties
branches/enterprise/WFK-2_1/examples/tasks/tasks-ftest/
branches/enterprise/WFK-2_1/examples/tasks/tasks-ftest/pom.xml
branches/enterprise/WFK-2_1/examples/tasks/tasks-ftest/src/
branches/enterprise/WFK-2_1/examples/tasks/tasks-ftest/src/test/
branches/enterprise/WFK-2_1/examples/tasks/tasks-ftest/src/test/java/
branches/enterprise/WFK-2_1/examples/tasks/tasks-ftest/src/test/java/org/
branches/enterprise/WFK-2_1/examples/tasks/tasks-ftest/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/tasks/tasks-ftest/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/tasks/tasks-ftest/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/tasks/tasks-ftest/src/test/java/org/jboss/seam/example/tasks/
branches/enterprise/WFK-2_1/examples/tasks/tasks-ftest/src/test/java/org/jboss/seam/example/tasks/test/
branches/enterprise/WFK-2_1/examples/tasks/tasks-ftest/src/test/java/org/jboss/seam/example/tasks/test/graphene/
branches/enterprise/WFK-2_1/examples/tasks/tasks-ftest/src/test/java/org/jboss/seam/example/tasks/test/graphene/TasksFunctionalTest.java
branches/enterprise/WFK-2_1/examples/tasks/tasks-ftest/src/test/resources/
branches/enterprise/WFK-2_1/examples/tasks/tasks-ftest/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/tasks/tasks-ftest/src/test/resources/ftest.properties
branches/enterprise/WFK-2_1/examples/ui/ui-ftest/
branches/enterprise/WFK-2_1/examples/ui/ui-ftest/pom.xml
branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/
branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/
branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/java/
branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/java/org/
branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/java/org/jboss/seam/example/ui/
branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/java/org/jboss/seam/example/ui/test/
branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/java/org/jboss/seam/example/ui/test/graphene/
branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/java/org/jboss/seam/example/ui/test/graphene/UIFunctionalTest.java
branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/java/org/jboss/seam/example/ui/test/graphene/UIFunctionalTestBase.java
branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/java/org/jboss/seam/example/ui/test/graphene/UIHTMLUnitTest.java
branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/resources/
branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/resources/ftest.properties
branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/DeploymentResolver.java
branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/SeamGrapheneTest.java
branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/
branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/AjaxTest.java
branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/BackButtonTest.java
branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/BookingFunctionalTestBase.java
branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/ChangePasswordTest.java
branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/ConversationTest.java
branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/RegistrationTest.java
branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/SimpleBookingTest.java
branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/seampay/graphene/
branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/seampay/graphene/SeampayFunctionalTest.java
Removed:
branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/cluster/
branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/selenium/
branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/webdriver/
branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/numberguess/
branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/seampay/selenium/
branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/selenium/
branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/webdriver/
branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/xml/
Modified:
branches/enterprise/WFK-2_1/examples/README.html
branches/enterprise/WFK-2_1/examples/README.md
branches/enterprise/WFK-2_1/examples/blog/README.html
branches/enterprise/WFK-2_1/examples/blog/README.md
branches/enterprise/WFK-2_1/examples/booking/README.html
branches/enterprise/WFK-2_1/examples/booking/README.md
branches/enterprise/WFK-2_1/examples/contactlist/README.html
branches/enterprise/WFK-2_1/examples/contactlist/README.md
branches/enterprise/WFK-2_1/examples/excel/README.html
branches/enterprise/WFK-2_1/examples/excel/README.md
branches/enterprise/WFK-2_1/examples/groovybooking/README.html
branches/enterprise/WFK-2_1/examples/groovybooking/README.md
branches/enterprise/WFK-2_1/examples/hibernate/README.html
branches/enterprise/WFK-2_1/examples/hibernate/README.md
branches/enterprise/WFK-2_1/examples/itext/README.html
branches/enterprise/WFK-2_1/examples/itext/README.md
branches/enterprise/WFK-2_1/examples/jee6/README.html
branches/enterprise/WFK-2_1/examples/jee6/README.md
branches/enterprise/WFK-2_1/examples/jpa/README.html
branches/enterprise/WFK-2_1/examples/jpa/README.md
branches/enterprise/WFK-2_1/examples/mail/README.html
branches/enterprise/WFK-2_1/examples/mail/README.md
branches/enterprise/WFK-2_1/examples/messages/README.html
branches/enterprise/WFK-2_1/examples/messages/README.md
branches/enterprise/WFK-2_1/examples/nestedbooking/README.html
branches/enterprise/WFK-2_1/examples/nestedbooking/README.md
branches/enterprise/WFK-2_1/examples/openid/README.html
branches/enterprise/WFK-2_1/examples/openid/README.md
branches/enterprise/WFK-2_1/examples/pom.xml
branches/enterprise/WFK-2_1/examples/quartz/README.html
branches/enterprise/WFK-2_1/examples/quartz/README.md
branches/enterprise/WFK-2_1/examples/registration/README.html
branches/enterprise/WFK-2_1/examples/registration/README.md
branches/enterprise/WFK-2_1/examples/remoting/chatroom/README.html
branches/enterprise/WFK-2_1/examples/remoting/chatroom/README.md
branches/enterprise/WFK-2_1/examples/remoting/helloworld/README.html
branches/enterprise/WFK-2_1/examples/remoting/helloworld/README.md
branches/enterprise/WFK-2_1/examples/seambay/README.html
branches/enterprise/WFK-2_1/examples/seambay/README.md
branches/enterprise/WFK-2_1/examples/seamdiscs/README.html
branches/enterprise/WFK-2_1/examples/seamdiscs/README.md
branches/enterprise/WFK-2_1/examples/seampay/README.html
branches/enterprise/WFK-2_1/examples/seampay/README.md
branches/enterprise/WFK-2_1/examples/seamspace/README.html
branches/enterprise/WFK-2_1/examples/seamspace/README.md
branches/enterprise/WFK-2_1/examples/seamspace/seamspace-web/src/main/webapp/rolemanager.xhtml
branches/enterprise/WFK-2_1/examples/seamspace/seamspace-web/src/main/webapp/usermanager.xhtml
branches/enterprise/WFK-2_1/examples/spring/README.html
branches/enterprise/WFK-2_1/examples/spring/README.md
branches/enterprise/WFK-2_1/examples/tasks/README.html
branches/enterprise/WFK-2_1/examples/tasks/README.md
branches/enterprise/WFK-2_1/examples/ui/README.html
branches/enterprise/WFK-2_1/examples/ui/README.md
branches/enterprise/WFK-2_1/functional-tests/pom.xml
Log:
Graphene ftests + functional-tests module updated
Modified: branches/enterprise/WFK-2_1/examples/README.html
===================================================================
--- branches/enterprise/WFK-2_1/examples/README.html 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/README.html 2013-09-13 14:11:17 UTC (rev 15588)
@@ -1,7 +1,7 @@
<h1>Seam Example EE6 Applications</h1>
<p>This directory contains the Seam example applications, which have all been
-tested on the latest release of JBoss EAP 6.0. Consult the <code>README.md</code> file in each of
+tested on the latest release of JBoss EAP 6.0. Consult the <code>README.md</code> file in each of
the examples to see details.</p>
<p>The name of each example, refered to later as <code>${example.name}</code>, is equivalent to the name of the folder.</p>
@@ -10,7 +10,7 @@
<h2>Deploying and Testing an Example Application</h2>
-<p>These are general instructions for deploying Seam examples. Take a look at the
+<p>These are general instructions for deploying Seam examples. Take a look at the
<code>README.md</code> file in the example to see if there are any specific instructions.</p>
<h3>How to Build and Deploy an Example on EAP 6</h3>
@@ -18,32 +18,32 @@
<ol>
<li><p>Download and unzip JBoss EAP 6</p>
-<pre><code> https://access.redhat.com/downloads
+<pre><code>https://access.redhat.com/downloads
</code></pre></li>
-<li><p>Make sure you have set up WFK and EAP 6 Maven repositories.
+<li><p>Make sure you have set up WFK and EAP 6 Maven repositories.
More details how to do that, you can read in JBoss Web Framework Kit documentation book called Maven
-Repository Guide.</p></li>
+Repository Guide. </p></li>
<li><p>Build the example by running the following command from the Seam
<code>examples/${example.name}</code> directory:</p>
-<pre><code> mvn clean install
+<pre><code>mvn clean install
</code></pre>
-<p><em>NOTE: There is an option to create an “exploded” archive. For this purpose, use <code>-Pexploded</code> maven profile.</em></p></li>
-<li><p>Deploy the example by running the following command from the <code>examples/${example.name}/{example.name}-ear</code>
-directory in case of an EAR packaged example or from <code>examples/${example.name}/{example.name}-war</code>
+<p><em>NOTE: There is an option to create an "exploded" archive. For this purpose, use <code>-Pexploded</code> maven profile.</em></p></li>
+<li><p>Deploy the example by running the following command from the <code>examples/${example.name}/{example.name}-ear</code>
+directory in case of an EAR packaged example or from <code>examples/${example.name}/{example.name}-war</code>
in case of a WAR packaged example:</p>
-<pre><code> mvn jboss-as:deploy
+<pre><code>mvn jboss-as:deploy
</code></pre>
<p>To undeploy the example, run:</p>
-<pre><code> mvn jboss-as:undeploy
+<pre><code>mvn jboss-as:undeploy
</code></pre></li>
<li><p>Point your web browser to:</p>
-<pre><code> http://localhost:8080/seam-${example.name}
+<pre><code>http://localhost:8080/seam-${example.name}
</code></pre>
<p>The context path is set to the final name of the EAR archive.</p>
@@ -51,14 +51,13 @@
<p>However, WAR deployments use a different naming convention for the context
path. If you deploy a WAR example, point your web browser to:</p>
-<pre><code> http://localhost:8080/${example.name}-web
+<pre><code>http://localhost:8080/${example.name}-web
</code></pre>
<p>The WAR examples are:
spring, jpa, hibernate, groovybooking.</p></li>
</ol>
-
<p><em>NOTE: The examples use the H2 default database embedded in JBoss EAP 6.</em></p>
<h3>Running The Integration Tests</h3>
@@ -70,8 +69,8 @@
<h2>Running functional tests on an example</h2>
-<p>The following steps describe executing of functional tests in general.
-Some examples are not covered with functional tests and thus don’t contain
+<p>The following steps describe executing of functional tests in general.
+Some examples are not covered with functional tests and thus don't contain
the <code>${example.name}-ftest</code> folder.</p>
<ul>
@@ -79,8 +78,12 @@
<li>Set <code>JBOSS_HOME</code> environment property, respectively</li>
</ul>
+<p>To run a functional test:</p>
-<p>To run functional tests:</p>
-
<pre><code>mvn clean test -f ${example.name}/${example.name}-ftest/pom.xml
</code></pre>
+
+<p>To run all functional tests:</p>
+
+<pre><code>mvn clean test -Dftest
+</code></pre>
Modified: branches/enterprise/WFK-2_1/examples/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/README.md 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/README.md 2013-09-13 14:11:17 UTC (rev 15588)
@@ -73,6 +73,10 @@
* Start JBoss EAP 6 Server
* Set `JBOSS_HOME` environment property, respectively
-To run functional tests:
+To run a functional test:
- mvn clean test -f ${example.name}/${example.name}-ftest/pom.xml
\ No newline at end of file
+ mvn clean test -f ${example.name}/${example.name}-ftest/pom.xml
+
+To run all functional tests:
+
+ mvn clean test -Dftest
Modified: branches/enterprise/WFK-2_1/examples/blog/README.html
===================================================================
--- branches/enterprise/WFK-2_1/examples/blog/README.html 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/blog/README.html 2013-09-13 14:11:17 UTC (rev 15588)
@@ -10,27 +10,25 @@
<ol>
<li><p>In the example root directory run:</p>
-<pre><code> mvn clean install
+<pre><code>mvn clean install
</code></pre></li>
<li><p>Set JBOSS_HOME environment property.</p></li>
<li><p>In the blog-ear directory run:</p>
-<pre><code> mvn jboss-as:deploy
+<pre><code>mvn jboss-as:deploy
</code></pre></li>
<li><p>Open this URL in a web browser: http://localhost:8080/seam-blog</p></li>
</ol>
-
<h2>Testing the example</h2>
-<p>This example is covered by integration tests. All tests use the following technologies:</p>
+<p>This example is covered by integration and functional tests. All tests use the following technologies:</p>
<ul>
<li><strong>Arquillian</strong> - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,</li>
<li><strong>ShrinkWrap</strong> - to create the test archive (WAR).</li>
</ul>
-
<h3>Integration tests</h3>
<p>Integration tests cover core application logic and reside in the EJB module. In addition to Arquillian and ShrinkWrap, the integration tests also use:</p>
@@ -40,9 +38,8 @@
<li><strong>ShrinkWrap Resolver</strong> - to resolve dependencies of the project for packaging in the test archive.</li>
</ul>
+<p>The tests are executed in Maven's test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-<p>The tests are executed in Maven’s test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-
<pre><code>mvn clean test -Darquillian=jbossas-managed-7
</code></pre>
@@ -53,6 +50,41 @@
<pre><code>mvn clean test -Darquillian=jbossas-remote-7
</code></pre>
+<h3>Functional tests</h3>
+
+<p>Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:</p>
+
+<ul>
+<li><strong>Arquillian Graphene Extension</strong> - an advanced Ajax-capable type-safe Selenium-based browser testing tool,</li>
+<li><strong>Arquillian Drone Extension</strong> - to automatically run and stop browser instances.</li>
+</ul>
+
+<p><em>Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server.</em></p>
+
+<p>Run the functional test on JBoss AS instance with</p>
+
+<pre><code>mvn -f blog-ftest/pom.xml clean test
+</code></pre>
+
+<p>The <code>JBOSS_HOME</code> environment variable must be set and point to a JBoss AS instance directory.</p>
+
+<p>Several variables can be configured:</p>
+
+<ul>
+<li><p>path to an alternative archive for testing</p>
+
+<pre><code>-DtestDeployment=/path/to/archive.ear
+</code></pre></li>
+<li><p>the browser to use for testing</p>
+
+<pre><code>-DbrowserCapabilities=htmlUnit
+</code></pre></li>
+<li><p>test on a running server</p>
+
+<pre><code>-Dremote
+</code></pre></li>
+</ul>
+
<h2>Testing in JBDS</h2>
<h3>Integration tests</h3>
@@ -61,11 +93,20 @@
<li>Open JBDS and start a configured instance of JBoss AS</li>
<li>Import the example project and its submodules</li>
<li>In the <em>Project Explorer</em>, select the EJB module project, then
-
<ol>
<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and check <code>integration-tests</code> and <code>arq-jbossas-7-remote</code></li>
<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-</li>
+
+<h3>Functional tests</h3>
+
+<ol>
+<li>Open JBDS and start a configured instance of JBoss AS</li>
+<li>Import the <code>ftest</code> project of the example</li>
+<li>In the <em>Project Explorer</em>, select the ftest project, then
+<ol>
+<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and activate <code>arq-jbossas-7-remote</code> profile and deactivate <code>arq-jbossas-7-managed</code> profile</li>
+<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-
Modified: branches/enterprise/WFK-2_1/examples/blog/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/blog/README.md 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/blog/README.md 2013-09-13 14:11:17 UTC (rev 15588)
@@ -25,7 +25,7 @@
Testing the example
-------------------
-This example is covered by integration tests. All tests use the following technologies:
+This example is covered by integration and functional tests. All tests use the following technologies:
* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
* __ShrinkWrap__ - to create the test archive (WAR).
@@ -48,7 +48,35 @@
mvn clean test -Darquillian=jbossas-remote-7
+### Functional tests
+Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:
+
+* __Arquillian Graphene Extension__ - an advanced Ajax-capable type-safe Selenium-based browser testing tool,
+* __Arquillian Drone Extension__ - to automatically run and stop browser instances.
+
+_Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server._
+
+Run the functional test on JBoss AS instance with
+
+ mvn -f blog-ftest/pom.xml clean test
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+Several variables can be configured:
+
+* path to an alternative archive for testing
+
+ -DtestDeployment=/path/to/archive.ear
+
+* the browser to use for testing
+
+ -DbrowserCapabilities=htmlUnit
+
+* test on a running server
+
+ -Dremote
+
Testing in JBDS
---------------
### Integration tests
@@ -58,3 +86,11 @@
3. In the _Project Explorer_, select the EJB module project, then
1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and check `integration-tests` and `arq-jbossas-7-remote`
2. Right-click the module and select _Run As_ - _JUnit Test_
+
+### Functional tests
+
+1. Open JBDS and start a configured instance of JBoss AS
+2. Import the `ftest` project of the example
+3. In the _Project Explorer_, select the ftest project, then
+ 1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and activate `arq-jbossas-7-remote` profile and deactivate `arq-jbossas-7-managed` profile
+ 2. Right-click the module and select _Run As_ - _JUnit Test_
Added: branches/enterprise/WFK-2_1/examples/blog/blog-ftest/pom.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/blog/blog-ftest/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/blog/blog-ftest/src/test/java/org/jboss/seam/example/blog/test/graphene/BlogFunctionalTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/blog/blog-ftest/src/test/java/org/jboss/seam/example/blog/test/graphene/BlogFunctionalTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/blog/blog-ftest/src/test/java/org/jboss/seam/example/blog/test/graphene/BlogFunctionalTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,108 @@
+/*
+ * 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.example.blog.test.graphene;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.junit.InSequence;
+import org.jboss.seam.example.common.test.DeploymentResolver;
+import org.jboss.seam.example.common.test.SeamGrapheneTest;
+import org.jboss.shrinkwrap.api.Archive;
+import static org.junit.Assert.*;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Blog functional test
+ *
+ * @author Jozef Hartinger
+ */
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class BlogFunctionalTest extends SeamGrapheneTest {
+
+ protected String password = "tokyo";
+
+ @Deployment(testable = false)
+ public static Archive<?> createDeployment() {
+ return DeploymentResolver.createDeployment();
+ }
+
+ @Test
+ @InSequence(1)
+ public void simpleEntryTest() {
+
+ String id = "simpleBlogEntry";
+ String title = "Simple blog entry";
+ String excerpt = "This is an excerpt";
+ String body = "This is a simple blog entry posted for testing purposes.";
+
+ enterNewEntry(id, title, excerpt, body);
+
+ open(contextPath + "entry/" + id);
+
+ assertFalse("Entry not found.", isElementPresent(getBy("ENTRY_404")));
+ assertEquals("Unexpected entry title found.", title, getText(getBy("ENTRY_TITLE")));
+ assertEquals("Unexpected entry body found.", body, getText(getBy("ENTRY_BODY")));
+ }
+
+ @Test
+ @InSequence(2)
+ public void simpleEntrySearchTest() {
+
+ String id = "searchTestEntry";
+ String title = "Search Test Entry";
+ String excerpt = "";
+ String searchString = "9e107d9d372bb6826bd81d3542a419d6";
+ String body = "This is a simple blog entry used for testing search functionality. " + searchString;
+
+ enterNewEntry(id, title, excerpt, body);
+
+ type(getBy("SEARCH_FIELD"), searchString);
+ clickAndWaitHttp(getBy("SEARCH_SUBMIT"));
+ assertEquals("Unexpected search result.", 1, getXpathCount(getBy("SEARCH_RESULT")));
+
+ }
+
+ private void enterNewEntry(String id, String title, String excerpt, String body) {
+ clickAndWaitHttp(getBy("NEW_POST"));
+
+ if (browser.getCurrentUrl().contains(getProperty("LOGIN_URL"))) {
+ login();
+ }
+ fillNewEntryForm(id, title, excerpt, body);
+ }
+
+ private void fillNewEntryForm(String id, String title, String excerpt, String body) {
+ type(getBy("NEW_ENTRY_ID"), id);
+ type(getBy("NEW_ENTRY_TITLE"), title);
+ type(getBy("NEW_ENTRY_EXCERPT"), excerpt);
+ type(getBy("NEW_ENTRY_BODY"), body);
+ clickAndWaitHttp(getBy("NEW_ENTRY_SUBMIT"));
+ }
+
+ private void login() {
+ type(getBy("LOGIN_PASSWORD"), password);
+ clickAndWaitHttp(getBy("LOGIN_SUBMIT"));
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/blog/blog-ftest/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/blog/blog-ftest/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/blog/blog-ftest/src/test/resources/ftest.properties
===================================================================
--- branches/enterprise/WFK-2_1/examples/blog/blog-ftest/src/test/resources/ftest.properties (rev 0)
+++ branches/enterprise/WFK-2_1/examples/blog/blog-ftest/src/test/resources/ftest.properties 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,15 @@
+NEW_POST id=newPost
+LOGIN_PASSWORD id=login:password
+LOGIN_SUBMIT id=login:login
+LOGIN_URL login
+NEW_ENTRY_ID id=newBlogEntry:id:idInput
+NEW_ENTRY_TITLE id=newBlogEntry:title:titleInput
+NEW_ENTRY_EXCERPT id=newBlogEntry:excerpt:excerptInput
+NEW_ENTRY_BODY id=newBlogEntry:body:bodyInput
+NEW_ENTRY_SUBMIT id=newBlogEntry:post
+ENTRY_404 id=404
+ENTRY_TITLE id=title
+ENTRY_BODY id=body
+SEARCH_FIELD id=searchForm:field
+SEARCH_SUBMIT id=searchForm:submit
+SEARCH_RESULT xpath=//table[@id="searchResultTable"]/tbody/tr
\ No newline at end of file
Modified: branches/enterprise/WFK-2_1/examples/booking/README.html
===================================================================
--- branches/enterprise/WFK-2_1/examples/booking/README.html 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/booking/README.html 2013-09-13 14:11:17 UTC (rev 15588)
@@ -12,43 +12,35 @@
<ol>
<li><p>In the example root directory run:</p>
-<pre><code> mvn clean install
+<pre><code>mvn clean install
</code></pre></li>
<li><p>Set JBOSS_HOME environment property.</p></li>
<li><p>In the booking-ear directory run:</p>
-<pre><code> mvn jboss-as:deploy
+<pre><code>mvn jboss-as:deploy
</code></pre></li>
<li><p>Open this URL in a web browser: http://localhost:8080/seam-booking</p></li>
</ol>
-
<h3>Using Ant</h3>
<ol>
<li><p>In the example root directory run:</p>
-<p> ant clean package</p></li>
+<p>ant clean package</p></li>
<li><p>Copy <code>seam-booking.ear</code> from directory <code>booking-ear/target</code> to the deployment directory of JBoss AS <code>($JBOSS_HOME/standalone/deployments</code> by default)</p></li>
<li><p>Open this URL in a web browser: <code>http://localhost:8080/seam-booking</code></p></li>
</ol>
-
-<p><em>NOTE: If the Seam distribution is not unpacked in the same directory as the examples, the path to the Seam distribution must be set by defining <code>seam.dir</code> property</em></p>
-
-<pre><code>ant clean package -Dseam.dir=/path/to/jboss-seam
-</code></pre>
-
<h2>Testing the example</h2>
-<p>This example is covered by integration tests. All tests use the following technologies:</p>
+<p>This example is covered by integration and functional tests. All tests use the following technologies:</p>
<ul>
<li><strong>Arquillian</strong> - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,</li>
<li><strong>ShrinkWrap</strong> - to create the test archive (WAR).</li>
</ul>
-
<h3>Integration tests</h3>
<p>Integration tests cover core application logic and reside in the EJB module. In addition to Arquillian and ShrinkWrap, the integration tests also use:</p>
@@ -58,9 +50,8 @@
<li><strong>ShrinkWrap Resolver</strong> - to resolve dependencies of the project for packaging in the test archive.</li>
</ul>
+<p>The tests are executed in Maven's test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-<p>The tests are executed in Maven’s test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-
<pre><code>mvn clean test -Darquillian=jbossas-managed-7
</code></pre>
@@ -78,6 +69,41 @@
<pre><code>ant clean test
</code></pre>
+<h3>Functional tests</h3>
+
+<p>Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:</p>
+
+<ul>
+<li><strong>Arquillian Graphene Extension</strong> - an advanced Ajax-capable type-safe Selenium-based browser testing tool,</li>
+<li><strong>Arquillian Drone Extension</strong> - to automatically run and stop browser instances.</li>
+</ul>
+
+<p><em>Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server.</em></p>
+
+<p>Run the functional test on JBoss AS instance with</p>
+
+<pre><code>mvn -f booking-ftest/pom.xml clean test
+</code></pre>
+
+<p>The <code>JBOSS_HOME</code> environment variable must be set and point to a JBoss AS instance directory.</p>
+
+<p>Several variables can be configured:</p>
+
+<ul>
+<li><p>path to an alternative archive for testing</p>
+
+<pre><code>-DtestDeployment=/path/to/archive.ear
+</code></pre></li>
+<li><p>the browser to use for testing</p>
+
+<pre><code>-DbrowserCapabilities=htmlUnit
+</code></pre></li>
+<li><p>test on a running server</p>
+
+<pre><code>-Dremote
+</code></pre></li>
+</ul>
+
<h2>Testing in JBDS</h2>
<h3>Integration tests</h3>
@@ -90,7 +116,9 @@
<ol>
<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and check <code>integration-tests</code> and <code>arq-jbossas-7-remote</code></li>
<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-</li>
-</ol>
+<h3>Functional tests</h3>
+
+<p>It is not possible to run the functional tests of this example in JBDS, because they use the maven-dependency-plugin to copy test classes from a different maven artifact, which is not a configuration supported by JBDS.</p>
Modified: branches/enterprise/WFK-2_1/examples/booking/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/booking/README.md 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/booking/README.md 2013-09-13 14:11:17 UTC (rev 15588)
@@ -34,15 +34,10 @@
3. Open this URL in a web browser: `http://localhost:8080/seam-booking`
-_NOTE: If the Seam distribution is not unpacked in the same directory as the examples, the path to the Seam distribution must be set by defining `seam.dir` property_
-
- ant clean package -Dseam.dir=/path/to/jboss-seam
-
-
Testing the example
-------------------
-This example is covered by integration tests. All tests use the following technologies:
+This example is covered by integration and functional tests. All tests use the following technologies:
* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
* __ShrinkWrap__ - to create the test archive (WAR).
@@ -71,6 +66,36 @@
ant clean test
+
+### Functional tests
+
+Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:
+
+* __Arquillian Graphene Extension__ - an advanced Ajax-capable type-safe Selenium-based browser testing tool,
+* __Arquillian Drone Extension__ - to automatically run and stop browser instances.
+
+_Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server._
+
+Run the functional test on JBoss AS instance with
+
+ mvn -f booking-ftest/pom.xml clean test
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+Several variables can be configured:
+
+* path to an alternative archive for testing
+
+ -DtestDeployment=/path/to/archive.ear
+
+* the browser to use for testing
+
+ -DbrowserCapabilities=htmlUnit
+
+* test on a running server
+
+ -Dremote
+
Testing in JBDS
---------------
### Integration tests
@@ -82,3 +107,7 @@
3. In the _Project Explorer_, select the EJB module project, then
1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and check `integration-tests` and `arq-jbossas-7-remote`
2. Right-click the module and select _Run As_ - _JUnit Test_
+
+### Functional tests
+
+It is not possible to run the functional tests of this example in JBDS, because they use the maven-dependency-plugin to copy test classes from a different maven artifact, which is not a configuration supported by JBDS.
\ No newline at end of file
Added: branches/enterprise/WFK-2_1/examples/booking/booking-ftest/pom.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/booking/booking-ftest/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/booking/booking-ftest/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/booking/booking-ftest/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/booking/booking-ftest/src/test/resources/ftest.properties
===================================================================
--- branches/enterprise/WFK-2_1/examples/booking/booking-ftest/src/test/resources/ftest.properties (rev 0)
+++ branches/enterprise/WFK-2_1/examples/booking/booking-ftest/src/test/resources/ftest.properties 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,83 @@
+ #
+ # 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.
+ #
+HOME_PAGE /home.seam
+MAIN_PAGE /main.seam
+PAGE_TITLE JBoss Suites: Seam Framework
+LOGIN_USERNAME_FIELD id=login:username
+LOGIN_PASSWORD_FIELD id=login:password
+LOGIN_SUBMIT id=login:login
+LOGOUT id=logout
+PASSWORD_UPDATED_MESSAGE Password updated
+PASSWORD_REENTER_MESSAGE Re-enter new password
+PASSWORD_VALUE_REQUIRED_MESSAGE xpath=//span[text() = 'value is required']
+PASSWORD_LENGTH_MESSAGE size must be between
+PASSWORD_PASSWORD id=setpassword:PasswordDecorate:password
+PASSWORD_VERIFY id=setpassword:VerifyDecorate:verify
+PASSWORD_SUBMIT id=setpassword:change
+SETTINGS id=settings
+SEARCH_STRING_FIELD id=searchCriteria:searchString
+SEARCH_SUBMIT id=searchCriteria:findHotels
+NO_HOTELS_FOUND id=NoHotelsFoundMessage
+SEARCH_RESULT_TABLE xpath=//table[@id = 'hotels']/tbody
+SEARCH_RESULT_TABLE_FIRST_ROW_LINK id=hotels:0:viewHotel
+BOOKING_BOOK id=hotel:bookHotel
+BOOKING_CANCEL id=hotel:cancel
+HOTEL_BED_FIELD id=booking:bedsDecorate:beds
+HOTEL_CHECKIN_DATE_FIELD id=booking:checkinDateDecorate:checkinDateInputDate
+HOTEL_CHECKIN_DATE_MESSAGE id=booking:checkinDateDecorate:message
+HOTEL_CHECKOUT_DATE_FIELD id=booking:checkoutDateDecorate:checkoutDateInputDate
+HOTEL_CHECKOUT_DATE_MESSAGE id=booking:checkoutDateDecorate:message
+HOTEL_SMOKING_1 id=booking:smokingDecorate:smoking:0
+HOTEL_SMOKING_2 id=booking:smokingDecorate:smoking:1
+HOTEL_CREDIT_CARD id=booking:creditCardDecorate:creditCard
+HOTEL_CREDIT_CARD_NAME id=booking:creditCardNameDecorate:creditCardName
+HOTEL_PROCEED id=booking:proceed
+HOTEL_CANCEL id=booking:cancel
+HOTEL_CONFIRM id=confirm:confirm
+HOTEL_MESSAGE xpath=//ul[@id='messages']/li
+REGISTRATION id=login:register
+REGISTRATION_USERNAME id=registration:usernameDecorate:username
+REGISTRATION_USERNAME_MESSAGE id=registration:usernameDecorate:message
+REGISTRATION_NAME id=registration:nameDecorate:name
+REGISTRATION_NAME_MESSAGE id=registration:nameDecorate:message
+REGISTRATION_PASSWORD id=registration:passwordDecorate:password
+REGISTRATION_PASSWORD_MESSAGE id=registration:passwordDecorate:message
+REGISTRATION_VERIFY id=registration:verifyDecorate:verify
+REGISTRATION_VERIFY_MESSAGE id=registration:verifyDecorate:message
+REGISTRATION_SUBMIT id=registration:register
+REGISTRATION_REENTER_MESSAGE Re-enter your password
+REGISTRATION_LENGTH_MESSAGE size must be between
+REGISTRATION_SUCCESSFUL_MESSAGE Successfully registered as {0}
+REGISTRATION_USER_EXISTS_MESSAGE Username {0} already exists
+NOT_LOGGED_IN_MESSAGE Please log in first
+CONVERSATION_TIMEOUT_MESSAGE The conversation ended, timed out or was processing another request
+BOOKING_TABLE_ITEM xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text()) \= "{0}"][normalize-space(td[1]/text()) \= "{1}"]
+BOOKING_TABLE_ITEM_LINK xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text()) \= "{0}"][normalize-space(td[1]/text()) \= "{1}"]/td[7]/a
+BOOKING_CANCELLED_MESSAGE Booking cancelled for confirmation number {0}
+BOOKING_CONFIRMATION_MESSAGE Thank you, {0}, your confimation number for {1} is \\d+
+BOOKING_INVALID_DATE_MESSAGE1 Check out date must be later than check in date
+BOOKING_INVALID_DATE_MESSAGE2 Check in date must be a future date
+WORKSPACE_BOOKING_TEXT Book hotel: {0}
+WORKSPACE_VIEW_TEXT View hotel: {0}
+WORKSPACE_TABLE_LINK_BY_ID id=ConversationListForm:ConversationListDataTable:{0}:EntryDescriptionLink
+WORKSPACE_TABLE_ROW_COUNT xpath=//table[@id='ConversationListForm:ConversationListDataTable']/tbody/tr
+SPINNER id\=searchCriteria\:SpinnerGif
\ No newline at end of file
Modified: branches/enterprise/WFK-2_1/examples/contactlist/README.html
===================================================================
--- branches/enterprise/WFK-2_1/examples/contactlist/README.html 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/contactlist/README.html 2013-09-13 14:11:17 UTC (rev 15588)
@@ -9,27 +9,25 @@
<ol>
<li><p>In the example root directory run:</p>
-<pre><code> mvn clean install
+<pre><code>mvn clean install
</code></pre></li>
<li><p>Set JBOSS_HOME environment property.</p></li>
<li><p>In the contactlist-ear directory run:</p>
-<pre><code> mvn jboss-as:deploy
+<pre><code>mvn jboss-as:deploy
</code></pre></li>
<li><p>Open this URL in a web browser: http://localhost:8080/seam-contactlist</p></li>
</ol>
-
<h2>Testing the example</h2>
-<p>This example is covered by integration tests. All tests use the following technologies:</p>
+<p>This example is covered by integration and functional tests. All tests use the following technologies:</p>
<ul>
<li><strong>Arquillian</strong> - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,</li>
<li><strong>ShrinkWrap</strong> - to create the test archive (WAR).</li>
</ul>
-
<h3>Integration tests</h3>
<p>Integration tests cover core application logic and reside in the EJB module. In addition to Arquillian and ShrinkWrap, the integration tests also use:</p>
@@ -39,9 +37,8 @@
<li><strong>ShrinkWrap Resolver</strong> - to resolve dependencies of the project for packaging in the test archive.</li>
</ul>
+<p>The tests are executed in Maven's test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-<p>The tests are executed in Maven’s test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-
<pre><code>mvn clean test -Darquillian=jbossas-managed-7
</code></pre>
@@ -52,6 +49,41 @@
<pre><code>mvn clean test -Darquillian=jbossas-remote-7
</code></pre>
+<h3>Functional tests</h3>
+
+<p>Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:</p>
+
+<ul>
+<li><strong>Arquillian Graphene Extension</strong> - an advanced Ajax-capable type-safe Selenium-based browser testing tool,</li>
+<li><strong>Arquillian Drone Extension</strong> - to automatically run and stop browser instances.</li>
+</ul>
+
+<p><em>Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server.</em></p>
+
+<p>Run the functional test on JBoss AS instance with</p>
+
+<pre><code>mvn -f contactlist-ftest/pom.xml clean test
+</code></pre>
+
+<p>The <code>JBOSS_HOME</code> environment variable must be set and point to a JBoss AS instance directory.</p>
+
+<p>Several variables can be configured:</p>
+
+<ul>
+<li><p>path to an alternative archive for testing</p>
+
+<pre><code>-DtestDeployment=/path/to/archive.ear
+</code></pre></li>
+<li><p>the browser to use for testing</p>
+
+<pre><code>-DbrowserCapabilities=htmlUnit
+</code></pre></li>
+<li><p>test on a running server</p>
+
+<pre><code>-Dremote
+</code></pre></li>
+</ul>
+
<h2>Testing in JBDS</h2>
<h3>Integration tests</h3>
@@ -60,11 +92,20 @@
<li>Open JBDS and start a configured instance of JBoss AS</li>
<li>Import the example project and its submodules</li>
<li>In the <em>Project Explorer</em>, select the EJB module project, then
-
<ol>
<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and check <code>integration-tests</code> and <code>arq-jbossas-7-remote</code></li>
<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-</li>
+
+<h3>Functional tests</h3>
+
+<ol>
+<li>Open JBDS and start a configured instance of JBoss AS</li>
+<li>Import the <code>ftest</code> project of the example</li>
+<li>In the <em>Project Explorer</em>, select the ftest project, then
+<ol>
+<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and activate <code>arq-jbossas-7-remote</code> profile and deactivate <code>arq-jbossas-7-managed</code> profile</li>
+<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-
Modified: branches/enterprise/WFK-2_1/examples/contactlist/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/contactlist/README.md 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/contactlist/README.md 2013-09-13 14:11:17 UTC (rev 15588)
@@ -24,7 +24,7 @@
Testing the example
-------------------
-This example is covered by integration tests. All tests use the following technologies:
+This example is covered by integration and functional tests. All tests use the following technologies:
* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
* __ShrinkWrap__ - to create the test archive (WAR).
@@ -47,7 +47,35 @@
mvn clean test -Darquillian=jbossas-remote-7
+### Functional tests
+Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:
+
+* __Arquillian Graphene Extension__ - an advanced Ajax-capable type-safe Selenium-based browser testing tool,
+* __Arquillian Drone Extension__ - to automatically run and stop browser instances.
+
+_Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server._
+
+Run the functional test on JBoss AS instance with
+
+ mvn -f contactlist-ftest/pom.xml clean test
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+Several variables can be configured:
+
+* path to an alternative archive for testing
+
+ -DtestDeployment=/path/to/archive.ear
+
+* the browser to use for testing
+
+ -DbrowserCapabilities=htmlUnit
+
+* test on a running server
+
+ -Dremote
+
Testing in JBDS
---------------
### Integration tests
@@ -57,3 +85,11 @@
3. In the _Project Explorer_, select the EJB module project, then
1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and check `integration-tests` and `arq-jbossas-7-remote`
2. Right-click the module and select _Run As_ - _JUnit Test_
+
+### Functional tests
+
+1. Open JBDS and start a configured instance of JBoss AS
+2. Import the `ftest` project of the example
+3. In the _Project Explorer_, select the ftest project, then
+ 1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and activate `arq-jbossas-7-remote` profile and deactivate `arq-jbossas-7-managed` profile
+ 2. Right-click the module and select _Run As_ - _JUnit Test_
Added: branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/pom.xml (rev 0)
+++ branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/pom.xml 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,122 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.seam.examples</groupId>
+ <artifactId>contactlist</artifactId>
+ <version>2.3.2.Final-redhat-1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.jboss.seam.examples.contactlist</groupId>
+ <artifactId>contactlist-ftest</artifactId>
+ <name>Contact list Functional Tests Module</name>
+
+ <properties>
+ <version.org.jboss.arquillian.extension.drone>1.2.0.Alpha2</version.org.jboss.arquillian.extension.drone>
+ <testDeployment>${basedir}/../contactlist-ear/target/seam-contactlist.ear</testDeployment>
+ <browserCapabilities>firefox</browserCapabilities>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.arquillian.extension</groupId>
+ <artifactId>arquillian-drone-bom</artifactId>
+ <version>${version.org.jboss.arquillian.extension.drone}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.arquillian.extension</groupId>
+ <artifactId>arquillian-drone-webdriver-depchain</artifactId>
+ <type>pom</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>functional-tests</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian.protocol</groupId>
+ <artifactId>arquillian-protocol-servlet</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian.junit</groupId>
+ <artifactId>arquillian-junit-container</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>arq-jbossas-7-remote</id>
+ <activation>
+ <property>
+ <name>remote</name>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-arquillian-container-remote</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>arq-jbossas-7-managed</id>
+ <activation>
+ <property>
+ <name>!remote</name>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-arquillian-container-managed</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <filtering>true</filtering>
+ </testResource>
+ </testResources>
+
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemPropertyVariables>
+ <testDeployment>${testDeployment}</testDeployment>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/java/org/jboss/seam/example/contactlist/test/graphene/CommentTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/java/org/jboss/seam/example/contactlist/test/graphene/CommentTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/java/org/jboss/seam/example/contactlist/test/graphene/CommentTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,59 @@
+/*
+ * 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.example.contactlist.test.graphene;
+
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import static org.junit.Assert.*;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class CommentTest extends ContactlistFunctionalTestBase {
+
+ @Test
+ public void testComment() {
+ String firstName = "Gavin";
+ String lastName = "King";
+ String message = "founder of the Hibernate open source object/relational mapping project";
+ // find contact
+ open(contextPath + getProperty("START_PAGE"));
+
+ search(firstName, lastName);
+ assertTrue("Contact not found. Application is in unexpected state.",
+ searchResultPresent(firstName, lastName));
+ clickAndWaitHttp(getBy("SEARCH_RESULT_FIRST_ROW_LINK"));
+
+ // submit comment
+ type(getBy("COMMENT_TEXTAREA"), message);
+ clickAndWaitHttp(getBy("COMMENT_SUBMIT"));
+
+ // assert comment is stored
+ clickAndWaitHttp(getBy("SEARCH_CONTACT_PAGE"));
+
+ search(firstName, lastName);
+ clickAndWaitHttp(getBy("SEARCH_RESULT_FIRST_ROW_LINK"));
+
+ assertTrue("Comment is not stored.", isTextInSource(message));
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/java/org/jboss/seam/example/contactlist/test/graphene/ContactCRUDTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/java/org/jboss/seam/example/contactlist/test/graphene/ContactCRUDTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/java/org/jboss/seam/example/contactlist/test/graphene/ContactCRUDTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,132 @@
+/*
+ * 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.example.contactlist.test.graphene;
+
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import static org.junit.Assert.*;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class ContactCRUDTest extends ContactlistFunctionalTestBase {
+
+ // used for creation test
+ private Person john = new Person("John", "Doe", "0123456789", "0123456789",
+ "Street", "City", "State", "01234", "US");
+ private Person jane = new Person("Jane", "Doe", "0123456789", "0123456789",
+ "Street", "City", "State", "01234", "US");
+ // used for edit test
+ private Person jozef = new Person("Jozef", "Hartinger", "0123456789",
+ "0123456789", "Cervinkova 99", "Brno", "Czech Republic", "01234",
+ "CZ");
+
+ @Before
+ @Override
+ public void beforeTest() {
+ open(contextPath + getProperty("START_PAGE"));
+ }
+
+ @Test
+ public void testCreateContact() {
+ clickAndWaitHttp(getBy("CREATE_CONTACT_PAGE"));
+
+ fillCreateContactForm(john);
+ clickAndWaitHttp(getBy("CREATE_CONTACT_SUBMIT"));
+
+ clickAndWaitHttp(getBy("SEARCH_CONTACT_PAGE"));
+
+ search(john);
+ assertTrue("Creating new contact failed.", searchResultPresent(john));
+ }
+
+ @Test
+ public void testCreationCanceling() {
+ clickAndWaitHttp(getBy("CREATE_CONTACT_PAGE"));
+
+ fillCreateContactForm(jane);
+ clickAndWaitHttp(getBy("CREATE_CONTACT_CANCEL"));
+
+ clickAndWaitHttp(getBy("SEARCH_CONTACT_PAGE"));
+
+ type(getBy("SEARCH_FIRST_NAME_FIELD"), jane.getFirstName());
+ type(getBy("SEARCH_LAST_NAME_FIELD"), jane.getLastName());
+ clickAndWaitHttp(getBy("SEARCH_SUBMIT"));
+
+ assertFalse("New contact created despite cancel.",
+ searchResultPresent(jane));
+ }
+
+ @Test
+ public void testEditContact() {
+ String firstName = "Shane";
+ String lastName = "Bryzak";
+ // find contact
+
+ search(firstName, lastName);
+ assertTrue("Contact not found. Application is in unexpected state.",
+ searchResultPresent(firstName, lastName));
+ clickAndWaitHttp(getBy("SEARCH_RESULT_FIRST_ROW_LINK"));
+
+ clickAndWaitHttp(getBy("EDIT_CONTACT_LINK"));
+
+ // update form fields
+ fillCreateContactForm(jozef);
+ clickAndWaitHttp(getBy("UPDATE_CONTACT_SUBMIT"));
+
+ // make sure new values are present
+ clickAndWaitHttp(getBy("SEARCH_CONTACT_PAGE"));
+
+ search(jozef);
+ assertTrue("Contact update failed. New values missing",
+ searchResultPresent(jozef));
+ // make sure old values are not present
+ clickAndWaitHttp(getBy("SEARCH_CONTACT_PAGE"));
+
+ search(firstName, lastName);
+ assertFalse("Contact update failed. Old values still present",
+ searchResultPresent(firstName, lastName));
+ }
+
+ @Test
+ public void testRemoveContact() {
+ String firstName = "Norman";
+ String lastName = "Richards";
+ // find contact
+ search(firstName, lastName);
+ assertTrue("Contact not found. Application is in unexpected state.",
+ searchResultPresent(firstName, lastName));
+ clickAndWaitHttp(getBy("SEARCH_RESULT_FIRST_ROW_LINK"));
+
+ // remove contact
+ clickAndWaitHttp(getBy("REMOVE_CONTACT_LINK"));
+
+ // assert contact is removed
+ clickAndWaitHttp(getBy("SEARCH_CONTACT_PAGE"));
+
+ search(firstName, lastName);
+ assertFalse("Contact present despite it should be removed.",
+ searchResultPresent(firstName, lastName));
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/java/org/jboss/seam/example/contactlist/test/graphene/ContactlistFunctionalTestBase.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/java/org/jboss/seam/example/contactlist/test/graphene/ContactlistFunctionalTestBase.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/java/org/jboss/seam/example/contactlist/test/graphene/ContactlistFunctionalTestBase.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,74 @@
+/*
+ * 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.example.contactlist.test.graphene;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.seam.example.common.test.DeploymentResolver;
+import org.jboss.seam.example.common.test.SeamGrapheneTest;
+import org.jboss.shrinkwrap.api.Archive;
+
+public class ContactlistFunctionalTestBase extends SeamGrapheneTest {
+
+ @Deployment(testable = false)
+ public static Archive<?> createDeployment() {
+ return DeploymentResolver.createDeployment();
+ }
+
+ public boolean searchResultPresent(String firstName, String lastName) {
+ return isElementPresent(getBy("SEARCH_RESULT_FIRST_ROW_LINK"))
+ && getText(getBy("SEARCH_RESULT_FIRST_ROW_LINK")).equals(firstName + " " + lastName);
+ }
+
+ public boolean searchResultPresent(Person person) {
+ return searchResultPresent(person.getFirstName(), person.getLastName())
+ && getText(getBy("SEARCH_RESULT_FIRST_ROW_CELL_PHONE")).equals(person.getCellPhone())
+ && getText(getBy("SEARCH_RESULT_FIRST_ROW_HOME_PHONE")).equals(person.getHomePhone())
+ && getText(getBy("SEARCH_RESULT_FIRST_ROW_ADDRESS")).equals(person.getAddress())
+ && getText(getBy("SEARCH_RESULT_FIRST_ROW_CITY")).equals(person.getCity())
+ && getText(getBy("SEARCH_RESULT_FIRST_ROW_STATE")).equals(person.getState())
+ && getText(getBy("SEARCH_RESULT_FIRST_ROW_ZIP")).equals(person.getZip())
+ && getText(getBy("SEARCH_RESULT_FIRST_ROW_COUNTRY")).equals(person.getCountry());
+ }
+
+ public void fillCreateContactForm(Person person) {
+ type(getBy("FIRST_NAME_FIELD"), person.getFirstName());
+ type(getBy("LAST_NAME_FIELD"), person.getLastName());
+ type(getBy("CELL_PHONE_FIELD"), person.getCellPhone());
+ type(getBy("HOME_PHONE_FIELD"), person.getHomePhone());
+ type(getBy("ADDRESS_FIELD"), person.getAddress());
+ type(getBy("CITY_FIELD"), person.getCity());
+ type(getBy("STATE_FIELD"), person.getState());
+ type(getBy("ZIP_FIELD"), person.getZip());
+ type(getBy("COUNTRY_FIELD"), person.getCountry());
+ }
+
+ public void search(String firstName, String lastName) {
+ type(getBy("SEARCH_FIRST_NAME_FIELD"), firstName);
+ type(getBy("SEARCH_LAST_NAME_FIELD"), lastName);
+ clickAndWaitHttp(getBy("SEARCH_SUBMIT"));
+
+ }
+
+ public void search(Person person) {
+ search(person.getFirstName(), person.getLastName());
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/java/org/jboss/seam/example/contactlist/test/graphene/Person.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/java/org/jboss/seam/example/contactlist/test/graphene/Person.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/java/org/jboss/seam/example/contactlist/test/graphene/Person.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,121 @@
+/*
+ * 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.example.contactlist.test.graphene;
+
+public class Person {
+ private String firstName;
+ private String lastName;
+ private String cellPhone;
+ private String homePhone;
+ private String address;
+ private String city;
+ private String state;
+ private String zip;
+ private String country;
+
+ public Person(String firstName, String lastName, String cellPhone, String homePhone,
+ String address, String city, String state, String zip, String country) {
+ this.firstName = firstName;
+ this.lastName = lastName;
+ this.cellPhone = cellPhone;
+ this.homePhone = homePhone;
+ this.address = address;
+ this.city = city;
+ this.state = state;
+ this.zip = zip;
+ this.country = country;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+
+ public String getCellPhone() {
+ return cellPhone;
+ }
+
+ public void setCellPhone(String cellPhone) {
+ this.cellPhone = cellPhone;
+ }
+
+ public String getHomePhone() {
+ return homePhone;
+ }
+
+ public void setHomePhone(String homePhone) {
+ this.homePhone = homePhone;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public String getCity() {
+ return city;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ public String getZip() {
+ return zip;
+ }
+
+ public void setZip(String zip) {
+ this.zip = zip;
+ }
+
+ public String getCountry() {
+ return country;
+ }
+
+ public void setCountry(String country) {
+ this.country = country;
+ }
+
+}
Added: branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/resources/ftest.properties
===================================================================
--- branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/resources/ftest.properties (rev 0)
+++ branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ftest/src/test/resources/ftest.properties 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,31 @@
+START_PAGE /
+SEARCH_CONTACT_PAGE id=search
+SEARCH_FIRST_NAME_FIELD id=searchForm:firstName
+SEARCH_LAST_NAME_FIELD id=searchForm:lastName
+SEARCH_SUBMIT id=searchForm:submit
+CREATE_CONTACT_PAGE id=create
+CREATE_CONTACT_SUBMIT id=editForm:createContact
+CREATE_CONTACT_CANCEL id=editForm:cancel
+FIRST_NAME_FIELD id=editForm:firstNameDecorate:firstName
+LAST_NAME_FIELD id=editForm:lastNameDecorate:lastName
+CELL_PHONE_FIELD id=editForm:cellPhoneDecorate:cellPhone
+HOME_PHONE_FIELD id=editForm:homePhoneDecorate:homePhone
+ADDRESS_FIELD id=editForm:addressDecorate:address
+CITY_FIELD id=editForm:cityDecorate:city
+STATE_FIELD id=editForm:stateDecorate:state
+ZIP_FIELD id=editForm:zipDecorate:zip
+COUNTRY_FIELD id=editForm:countryDecorate:country
+EDIT_CONTACT_LINK id=editContact
+UPDATE_CONTACT_SUBMIT id=editForm:updateContact
+EDIT_FORM_REMOVE_CONTACT_LINK id=editForm:deleteContact
+REMOVE_CONTACT_LINK id=deleteContact
+SEARCH_RESULT_FIRST_ROW_LINK id=searchResult:0:link
+SEARCH_RESULT_FIRST_ROW_CELL_PHONE id=searchResult:0:cellPhone
+SEARCH_RESULT_FIRST_ROW_HOME_PHONE id=searchResult:0:homePhone
+SEARCH_RESULT_FIRST_ROW_ADDRESS id=searchResult:0:address
+SEARCH_RESULT_FIRST_ROW_CITY id=searchResult:0:city
+SEARCH_RESULT_FIRST_ROW_STATE id=searchResult:0:state
+SEARCH_RESULT_FIRST_ROW_ZIP id=searchResult:0:zip
+SEARCH_RESULT_FIRST_ROW_COUNTRY id=searchResult:0:country
+COMMENT_TEXTAREA id=commentForm:text
+COMMENT_SUBMIT id=commentForm:submit
Modified: branches/enterprise/WFK-2_1/examples/excel/README.html
===================================================================
--- branches/enterprise/WFK-2_1/examples/excel/README.html 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/excel/README.html 2013-09-13 14:11:17 UTC (rev 15588)
@@ -9,27 +9,25 @@
<ol>
<li><p>In the example root directory run:</p>
-<pre><code> mvn clean install
+<pre><code>mvn clean install
</code></pre></li>
<li><p>Set JBOSS_HOME environment property.</p></li>
<li><p>In the excel-ear directory run:</p>
-<pre><code> mvn jboss-as:deploy
+<pre><code>mvn jboss-as:deploy
</code></pre></li>
<li><p>Open this URL in a web browser: http://localhost:8080/seam-excel</p></li>
</ol>
-
<h2>Testing the example</h2>
-<p>This example is covered by integration tests. All tests use the following technologies:</p>
+<p>This example is covered by integration and functional tests. All tests use the following technologies:</p>
<ul>
<li><strong>Arquillian</strong> - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,</li>
<li><strong>ShrinkWrap</strong> - to create the test archive (WAR).</li>
</ul>
-
<h3>Integration tests</h3>
<p>Integration tests cover core application logic and reside in the EJB module. In addition to Arquillian and ShrinkWrap, the integration tests also use:</p>
@@ -39,9 +37,8 @@
<li><strong>ShrinkWrap Resolver</strong> - to resolve dependencies of the project for packaging in the test archive.</li>
</ul>
+<p>The tests are executed in Maven's test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-<p>The tests are executed in Maven’s test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-
<pre><code>mvn clean test -Darquillian=jbossas-managed-7
</code></pre>
@@ -52,6 +49,41 @@
<pre><code>mvn clean test -Darquillian=jbossas-remote-7
</code></pre>
+<h3>Functional tests</h3>
+
+<p>Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:</p>
+
+<ul>
+<li><strong>Arquillian Graphene Extension</strong> - an advanced Ajax-capable type-safe Selenium-based browser testing tool,</li>
+<li><strong>Arquillian Drone Extension</strong> - to automatically run and stop browser instances.</li>
+</ul>
+
+<p><em>Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server.</em></p>
+
+<p>Run the functional test on JBoss AS instance with</p>
+
+<pre><code>mvn -f excel-ftest/pom.xml clean test
+</code></pre>
+
+<p>The <code>JBOSS_HOME</code> environment variable must be set and point to a JBoss AS instance directory.</p>
+
+<p>Several variables can be configured:</p>
+
+<ul>
+<li><p>path to an alternative archive for testing</p>
+
+<pre><code>-DtestDeployment=/path/to/archive.ear
+</code></pre></li>
+<li><p>the browser to use for testing</p>
+
+<pre><code>-DbrowserCapabilities=htmlUnit
+</code></pre></li>
+<li><p>test on a running server</p>
+
+<pre><code>-Dremote
+</code></pre></li>
+</ul>
+
<h2>Testing in JBDS</h2>
<h3>Integration tests</h3>
@@ -60,11 +92,20 @@
<li>Open JBDS and start a configured instance of JBoss AS</li>
<li>Import the example project and its submodules</li>
<li>In the <em>Project Explorer</em>, select the EJB module project, then
-
<ol>
<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and check <code>integration-tests</code> and <code>arq-jbossas-7-remote</code></li>
<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-</li>
+
+<h3>Functional tests</h3>
+
+<ol>
+<li>Open JBDS and start a configured instance of JBoss AS</li>
+<li>Import the <code>ftest</code> project of the example</li>
+<li>In the <em>Project Explorer</em>, select the ftest project, then
+<ol>
+<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and activate <code>arq-jbossas-7-remote</code> profile and deactivate <code>arq-jbossas-7-managed</code> profile</li>
+<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-
Modified: branches/enterprise/WFK-2_1/examples/excel/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/excel/README.md 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/excel/README.md 2013-09-13 14:11:17 UTC (rev 15588)
@@ -24,7 +24,7 @@
Testing the example
-------------------
-This example is covered by integration tests. All tests use the following technologies:
+This example is covered by integration and functional tests. All tests use the following technologies:
* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
* __ShrinkWrap__ - to create the test archive (WAR).
@@ -47,7 +47,35 @@
mvn clean test -Darquillian=jbossas-remote-7
+### Functional tests
+Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:
+
+* __Arquillian Graphene Extension__ - an advanced Ajax-capable type-safe Selenium-based browser testing tool,
+* __Arquillian Drone Extension__ - to automatically run and stop browser instances.
+
+_Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server._
+
+Run the functional test on JBoss AS instance with
+
+ mvn -f excel-ftest/pom.xml clean test
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+Several variables can be configured:
+
+* path to an alternative archive for testing
+
+ -DtestDeployment=/path/to/archive.ear
+
+* the browser to use for testing
+
+ -DbrowserCapabilities=htmlUnit
+
+* test on a running server
+
+ -Dremote
+
Testing in JBDS
---------------
### Integration tests
@@ -57,3 +85,11 @@
3. In the _Project Explorer_, select the EJB module project, then
1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and check `integration-tests` and `arq-jbossas-7-remote`
2. Right-click the module and select _Run As_ - _JUnit Test_
+
+### Functional tests
+
+1. Open JBDS and start a configured instance of JBoss AS
+2. Import the `ftest` project of the example
+3. In the _Project Explorer_, select the ftest project, then
+ 1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and activate `arq-jbossas-7-remote` profile and deactivate `arq-jbossas-7-managed` profile
+ 2. Right-click the module and select _Run As_ - _JUnit Test_
Added: branches/enterprise/WFK-2_1/examples/excel/excel-ftest/pom.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/excel/excel-ftest/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/excel/excel-ftest/src/test/java/org/jboss/seam/example/excel/test/graphene/ExcelFunctionalTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/excel/excel-ftest/src/test/java/org/jboss/seam/example/excel/test/graphene/ExcelFunctionalTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/excel/excel-ftest/src/test/java/org/jboss/seam/example/excel/test/graphene/ExcelFunctionalTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,31 @@
+package org.jboss.seam.example.excel.test.graphene;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.example.common.test.DeploymentResolver;
+import org.jboss.seam.example.common.test.SeamGrapheneTest;
+import org.jboss.shrinkwrap.api.Archive;
+import static org.junit.Assert.*;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class ExcelFunctionalTest extends SeamGrapheneTest {
+
+ public static final String HOME_PAGE_TITLE = "Microsoft® Excel® Export examples";
+
+ @Deployment(testable = false)
+ public static Archive<?> createDeployment() {
+ return DeploymentResolver.createDeployment();
+ }
+
+ /**
+ * Place holder - just verifies that example deploys
+ */
+ @Test
+ public void homePageLoadTest() {
+ assertEquals("Unexpected page title.", HOME_PAGE_TITLE, browser.getTitle());
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/excel/excel-ftest/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/excel/excel-ftest/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Modified: branches/enterprise/WFK-2_1/examples/groovybooking/README.html
===================================================================
--- branches/enterprise/WFK-2_1/examples/groovybooking/README.html 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/groovybooking/README.html 2013-09-13 14:11:17 UTC (rev 15588)
@@ -10,13 +10,62 @@
<ol>
<li><p>In the example root directory run:</p>
-<pre><code> mvn clean install
+<pre><code>mvn clean install
</code></pre></li>
<li><p>Set JBOSS_HOME environment property.</p></li>
<li><p>In the groovybooking-web directory run:</p>
-<pre><code> mvn jboss-as:deploy
+<pre><code>mvn jboss-as:deploy
</code></pre></li>
<li><p>Open this URL in a web browser: http://localhost:8080/groovybooking-web</p></li>
</ol>
+<h2>Testing the example</h2>
+
+<p>This example is covered by functional tests. All tests use the following technologies:</p>
+
+<ul>
+<li><strong>Arquillian</strong> - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,</li>
+<li><strong>ShrinkWrap</strong> - to create the test archive (WAR).</li>
+</ul>
+
+<h3>Functional tests</h3>
+
+<p>Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:</p>
+
+<ul>
+<li><strong>Arquillian Graphene Extension</strong> - an advanced Ajax-capable type-safe Selenium-based browser testing tool,</li>
+<li><strong>Arquillian Drone Extension</strong> - to automatically run and stop browser instances.</li>
+</ul>
+
+<p><em>Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server.</em></p>
+
+<p>Run the functional test on JBoss AS instance with</p>
+
+<pre><code>mvn -f groovybooking-ftest/pom.xml clean test
+</code></pre>
+
+<p>The <code>JBOSS_HOME</code> environment variable must be set and point to a JBoss AS instance directory.</p>
+
+<p>Several variables can be configured:</p>
+
+<ul>
+<li><p>path to an alternative archive for testing</p>
+
+<pre><code>-DtestDeployment=/path/to/archive.ear
+</code></pre></li>
+<li><p>the browser to use for testing</p>
+
+<pre><code>-DbrowserCapabilities=htmlUnit
+</code></pre></li>
+<li><p>test on a running server</p>
+
+<pre><code>-Dremote
+</code></pre></li>
+</ul>
+
+<h2>Testing in JBDS</h2>
+
+<h3>Functional tests</h3>
+
+<p>It is not possible to run the functional tests of this example in JBDS, because they use the maven-dependency-plugin to copy test classes from a different maven artifact, which is not a configuration supported by JBDS.</p>
Modified: branches/enterprise/WFK-2_1/examples/groovybooking/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/groovybooking/README.md 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/groovybooking/README.md 2013-09-13 14:11:17 UTC (rev 15588)
@@ -20,3 +20,48 @@
mvn jboss-as:deploy
4. Open this URL in a web browser: http://localhost:8080/groovybooking-web
+
+
+Testing the example
+-------------------
+
+This example is covered by functional tests. All tests use the following technologies:
+
+* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
+* __ShrinkWrap__ - to create the test archive (WAR).
+
+
+### Functional tests
+
+Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:
+
+* __Arquillian Graphene Extension__ - an advanced Ajax-capable type-safe Selenium-based browser testing tool,
+* __Arquillian Drone Extension__ - to automatically run and stop browser instances.
+
+_Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server._
+
+Run the functional test on JBoss AS instance with
+
+ mvn -f groovybooking-ftest/pom.xml clean test
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+Several variables can be configured:
+
+* path to an alternative archive for testing
+
+ -DtestDeployment=/path/to/archive.ear
+
+* the browser to use for testing
+
+ -DbrowserCapabilities=htmlUnit
+
+* test on a running server
+
+ -Dremote
+
+Testing in JBDS
+---------------
+### Functional tests
+
+It is not possible to run the functional tests of this example in JBDS, because they use the maven-dependency-plugin to copy test classes from a different maven artifact, which is not a configuration supported by JBDS.
Added: branches/enterprise/WFK-2_1/examples/groovybooking/groovybooking-ftest/pom.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/groovybooking/groovybooking-ftest/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/groovybooking/groovybooking-ftest/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/groovybooking/groovybooking-ftest/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/groovybooking/groovybooking-ftest/src/test/resources/ftest.properties
===================================================================
--- branches/enterprise/WFK-2_1/examples/groovybooking/groovybooking-ftest/src/test/resources/ftest.properties (rev 0)
+++ branches/enterprise/WFK-2_1/examples/groovybooking/groovybooking-ftest/src/test/resources/ftest.properties 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,84 @@
+ #
+ # 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.
+ #
+HOME_PAGE /home.seam
+MAIN_PAGE /main.seam
+PAGE_TITLE JBoss Suites: Seam Framework
+LOGIN_USERNAME_FIELD id=login:username
+LOGIN_PASSWORD_FIELD id=login:password
+LOGIN_SUBMIT id=login:login
+LOGOUT id=logout
+PASSWORD_UPDATED_MESSAGE Password updated
+PASSWORD_REENTER_MESSAGE verify
+PASSWORD_VALUE_REQUIRED_MESSAGE xpath=//span[text() = 'value is required']
+PASSWORD_LENGTH_MESSAGE size must be between
+PASSWORD_PASSWORD id=setpassword:PasswordDecorate:password
+PASSWORD_VERIFY id=setpassword:VerifyDecorate:verify
+PASSWORD_SUBMIT id=setpassword:change
+SETTINGS id=settings
+SEARCH_STRING_FIELD id=searchCriteria:searchString
+SEARCH_SUBMIT id=searchCriteria:findHotels
+NO_HOTELS_FOUND id=NoHotelsFoundMessage
+SEARCH_RESULT_TABLE xpath=//table[@id = 'hotels']/tbody
+SEARCH_RESULT_TABLE_FIRST_ROW_LINK id=hotels:0:viewHotel
+BOOKING_BOOK id=hotel:bookHotel
+BOOKING_CANCEL id=hotel:cancel
+HOTEL_BED_FIELD id=booking:bedsDecorate:beds
+HOTEL_BED_FIELD_SELECT_CRITERIA value=
+HOTEL_CHECKIN_DATE_FIELD id=booking:checkinDateDecorate:checkinDateInputDate
+HOTEL_CHECKIN_DATE_MESSAGE xpath=//*[@id='booking:message' or @id='booking:checkinDateDecorate:message']
+HOTEL_CHECKOUT_DATE_FIELD id=booking:checkoutDateDecorate:checkoutDateInputDate
+HOTEL_CHECKOUT_DATE_MESSAGE xpath=//*[@id='booking:message' or @id='booking:checkoutDateDecorate:message']
+HOTEL_SMOKING_1 id=booking:smokingDecorate:smoking:0
+HOTEL_SMOKING_2 id=booking:smokingDecorate:smoking:1
+HOTEL_CREDIT_CARD id=booking:creditCardDecorate:creditCard
+HOTEL_CREDIT_CARD_NAME id=booking:creditCardNameDecorate:creditCardName
+HOTEL_PROCEED id=booking:proceed
+HOTEL_CANCEL id=booking:cancel
+HOTEL_CONFIRM id=confirm:confirm
+HOTEL_MESSAGE xpath=//ul[@id='messages']/li
+REGISTRATION id=login:register
+REGISTRATION_USERNAME id=registration:usernameDecorate:username
+REGISTRATION_USERNAME_MESSAGE id=registration:usernameDecorate:message
+REGISTRATION_NAME id=registration:nameDecorate:name
+REGISTRATION_NAME_MESSAGE id=registration:nameDecorate:message
+REGISTRATION_PASSWORD id=registration:passwordDecorate:password
+REGISTRATION_PASSWORD_MESSAGE id=registration:passwordDecorate:message
+REGISTRATION_VERIFY id=registration:verifyDecorate:verify
+REGISTRATION_VERIFY_MESSAGE id=registration:verifyDecorate:message
+REGISTRATION_SUBMIT id=registration:register
+REGISTRATION_REENTER_MESSAGE verify
+REGISTRATION_LENGTH_MESSAGE size must be between
+REGISTRATION_SUCCESSFUL_MESSAGE Successfully registered as {0}
+REGISTRATION_USER_EXISTS_MESSAGE Username {0} already exists
+NOT_LOGGED_IN_MESSAGE Please log in first
+CONVERSATION_TIMEOUT_MESSAGE The conversation ended, timed out or was processing another request
+BOOKING_TABLE_ITEM xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text()) \= "{0}"][normalize-space(td[1]/text()) \= "{1}"]
+BOOKING_TABLE_ITEM_LINK xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text()) \= "{0}"][normalize-space(td[1]/text()) \= "{1}"]/td[7]/a
+BOOKING_CANCELLED_MESSAGE Booking cancelled for confirmation number {0}
+BOOKING_CONFIRMATION_MESSAGE Thank you, {0}, your confimation number for {1} is \\d+
+BOOKING_INVALID_DATE_MESSAGE1 Check out date must be later than check in date
+BOOKING_INVALID_DATE_MESSAGE2 Check in date must be a future date
+WORKSPACE_BOOKING_TEXT Book hotel: {0}
+WORKSPACE_VIEW_TEXT View hotel: {0}
+WORKSPACE_TABLE_LINK_BY_ID id=ConversationListForm:ConversationListDataTable:{0}:EntryDescriptionLink
+WORKSPACE_TABLE_ROW_COUNT xpath=//table[@id\='ConversationListForm\:ConversationListDataTable']/tbody/tr
+SPINNER id\=searchCriteria:SpinnerGif
\ No newline at end of file
Modified: branches/enterprise/WFK-2_1/examples/hibernate/README.html
===================================================================
--- branches/enterprise/WFK-2_1/examples/hibernate/README.html 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/hibernate/README.html 2013-09-13 14:11:17 UTC (rev 15588)
@@ -9,27 +9,25 @@
<ol>
<li><p>In the example root directory run:</p>
-<pre><code> mvn clean install
+<pre><code>mvn clean install
</code></pre></li>
<li><p>Set JBOSS_HOME environment property.</p></li>
<li><p>In the hibernate-web directory run:</p>
-<pre><code> mvn jboss-as:deploy
+<pre><code>mvn jboss-as:deploy
</code></pre></li>
<li><p>Open this URL in a web browser: http://localhost:8080/hibernate-web</p></li>
</ol>
-
<h2>Testing the example</h2>
-<p>This example is covered by integration tests. All tests use the following technologies:</p>
+<p>This example is covered by integration and functional tests. All tests use the following technologies:</p>
<ul>
<li><strong>Arquillian</strong> - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,</li>
<li><strong>ShrinkWrap</strong> - to create the test archive (WAR).</li>
</ul>
-
<h3>Integration tests</h3>
<p>Integration tests cover core application logic and reside in the EJB module. In addition to Arquillian and ShrinkWrap, the integration tests also use:</p>
@@ -39,10 +37,9 @@
<li><strong>ShrinkWrap Resolver</strong> - to resolve dependencies of the project for packaging in the test archive.</li>
</ul>
-
<p><em>Note: For this test to function properly, it is necessary to run the JBoss AS instance with the <strong>-ea</strong> JVM argument (Enable Assertions).</em></p>
-<p>The tests are executed in Maven’s test phase. By default they are skipped and can be executed on JBoss AS with:</p>
+<p>The tests are executed in Maven's test phase. By default they are skipped and can be executed on JBoss AS with:</p>
<pre><code>mvn clean test -Darquillian=jbossas-managed-7
</code></pre>
@@ -54,6 +51,41 @@
<pre><code>mvn clean test -Darquillian=jbossas-remote-7
</code></pre>
+<h3>Functional tests</h3>
+
+<p>Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:</p>
+
+<ul>
+<li><strong>Arquillian Graphene Extension</strong> - an advanced Ajax-capable type-safe Selenium-based browser testing tool,</li>
+<li><strong>Arquillian Drone Extension</strong> - to automatically run and stop browser instances.</li>
+</ul>
+
+<p><em>Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server.</em></p>
+
+<p>Run the functional test on JBoss AS instance with</p>
+
+<pre><code>mvn -f hibernate-ftest/pom.xml clean test
+</code></pre>
+
+<p>The <code>JBOSS_HOME</code> environment variable must be set and point to a JBoss AS instance directory.</p>
+
+<p>Several variables can be configured:</p>
+
+<ul>
+<li><p>path to an alternative archive for testing</p>
+
+<pre><code>-DtestDeployment=/path/to/archive.ear
+</code></pre></li>
+<li><p>the browser to use for testing</p>
+
+<pre><code>-DbrowserCapabilities=htmlUnit
+</code></pre></li>
+<li><p>test on a running server</p>
+
+<pre><code>-Dremote
+</code></pre></li>
+</ul>
+
<h2>Testing in JBDS</h2>
<h3>Integration tests</h3>
@@ -62,11 +94,12 @@
<li>Open JBDS and start a configured instance of JBoss AS</li>
<li>Import the example project and its submodules</li>
<li>In the <em>Project Explorer</em>, select the Web module project, then
-
<ol>
<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and check <code>integration-tests</code> and <code>arq-jbossas-7-remote</code></li>
<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-</li>
-</ol>
+<h3>Functional tests</h3>
+
+<p>It is not possible to run the functional tests of this example in JBDS, because they use the maven-dependency-plugin to copy test classes from a different maven artifact, which is not a configuration supported by JBDS.</p>
Modified: branches/enterprise/WFK-2_1/examples/hibernate/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/hibernate/README.md 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/hibernate/README.md 2013-09-13 14:11:17 UTC (rev 15588)
@@ -24,7 +24,7 @@
Testing the example
-------------------
-This example is covered by integration tests. All tests use the following technologies:
+This example is covered by integration and functional tests. All tests use the following technologies:
* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
* __ShrinkWrap__ - to create the test archive (WAR).
@@ -49,6 +49,35 @@
mvn clean test -Darquillian=jbossas-remote-7
+### Functional tests
+
+Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:
+
+* __Arquillian Graphene Extension__ - an advanced Ajax-capable type-safe Selenium-based browser testing tool,
+* __Arquillian Drone Extension__ - to automatically run and stop browser instances.
+
+_Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server._
+
+Run the functional test on JBoss AS instance with
+
+ mvn -f hibernate-ftest/pom.xml clean test
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+Several variables can be configured:
+
+* path to an alternative archive for testing
+
+ -DtestDeployment=/path/to/archive.ear
+
+* the browser to use for testing
+
+ -DbrowserCapabilities=htmlUnit
+
+* test on a running server
+
+ -Dremote
+
Testing in JBDS
---------------
### Integration tests
@@ -58,3 +87,7 @@
3. In the _Project Explorer_, select the Web module project, then
1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and check `integration-tests` and `arq-jbossas-7-remote`
2. Right-click the module and select _Run As_ - _JUnit Test_
+
+### Functional tests
+
+It is not possible to run the functional tests of this example in JBDS, because they use the maven-dependency-plugin to copy test classes from a different maven artifact, which is not a configuration supported by JBDS.
\ No newline at end of file
Added: branches/enterprise/WFK-2_1/examples/hibernate/hibernate-ftest/pom.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/hibernate/hibernate-ftest/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/hibernate/hibernate-ftest/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/hibernate/hibernate-ftest/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/hibernate/hibernate-ftest/src/test/resources/ftest.properties
===================================================================
--- branches/enterprise/WFK-2_1/examples/hibernate/hibernate-ftest/src/test/resources/ftest.properties (rev 0)
+++ branches/enterprise/WFK-2_1/examples/hibernate/hibernate-ftest/src/test/resources/ftest.properties 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,84 @@
+ #
+ # 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.
+ #
+HOME_PAGE /home.seam
+MAIN_PAGE /main.seam
+PAGE_TITLE JBoss Suites: Seam Framework
+LOGIN_USERNAME_FIELD id=login:username
+LOGIN_PASSWORD_FIELD id=login:password
+LOGIN_SUBMIT id=login:login
+LOGOUT id=logout
+PASSWORD_UPDATED_MESSAGE Password updated
+PASSWORD_REENTER_MESSAGE verify
+PASSWORD_VALUE_REQUIRED_MESSAGE xpath=//*[@id='setpassword:Message' or @id='setpassword:PasswordDecorate:Message']
+PASSWORD_LENGTH_MESSAGE size must be between
+PASSWORD_PASSWORD id=setpassword:PasswordDecorate:password
+PASSWORD_VERIFY id=setpassword:VerifyDecorate:verify
+PASSWORD_SUBMIT id=setpassword:change
+SETTINGS id=settings
+SEARCH_STRING_FIELD id=main:searchString
+SEARCH_SUBMIT id=main:findHotels
+NO_HOTELS_FOUND id=NoHotelsFoundMessage
+SEARCH_RESULT_TABLE xpath=//table[@id = 'hotels']/tbody
+SEARCH_RESULT_TABLE_FIRST_ROW_LINK id=hotels:0:viewHotel
+BOOKING_BOOK id=hotel:bookHotel
+BOOKING_CANCEL id=hotel:cancel
+HOTEL_BED_FIELD id=booking:bedsDecorate:beds
+HOTEL_BED_FIELD_SELECT_CRITERIA value=
+HOTEL_CHECKIN_DATE_FIELD id=booking:checkinDateDecorate:checkinDateInputDate
+HOTEL_CHECKIN_DATE_MESSAGE xpath=//*[@id='booking:Message' or @id='booking:checkinDateDecorate:Message']
+HOTEL_CHECKOUT_DATE_FIELD id=booking:checkoutDateDecorate:checkoutDateInputDate
+HOTEL_CHECKOUT_DATE_MESSAGE xpath=//*[@id='booking:Message' or @id='booking:checkoutDateDecorate:Message']
+HOTEL_SMOKING_1 id=booking:smokingDecorate:smoking:0
+HOTEL_SMOKING_2 id=booking:smokingDecorate:smoking:1
+HOTEL_CREDIT_CARD id=booking:creditCardDecorate:creditCard
+HOTEL_CREDIT_CARD_NAME id=booking:creditCardNameDecorate:creditCardName
+HOTEL_PROCEED id=booking:proceed
+HOTEL_CANCEL id=booking:cancel
+HOTEL_CONFIRM id=confirm:confirm
+HOTEL_MESSAGE xpath=//ul[@id='main:messages']/li
+REGISTRATION id=login:register
+REGISTRATION_USERNAME id=register:usernameDecorate:username
+REGISTRATION_USERNAME_MESSAGE id=register:usernameDecorate:message
+REGISTRATION_NAME id=register:nameDecorate:name
+REGISTRATION_NAME_MESSAGE id=register:nameDecorate:message
+REGISTRATION_PASSWORD id=register:passwordDecorate:password
+REGISTRATION_PASSWORD_MESSAGE id=register:passwordDecorate:message
+REGISTRATION_VERIFY id=register:verifyDecorate:verify
+REGISTRATION_VERIFY_MESSAGE id=register:verifyDecorate:message
+REGISTRATION_SUBMIT id=register:register
+REGISTRATION_REENTER_MESSAGE verify
+REGISTRATION_LENGTH_MESSAGE size must be between
+REGISTRATION_SUCCESSFUL_MESSAGE Successfully registered as {0}
+REGISTRATION_USER_EXISTS_MESSAGE Username {0} already exists
+NOT_LOGGED_IN_MESSAGE Please log in first
+CONVERSATION_TIMEOUT_MESSAGE The conversation ended, timed out or was processing another request
+BOOKING_TABLE_ITEM xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text()) \= "{0}"][normalize-space(td[1]/text()) \= "{1}"]
+BOOKING_TABLE_ITEM_LINK xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text()) \= "{0}"][normalize-space(td[1]/text()) \= "{1}"]/td[7]/a
+BOOKING_CANCELLED_MESSAGE Booking cancelled for confirmation number {0}
+BOOKING_CONFIRMATION_MESSAGE Thank you, {0}, your confimation number for {1} is \\d+
+BOOKING_INVALID_DATE_MESSAGE1 Check out date must be later than check in date
+BOOKING_INVALID_DATE_MESSAGE2 Check in date must be a future date
+WORKSPACE_BOOKING_TEXT Book hotel: {0}
+WORKSPACE_VIEW_TEXT View hotel: {0}
+WORKSPACE_TABLE_LINK_BY_ID id=ConversationListForm:ConversationListDataTable:{0}:EntryDescriptionLink
+WORKSPACE_TABLE_ROW_COUNT = xpath=//table[@id\='ConversationListForm\:ConversationListDataTable']/tbody/tr
+SPINNER id\=main\:Spinner
\ No newline at end of file
Modified: branches/enterprise/WFK-2_1/examples/itext/README.html
===================================================================
--- branches/enterprise/WFK-2_1/examples/itext/README.html 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/itext/README.html 2013-09-13 14:11:17 UTC (rev 15588)
@@ -1,6 +1,6 @@
<h1>Seam iText Example</h1>
-<p>This example demonstrates the Seam PDF functionality.</p>
+<p>This example demonstrates the Seam PDF functionality. </p>
<h2>Running the example</h2>
@@ -9,27 +9,25 @@
<ol>
<li><p>In the example root directory run:</p>
-<pre><code> mvn clean install
+<pre><code>mvn clean install
</code></pre></li>
<li><p>Set JBOSS_HOME environment property.</p></li>
<li><p>In the itext-ear directory run:</p>
-<pre><code> mvn jboss-as:deploy
+<pre><code>mvn jboss-as:deploy
</code></pre></li>
<li><p>Open this URL in a web browser: http://localhost:8080/seam-itext</p></li>
</ol>
-
<h2>Testing the example</h2>
-<p>This example is covered by integration tests. All tests use the following technologies:</p>
+<p>This example is covered by integration and functional tests. All tests use the following technologies:</p>
<ul>
<li><strong>Arquillian</strong> - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,</li>
<li><strong>ShrinkWrap</strong> - to create the test archive (WAR).</li>
</ul>
-
<h3>Integration tests</h3>
<p>Integration tests cover core application logic and reside in the EJB module. In addition to Arquillian and ShrinkWrap, the integration tests also use:</p>
@@ -39,9 +37,8 @@
<li><strong>ShrinkWrap Resolver</strong> - to resolve dependencies of the project for packaging in the test archive.</li>
</ul>
+<p>The tests are executed in Maven's test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-<p>The tests are executed in Maven’s test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-
<pre><code>mvn clean test -Darquillian=jbossas-managed-7
</code></pre>
@@ -52,6 +49,41 @@
<pre><code>mvn clean test -Darquillian=jbossas-remote-7
</code></pre>
+<h3>Functional tests</h3>
+
+<p>Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:</p>
+
+<ul>
+<li><strong>Arquillian Graphene Extension</strong> - an advanced Ajax-capable type-safe Selenium-based browser testing tool,</li>
+<li><strong>Arquillian Drone Extension</strong> - to automatically run and stop browser instances.</li>
+</ul>
+
+<p><em>Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server.</em></p>
+
+<p>Run the functional test on JBoss AS instance with</p>
+
+<pre><code>mvn -f itext-ftest/pom.xml clean test
+</code></pre>
+
+<p>The <code>JBOSS_HOME</code> environment variable must be set and point to a JBoss AS instance directory.</p>
+
+<p>Several variables can be configured:</p>
+
+<ul>
+<li><p>path to an alternative archive for testing</p>
+
+<pre><code>-DtestDeployment=/path/to/archive.ear
+</code></pre></li>
+<li><p>the browser to use for testing</p>
+
+<pre><code>-DbrowserCapabilities=htmlUnit
+</code></pre></li>
+<li><p>test on a running server</p>
+
+<pre><code>-Dremote
+</code></pre></li>
+</ul>
+
<h2>Testing in JBDS</h2>
<h3>Integration tests</h3>
@@ -60,11 +92,20 @@
<li>Open JBDS and start a configured instance of JBoss AS</li>
<li>Import the example project and its submodules</li>
<li>In the <em>Project Explorer</em>, select the EJB module project, then
-
<ol>
<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and check <code>integration-tests</code> and <code>arq-jbossas-7-remote</code></li>
<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-</li>
+
+<h3>Functional tests</h3>
+
+<ol>
+<li>Open JBDS and start a configured instance of JBoss AS</li>
+<li>Import the <code>ftest</code> project of the example</li>
+<li>In the <em>Project Explorer</em>, select the ftest project, then
+<ol>
+<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and activate <code>arq-jbossas-7-remote</code> profile and deactivate <code>arq-jbossas-7-managed</code> profile</li>
+<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-
Modified: branches/enterprise/WFK-2_1/examples/itext/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/itext/README.md 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/itext/README.md 2013-09-13 14:11:17 UTC (rev 15588)
@@ -24,7 +24,7 @@
Testing the example
-------------------
-This example is covered by integration tests. All tests use the following technologies:
+This example is covered by integration and functional tests. All tests use the following technologies:
* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
* __ShrinkWrap__ - to create the test archive (WAR).
@@ -47,7 +47,35 @@
mvn clean test -Darquillian=jbossas-remote-7
+### Functional tests
+Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:
+
+* __Arquillian Graphene Extension__ - an advanced Ajax-capable type-safe Selenium-based browser testing tool,
+* __Arquillian Drone Extension__ - to automatically run and stop browser instances.
+
+_Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server._
+
+Run the functional test on JBoss AS instance with
+
+ mvn -f itext-ftest/pom.xml clean test
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+Several variables can be configured:
+
+* path to an alternative archive for testing
+
+ -DtestDeployment=/path/to/archive.ear
+
+* the browser to use for testing
+
+ -DbrowserCapabilities=htmlUnit
+
+* test on a running server
+
+ -Dremote
+
Testing in JBDS
---------------
### Integration tests
@@ -57,3 +85,11 @@
3. In the _Project Explorer_, select the EJB module project, then
1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and check `integration-tests` and `arq-jbossas-7-remote`
2. Right-click the module and select _Run As_ - _JUnit Test_
+
+### Functional tests
+
+1. Open JBDS and start a configured instance of JBoss AS
+2. Import the `ftest` project of the example
+3. In the _Project Explorer_, select the ftest project, then
+ 1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and activate `arq-jbossas-7-remote` profile and deactivate `arq-jbossas-7-managed` profile
+ 2. Right-click the module and select _Run As_ - _JUnit Test_
Added: branches/enterprise/WFK-2_1/examples/itext/itext-ftest/pom.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/itext/itext-ftest/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/itext/itext-ftest/src/test/java/org/jboss/seam/example/itext/test/graphene/ItextFunctionalTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/itext/itext-ftest/src/test/java/org/jboss/seam/example/itext/test/graphene/ItextFunctionalTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/itext/itext-ftest/src/test/java/org/jboss/seam/example/itext/test/graphene/ItextFunctionalTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,31 @@
+package org.jboss.seam.example.itext.test.graphene;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.example.common.test.DeploymentResolver;
+import org.jboss.seam.example.common.test.SeamGrapheneTest;
+import org.jboss.shrinkwrap.api.Archive;
+import static org.junit.Assert.*;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class ItextFunctionalTest extends SeamGrapheneTest {
+
+ public static final String HOME_PAGE_TITLE = "Seam PDF";
+
+ @Deployment(testable = false)
+ public static Archive<?> createDeployment() {
+ return DeploymentResolver.createDeployment();
+ }
+
+ /**
+ * Place holder - just verifies that example deploys
+ */
+ @Test
+ public void homePageLoadTest() {
+ assertEquals("Unexpected page title.", HOME_PAGE_TITLE, browser.getTitle());
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/itext/itext-ftest/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/itext/itext-ftest/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Modified: branches/enterprise/WFK-2_1/examples/jee6/README.html
===================================================================
--- branches/enterprise/WFK-2_1/examples/jee6/README.html 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/jee6/README.html 2013-09-13 14:11:17 UTC (rev 15588)
@@ -11,27 +11,25 @@
<ol>
<li><p>In the example root directory run:</p>
-<pre><code> mvn clean install
+<pre><code>mvn clean install
</code></pre></li>
<li><p>Set JBOSS_HOME environment property.</p></li>
<li><p>In the jee6-web directory run:</p>
-<pre><code> mvn jboss-as:deploy
+<pre><code>mvn jboss-as:deploy
</code></pre></li>
<li><p>Open this URL in a web browser: http://localhost:8080/jee6-web</p></li>
</ol>
-
<h2>Testing the example</h2>
-<p>This example is covered by integration tests. All tests use the following technologies:</p>
+<p>This example is covered by integration and functional tests. All tests use the following technologies:</p>
<ul>
<li><strong>Arquillian</strong> - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,</li>
<li><strong>ShrinkWrap</strong> - to create the test archive (WAR).</li>
</ul>
-
<h3>Integration tests</h3>
<p>Integration tests cover core application logic and reside in the EJB module. In addition to Arquillian and ShrinkWrap, the integration tests also use:</p>
@@ -41,9 +39,8 @@
<li><strong>ShrinkWrap Resolver</strong> - to resolve dependencies of the project for packaging in the test archive.</li>
</ul>
+<p>The tests are executed in Maven's test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-<p>The tests are executed in Maven’s test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-
<pre><code>mvn clean test -Darquillian=jbossas-managed-7
</code></pre>
@@ -54,6 +51,41 @@
<pre><code>mvn clean test -Darquillian=jbossas-remote-7
</code></pre>
+<h3>Functional tests</h3>
+
+<p>Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:</p>
+
+<ul>
+<li><strong>Arquillian Graphene Extension</strong> - an advanced Ajax-capable type-safe Selenium-based browser testing tool,</li>
+<li><strong>Arquillian Drone Extension</strong> - to automatically run and stop browser instances.</li>
+</ul>
+
+<p><em>Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server.</em></p>
+
+<p>Run the functional test on JBoss AS instance with</p>
+
+<pre><code>mvn -f jee6-ftest/pom.xml clean test
+</code></pre>
+
+<p>The <code>JBOSS_HOME</code> environment variable must be set and point to a JBoss AS instance directory.</p>
+
+<p>Several variables can be configured:</p>
+
+<ul>
+<li><p>path to an alternative archive for testing</p>
+
+<pre><code>-DtestDeployment=/path/to/archive.ear
+</code></pre></li>
+<li><p>the browser to use for testing</p>
+
+<pre><code>-DbrowserCapabilities=htmlUnit
+</code></pre></li>
+<li><p>test on a running server</p>
+
+<pre><code>-Dremote
+</code></pre></li>
+</ul>
+
<h2>Testing in JBDS</h2>
<h3>Integration tests</h3>
@@ -62,11 +94,12 @@
<li>Open JBDS and start a configured instance of JBoss AS</li>
<li>Import the example project and its submodules</li>
<li>In the <em>Project Explorer</em>, select the Web module project, then
-
<ol>
<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and check <code>integration-tests</code> and <code>arq-jbossas-7-remote</code></li>
<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-</li>
-</ol>
+<h3>Functional tests</h3>
+
+<p>It is not possible to run the functional tests of this example in JBDS, because they use the maven-dependency-plugin to copy test classes from a different maven artifact, which is not a configuration supported by JBDS.</p>
Modified: branches/enterprise/WFK-2_1/examples/jee6/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/jee6/README.md 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/jee6/README.md 2013-09-13 14:11:17 UTC (rev 15588)
@@ -26,7 +26,7 @@
Testing the example
-------------------
-This example is covered by integration tests. All tests use the following technologies:
+This example is covered by integration and functional tests. All tests use the following technologies:
* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
* __ShrinkWrap__ - to create the test archive (WAR).
@@ -49,6 +49,35 @@
mvn clean test -Darquillian=jbossas-remote-7
+### Functional tests
+
+Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:
+
+* __Arquillian Graphene Extension__ - an advanced Ajax-capable type-safe Selenium-based browser testing tool,
+* __Arquillian Drone Extension__ - to automatically run and stop browser instances.
+
+_Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server._
+
+Run the functional test on JBoss AS instance with
+
+ mvn -f jee6-ftest/pom.xml clean test
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+Several variables can be configured:
+
+* path to an alternative archive for testing
+
+ -DtestDeployment=/path/to/archive.ear
+
+* the browser to use for testing
+
+ -DbrowserCapabilities=htmlUnit
+
+* test on a running server
+
+ -Dremote
+
Testing in JBDS
---------------
### Integration tests
@@ -58,3 +87,7 @@
3. In the _Project Explorer_, select the Web module project, then
1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and check `integration-tests` and `arq-jbossas-7-remote`
2. Right-click the module and select _Run As_ - _JUnit Test_
+
+### Functional tests
+
+It is not possible to run the functional tests of this example in JBDS, because they use the maven-dependency-plugin to copy test classes from a different maven artifact, which is not a configuration supported by JBDS.
\ No newline at end of file
Added: branches/enterprise/WFK-2_1/examples/jee6/jee6-ftest/pom.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/jee6/jee6-ftest/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/jee6/jee6-ftest/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/jee6/jee6-ftest/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/jee6/jee6-ftest/src/test/resources/ftest.properties
===================================================================
--- branches/enterprise/WFK-2_1/examples/jee6/jee6-ftest/src/test/resources/ftest.properties (rev 0)
+++ branches/enterprise/WFK-2_1/examples/jee6/jee6-ftest/src/test/resources/ftest.properties 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,84 @@
+ #
+ # 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.
+ #
+HOME_PAGE /home.seam
+MAIN_PAGE /main.seam
+PAGE_TITLE JBoss Suites: Seam Framework
+LOGIN_USERNAME_FIELD id=login:username
+LOGIN_PASSWORD_FIELD id=login:password
+LOGIN_SUBMIT id=login:login
+LOGOUT id=logout
+PASSWORD_UPDATED_MESSAGE Password updated
+PASSWORD_REENTER_MESSAGE Re-enter new password
+PASSWORD_VALUE_REQUIRED_MESSAGE xpath=//span[text() = 'value is required']
+PASSWORD_LENGTH_MESSAGE size must be between
+PASSWORD_PASSWORD id=setpassword:PasswordDecorate:password
+PASSWORD_VERIFY id=setpassword:VerifyDecorate:verify
+PASSWORD_SUBMIT id=setpassword:change
+SETTINGS id=settings
+SEARCH_STRING_FIELD id=searchCriteria:searchString
+SEARCH_SUBMIT id=searchCriteria:findHotels
+NO_HOTELS_FOUND id=NoHotelsFoundMessage
+SEARCH_RESULT_TABLE xpath=//table[@id = 'hotels']/tbody
+SEARCH_RESULT_TABLE_FIRST_ROW_LINK id=hotels:0:viewHotel
+BOOKING_BOOK id=hotel:bookHotel
+BOOKING_CANCEL id=hotel:cancel
+HOTEL_BED_FIELD id=booking:bedsDecorate:beds
+HOTEL_BED_FIELD_SELECT_CRITERIA value=
+HOTEL_CHECKIN_DATE_FIELD id=booking:checkinDateDecorate:checkinDateInputDate
+HOTEL_CHECKIN_DATE_MESSAGE id=booking:checkinDateDecorate:message
+HOTEL_CHECKOUT_DATE_FIELD id=booking:checkoutDateDecorate:checkoutDateInputDate
+HOTEL_CHECKOUT_DATE_MESSAGE id=booking:checkoutDateDecorate:message
+HOTEL_SMOKING_1 id=booking:smokingDecorate:smoking:0
+HOTEL_SMOKING_2 id=booking:smokingDecorate:smoking:1
+HOTEL_CREDIT_CARD id=booking:creditCardDecorate:creditCard
+HOTEL_CREDIT_CARD_NAME id=booking:creditCardNameDecorate:creditCardName
+HOTEL_PROCEED id=booking:proceed
+HOTEL_CANCEL id=booking:cancel
+HOTEL_CONFIRM id=confirm:confirm
+HOTEL_MESSAGE xpath=//ul[@id='messages']/li
+REGISTRATION id=login:register
+REGISTRATION_USERNAME id=registration:usernameDecorate:username
+REGISTRATION_USERNAME_MESSAGE id=registration:usernameDecorate:message
+REGISTRATION_NAME id=registration:nameDecorate:name
+REGISTRATION_NAME_MESSAGE id=registration:nameDecorate:message
+REGISTRATION_PASSWORD id=registration:passwordDecorate:password
+REGISTRATION_PASSWORD_MESSAGE id=registration:passwordDecorate:message
+REGISTRATION_VERIFY id=registration:verifyDecorate:verify
+REGISTRATION_VERIFY_MESSAGE id=registration:verifyDecorate:message
+REGISTRATION_SUBMIT id=registration:register
+REGISTRATION_REENTER_MESSAGE Re-enter your password
+REGISTRATION_LENGTH_MESSAGE size must be between
+REGISTRATION_SUCCESSFUL_MESSAGE Successfully registered as {0}
+REGISTRATION_USER_EXISTS_MESSAGE Username {0} already exists
+NOT_LOGGED_IN_MESSAGE Please log in first
+CONVERSATION_TIMEOUT_MESSAGE The conversation ended, timed out or was processing another request
+BOOKING_TABLE_ITEM xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text()) \= "{0}"][normalize-space(td[1]/text()) \= "{1}"]
+BOOKING_TABLE_ITEM_LINK xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text()) \= "{0}"][normalize-space(td[1]/text()) \= "{1}"]/td[7]/a
+BOOKING_CANCELLED_MESSAGE Booking cancelled for confirmation number {0}
+BOOKING_CONFIRMATION_MESSAGE Thank you, {0}, your confimation number for {1} is \\d+
+BOOKING_INVALID_DATE_MESSAGE1 Check out date must be later than check in date
+BOOKING_INVALID_DATE_MESSAGE2 Check in date must be a future date
+WORKSPACE_BOOKING_TEXT Book hotel: {0}
+WORKSPACE_VIEW_TEXT View hotel: {0}
+WORKSPACE_TABLE_LINK_BY_ID id=ConversationListForm:ConversationListDataTable:{0}:EntryDescriptionLink
+WORKSPACE_TABLE_ROW_COUNT xpath=//table[@id='ConversationListForm:ConversationListDataTable']/tbody/tr
+SPINNER id\=searchCriteria\:SpinnerGif
Modified: branches/enterprise/WFK-2_1/examples/jpa/README.html
===================================================================
--- branches/enterprise/WFK-2_1/examples/jpa/README.html 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/jpa/README.html 2013-09-13 14:11:17 UTC (rev 15588)
@@ -9,17 +9,16 @@
<ol>
<li><p>In the example root directory run:</p>
-<pre><code> mvn clean install
+<pre><code>mvn clean install
</code></pre></li>
<li><p>Set JBOSS_HOME environment property.</p></li>
<li><p>In the jpa-web directory run:</p>
-<pre><code> mvn jboss-as:deploy
+<pre><code>mvn jboss-as:deploy
</code></pre></li>
<li><p>Open this URL in a web browser: http://localhost:8080/jpa-web</p></li>
</ol>
-
<h2>Testing the example</h2>
<p>This example is covered by integration and functional tests. All tests use the following technologies:</p>
@@ -29,7 +28,6 @@
<li><strong>ShrinkWrap</strong> - to create the test archive (WAR).</li>
</ul>
-
<h3>Integration tests</h3>
<p>Integration tests cover core application logic and reside in the EJB module. In addition to Arquillian and ShrinkWrap, the integration tests also use:</p>
@@ -39,9 +37,8 @@
<li><strong>ShrinkWrap Resolver</strong> - to resolve dependencies of the project for packaging in the test archive.</li>
</ul>
+<p>The tests are executed in Maven's test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-<p>The tests are executed in Maven’s test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-
<pre><code>mvn clean test -Darquillian=jbossas-managed-7
</code></pre>
@@ -52,6 +49,41 @@
<pre><code>mvn clean test -Darquillian=jbossas-remote-7
</code></pre>
+<h3>Functional tests</h3>
+
+<p>Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:</p>
+
+<ul>
+<li><strong>Arquillian Graphene Extension</strong> - an advanced Ajax-capable type-safe Selenium-based browser testing tool,</li>
+<li><strong>Arquillian Drone Extension</strong> - to automatically run and stop browser instances.</li>
+</ul>
+
+<p><em>Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server.</em></p>
+
+<p>Run the functional test on JBoss AS instance with</p>
+
+<pre><code>mvn -f jpa-ftest/pom.xml clean test
+</code></pre>
+
+<p>The <code>JBOSS_HOME</code> environment variable must be set and point to a JBoss AS instance directory.</p>
+
+<p>Several variables can be configured:</p>
+
+<ul>
+<li><p>path to an alternative archive for testing</p>
+
+<pre><code>-DtestDeployment=/path/to/archive.ear
+</code></pre></li>
+<li><p>the browser to use for testing</p>
+
+<pre><code>-DbrowserCapabilities=htmlUnit
+</code></pre></li>
+<li><p>test on a running server</p>
+
+<pre><code>-Dremote
+</code></pre></li>
+</ul>
+
<h2>Testing in JBDS</h2>
<h3>Integration tests</h3>
@@ -60,11 +92,12 @@
<li>Open JBDS and start a configured instance of JBoss AS</li>
<li>Import the example project and its submodules</li>
<li>In the <em>Project Explorer</em>, select the Web module project, then
-
<ol>
<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and check <code>integration-tests</code> and <code>arq-jbossas-7-remote</code></li>
<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-</li>
-</ol>
+<h3>Functional tests</h3>
+
+<p>It is not possible to run the functional tests of this example in JBDS, because they use the maven-dependency-plugin to copy test classes from a different maven artifact, which is not a configuration supported by JBDS.</p>
Modified: branches/enterprise/WFK-2_1/examples/jpa/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/jpa/README.md 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/jpa/README.md 2013-09-13 14:11:17 UTC (rev 15588)
@@ -47,6 +47,35 @@
mvn clean test -Darquillian=jbossas-remote-7
+### Functional tests
+
+Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:
+
+* __Arquillian Graphene Extension__ - an advanced Ajax-capable type-safe Selenium-based browser testing tool,
+* __Arquillian Drone Extension__ - to automatically run and stop browser instances.
+
+_Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server._
+
+Run the functional test on JBoss AS instance with
+
+ mvn -f jpa-ftest/pom.xml clean test
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+Several variables can be configured:
+
+* path to an alternative archive for testing
+
+ -DtestDeployment=/path/to/archive.ear
+
+* the browser to use for testing
+
+ -DbrowserCapabilities=htmlUnit
+
+* test on a running server
+
+ -Dremote
+
Testing in JBDS
---------------
### Integration tests
@@ -56,3 +85,7 @@
3. In the _Project Explorer_, select the Web module project, then
1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and check `integration-tests` and `arq-jbossas-7-remote`
2. Right-click the module and select _Run As_ - _JUnit Test_
+
+### Functional tests
+
+It is not possible to run the functional tests of this example in JBDS, because they use the maven-dependency-plugin to copy test classes from a different maven artifact, which is not a configuration supported by JBDS.
\ No newline at end of file
Added: branches/enterprise/WFK-2_1/examples/jpa/jpa-ftest/pom.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/jpa/jpa-ftest/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/jpa/jpa-ftest/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/jpa/jpa-ftest/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/jpa/jpa-ftest/src/test/resources/ftest.properties
===================================================================
--- branches/enterprise/WFK-2_1/examples/jpa/jpa-ftest/src/test/resources/ftest.properties (rev 0)
+++ branches/enterprise/WFK-2_1/examples/jpa/jpa-ftest/src/test/resources/ftest.properties 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,84 @@
+ #
+ # 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.
+ #
+HOME_PAGE /home.seam
+MAIN_PAGE /main.seam
+PAGE_TITLE JBoss Suites: Seam Framework
+LOGIN_USERNAME_FIELD id=login:username
+LOGIN_PASSWORD_FIELD id=login:password
+LOGIN_SUBMIT id=login:login
+LOGOUT id=logout
+PASSWORD_UPDATED_MESSAGE Password updated
+PASSWORD_REENTER_MESSAGE verify
+PASSWORD_VALUE_REQUIRED_MESSAGE xpath=//*[@id='setpassword:Message' or @id='setpassword:PasswordDecorate:Message']
+PASSWORD_LENGTH_MESSAGE size must be between
+PASSWORD_PASSWORD id=setpassword:PasswordDecorate:password
+PASSWORD_VERIFY id=setpassword:VerifyDecorate:verify
+PASSWORD_SUBMIT id=setpassword:change
+SETTINGS id=settings
+SEARCH_STRING_FIELD id=main:searchString
+SEARCH_SUBMIT id=main:findHotels
+NO_HOTELS_FOUND id=NoHotelsFoundMessage
+SEARCH_RESULT_TABLE xpath=//table[@id = 'hotels']/tbody
+SEARCH_RESULT_TABLE_FIRST_ROW_LINK id=hotels:0:viewHotel
+BOOKING_BOOK id=hotel:bookHotel
+BOOKING_CANCEL id=hotel:cancel
+HOTEL_BED_FIELD id=booking:bedsDecorate:beds
+HOTEL_BED_FIELD_SELECT_CRITERIA value=
+HOTEL_CHECKIN_DATE_FIELD id=booking:checkinDateDecorate:checkinDateInputDate
+HOTEL_CHECKIN_DATE_MESSAGE xpath=//*[@id='booking:Message' or @id='booking:checkinDateDecorate:Message']
+HOTEL_CHECKOUT_DATE_FIELD id=booking:checkoutDateDecorate:checkoutDateInputDate
+HOTEL_CHECKOUT_DATE_MESSAGE xpath=//*[@id='booking:Message' or @id='booking:checkoutDateDecorate:Message']
+HOTEL_SMOKING_1 id=booking:smokingDecorate:smoking:0
+HOTEL_SMOKING_2 id=booking:smokingDecorate:smoking:1
+HOTEL_CREDIT_CARD id=booking:creditCardDecorate:creditCard
+HOTEL_CREDIT_CARD_NAME id=booking:creditCardNameDecorate:creditCardName
+HOTEL_PROCEED id=booking:proceed
+HOTEL_CANCEL id=booking:cancel
+HOTEL_CONFIRM id=confirm:confirm
+HOTEL_MESSAGE xpath=//ul[@id='main:messages']/li
+REGISTRATION id=login:register
+REGISTRATION_USERNAME id=register:usernameDecorate:username
+REGISTRATION_USERNAME_MESSAGE id=register:usernameDecorate:message
+REGISTRATION_NAME id=register:nameDecorate:name
+REGISTRATION_NAME_MESSAGE id=register:nameDecorate:message
+REGISTRATION_PASSWORD id=register:passwordDecorate:password
+REGISTRATION_PASSWORD_MESSAGE id=register:passwordDecorate:message
+REGISTRATION_VERIFY id=register:verifyDecorate:verify
+REGISTRATION_VERIFY_MESSAGE id=register:verifyDecorate:message
+REGISTRATION_SUBMIT id=register:register
+REGISTRATION_REENTER_MESSAGE verify
+REGISTRATION_LENGTH_MESSAGE size must be between
+REGISTRATION_SUCCESSFUL_MESSAGE Successfully registered as {0}
+REGISTRATION_USER_EXISTS_MESSAGE Username {0} already exists
+NOT_LOGGED_IN_MESSAGE Please log in first
+CONVERSATION_TIMEOUT_MESSAGE The conversation ended, timed out or was processing another request
+BOOKING_TABLE_ITEM xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text()) \= "{0}"][normalize-space(td[1]/text()) \= "{1}"]
+BOOKING_TABLE_ITEM_LINK xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text()) \= "{0}"][normalize-space(td[1]/text()) \= "{1}"]/td[7]/a
+BOOKING_CANCELLED_MESSAGE Booking cancelled for confirmation number {0}
+BOOKING_CONFIRMATION_MESSAGE Thank you, {0}, your confimation number for {1} is \\d+
+BOOKING_INVALID_DATE_MESSAGE1 Check out date must be later than check in date
+BOOKING_INVALID_DATE_MESSAGE2 Check in date must be a future date
+WORKSPACE_BOOKING_TEXT Book hotel: {0}
+WORKSPACE_VIEW_TEXT View hotel: {0}
+WORKSPACE_TABLE_LINK_BY_ID id=ConversationListForm:ConversationListDataTable:{0}:EntryDescriptionLink
+WORKSPACE_TABLE_ROW_COUNT xpath=//table[@id\='ConversationListForm\:ConversationListDataTable']/tbody/tr
+SPINNER id\=main\:SpinnerGif
Modified: branches/enterprise/WFK-2_1/examples/mail/README.html
===================================================================
--- branches/enterprise/WFK-2_1/examples/mail/README.html 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/mail/README.html 2013-09-13 14:11:17 UTC (rev 15588)
@@ -10,27 +10,25 @@
<ol>
<li><p>In the example root directory run:</p>
-<pre><code> mvn clean install
+<pre><code>mvn clean install
</code></pre></li>
<li><p>Set JBOSS_HOME environment property.</p></li>
<li><p>In the mail-ear directory run:</p>
-<pre><code> mvn jboss-as:deploy
+<pre><code>mvn jboss-as:deploy
</code></pre></li>
<li><p>Open this URL in a web browser: http://localhost:8080/seam-mail</p></li>
</ol>
-
<h2>Testing the example</h2>
-<p>This example is covered by integration tests. All tests use the following technologies:</p>
+<p>This example is covered by integration and functional tests. All tests use the following technologies:</p>
<ul>
<li><strong>Arquillian</strong> - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,</li>
<li><strong>ShrinkWrap</strong> - to create the test archive (WAR).</li>
</ul>
-
<h3>Integration tests</h3>
<p>Integration tests cover core application logic and reside in the EJB module. In addition to Arquillian and ShrinkWrap, the integration tests also use:</p>
@@ -40,9 +38,8 @@
<li><strong>ShrinkWrap Resolver</strong> - to resolve dependencies of the project for packaging in the test archive.</li>
</ul>
+<p>The tests are executed in Maven's test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-<p>The tests are executed in Maven’s test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-
<pre><code>mvn clean test -Darquillian=jbossas-managed-7
</code></pre>
@@ -53,6 +50,41 @@
<pre><code>mvn clean test -Darquillian=jbossas-remote-7
</code></pre>
+<h3>Functional tests</h3>
+
+<p>Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:</p>
+
+<ul>
+<li><strong>Arquillian Graphene Extension</strong> - an advanced Ajax-capable type-safe Selenium-based browser testing tool,</li>
+<li><strong>Arquillian Drone Extension</strong> - to automatically run and stop browser instances.</li>
+</ul>
+
+<p><em>Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server.</em></p>
+
+<p>Run the functional test on JBoss AS instance with</p>
+
+<pre><code>mvn -f mail-ftest/pom.xml clean test
+</code></pre>
+
+<p>The <code>JBOSS_HOME</code> environment variable must be set and point to a JBoss AS instance directory.</p>
+
+<p>Several variables can be configured:</p>
+
+<ul>
+<li><p>path to an alternative archive for testing</p>
+
+<pre><code>-DtestDeployment=/path/to/archive.ear
+</code></pre></li>
+<li><p>the browser to use for testing</p>
+
+<pre><code>-DbrowserCapabilities=htmlUnit
+</code></pre></li>
+<li><p>test on a running server</p>
+
+<pre><code>-Dremote
+</code></pre></li>
+</ul>
+
<h2>Testing in JBDS</h2>
<h3>Integration tests</h3>
@@ -61,11 +93,20 @@
<li>Open JBDS and start a configured instance of JBoss AS</li>
<li>Import the example project and its submodules</li>
<li>In the <em>Project Explorer</em>, select the EJB module project, then
-
<ol>
<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and check <code>integration-tests</code> and <code>arq-jbossas-7-remote</code></li>
<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-</li>
+
+<h3>Functional tests</h3>
+
+<ol>
+<li>Open JBDS and start a configured instance of JBoss AS</li>
+<li>Import the <code>ftest</code> project of the example</li>
+<li>In the <em>Project Explorer</em>, select the ftest project, then
+<ol>
+<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and activate <code>arq-jbossas-7-remote</code> profile and deactivate <code>arq-jbossas-7-managed</code> profile</li>
+<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-
Modified: branches/enterprise/WFK-2_1/examples/mail/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/mail/README.md 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/mail/README.md 2013-09-13 14:11:17 UTC (rev 15588)
@@ -25,7 +25,7 @@
Testing the example
-------------------
-This example is covered by integration tests. All tests use the following technologies:
+This example is covered by integration and functional tests. All tests use the following technologies:
* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
* __ShrinkWrap__ - to create the test archive (WAR).
@@ -48,7 +48,35 @@
mvn clean test -Darquillian=jbossas-remote-7
+### Functional tests
+Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:
+
+* __Arquillian Graphene Extension__ - an advanced Ajax-capable type-safe Selenium-based browser testing tool,
+* __Arquillian Drone Extension__ - to automatically run and stop browser instances.
+
+_Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server._
+
+Run the functional test on JBoss AS instance with
+
+ mvn -f mail-ftest/pom.xml clean test
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+Several variables can be configured:
+
+* path to an alternative archive for testing
+
+ -DtestDeployment=/path/to/archive.ear
+
+* the browser to use for testing
+
+ -DbrowserCapabilities=htmlUnit
+
+* test on a running server
+
+ -Dremote
+
Testing in JBDS
---------------
### Integration tests
@@ -59,3 +87,10 @@
1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and check `integration-tests` and `arq-jbossas-7-remote`
2. Right-click the module and select _Run As_ - _JUnit Test_
+### Functional tests
+
+1. Open JBDS and start a configured instance of JBoss AS
+2. Import the `ftest` project of the example
+3. In the _Project Explorer_, select the ftest project, then
+ 1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and activate `arq-jbossas-7-remote` profile and deactivate `arq-jbossas-7-managed` profile
+ 2. Right-click the module and select _Run As_ - _JUnit Test_
Added: branches/enterprise/WFK-2_1/examples/mail/mail-ftest/pom.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/mail/mail-ftest/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/mail/mail-ftest/src/test/java/org/jboss/seam/example/mail/test/graphene/MailFunctionalTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/mail/mail-ftest/src/test/java/org/jboss/seam/example/mail/test/graphene/MailFunctionalTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/mail/mail-ftest/src/test/java/org/jboss/seam/example/mail/test/graphene/MailFunctionalTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,163 @@
+package org.jboss.seam.example.mail.test.graphene;
+
+import java.nio.charset.Charset;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.example.common.test.DeploymentResolver;
+import org.jboss.seam.example.common.test.SeamGrapheneTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.After;
+import static org.junit.Assert.*;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.openqa.selenium.By;
+import org.subethamail.wiser.Wiser;
+import org.subethamail.wiser.WiserMessage;
+
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class MailFunctionalTest extends SeamGrapheneTest {
+
+ @Deployment(testable = false)
+ public static Archive<?> createDeployment() {
+ return DeploymentResolver.createDeployment();
+ }
+
+ protected Wiser wiser;
+
+ private Object[][] sendMethods = new Object[][]{
+ {getBy("SEND_SIMPLE_BUTTON"), new String[]{"Content-Type: text/html; charset=" + Charset.defaultCharset().name(), "Content-Disposition: inline", "<p>Dear " + getProperty("FIRSTNAME") + ",</p>"}},
+ {getBy("SEND_PLAIN_BUTTON"), new String[]{"This is a plain text, email."}},
+ {getBy("SEND_HTML_BUTTON"), new String[]{"Subject: Seam Mail", "Content-Type: multipart/mixed;", "Content-Type: multipart/alternative;", "Content-Type: text/plain; charset=" + Charset.defaultCharset().name(), "This is the alternative text body for mail readers that don't support html", "Content-Type: text/html; charset=" + Charset.defaultCharset().name(), "<p>This is an example <i>HTML</i> email sent by Seam.</p>"}},
+ {getBy("SEND_ATTACHMENT_BUTTON"), new String[]{"Content-Type: multipart/mixed;", "Content-Type: application/octet-stream; name=jboss.jpg", "/9j/4AAQSkZJRgABA"/*jpeg start*/, "Content-Type: application/octet-stream; name=numbers.csv", "3,Three,treis,trois", "Content-Type: image/png; name=" + getProperty("FIRSTNAME") + "_" + getProperty("LASTNAME") + ".jpg", "iVBORw0KGgo" /*png start*/}},
+ {getBy("SEND_ASYNCHRONOUS_BUTTON"), new String[]{"Content-Type: multipart/mixed;", "Content-Type: text/html; charset=" + Charset.defaultCharset().name(), "Content-Disposition: inline", "<p>Dear " + getProperty("FIRSTNAME") + ",</p>"}},
+ {getBy("SEND_TEMPLATE_BUTTON"), new String[]{"Subject: Templating with Seam Mail", "Content-Type: multipart/mixed;", "Content-Type: multipart/alternative;", "Content-Type: text/plain; charset=" + Charset.defaultCharset().name(), "Sorry, your mail reader doesn't support html.", "Content-Type: text/html; charset=" + Charset.defaultCharset().name(), "<p>Here's a dataTable</p><table>", "<td>Saturday</td>"}},
+ {getBy("SEND_SERVLET_BUTTON"), new String[]{"Content-Type: multipart/mixed;", "Content-Disposition: inline", "Dear John Smith,", "This is a plain text, email."}}
+ };
+
+ /**
+ * We restart SMTP after each Method, because Wiser doesn't have mechanism
+ * to flush received e-mails.
+ */
+ @Before
+ public void startSMTP() {
+ wiser = new Wiser();
+ wiser.setPort(3025);
+ wiser.start();
+ }
+
+ @After
+ public void stopSMTP() {
+ wiser.stop();
+ }
+
+ /**
+ * Place holder - just verifies that example deploys
+ */
+ @Test
+ public void homePageLoadTest() {
+ assertEquals("Unexpected page title.", getProperty("HOME_PAGE_TITLE"), browser.getTitle());
+ }
+
+ /**
+ * Sends a mail and verifies it was delivered
+ */
+ public void mailTest(Object[] sendMethod) {
+ // cycle sendMethods
+ By buttonToClick = (By) sendMethod[0];
+ String[] expectedMessageContents = (String[]) sendMethod[1];
+ fillInInputs();
+ sendEmail(buttonToClick);
+ checkDelivered(expectedMessageContents);
+ }
+
+ @Test
+ public void testSimple() {
+ mailTest(sendMethods[0]);
+ }
+
+ @Test
+ public void testPlain() {
+ mailTest(sendMethods[1]);
+ }
+
+ @Test
+ public void testHtml() {
+ mailTest(sendMethods[2]);
+ }
+
+ @Test
+ public void testAttachment() {
+ mailTest(sendMethods[3]);
+ }
+
+ @Test
+ public void testAsync() {
+ Object[] sendMethod = sendMethods[4];
+ By buttonToClick = (By) sendMethod[0];
+ String[] expectedMessageContents = (String[]) sendMethod[1];
+ fillInInputs();
+ sendEmail(buttonToClick);
+ // the async delay in MailExample.sendAsynchronous is 3000 ms, add 2000 ms as a buffer
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException ex) {
+ }
+ checkDelivered(expectedMessageContents);
+ }
+
+ @Test
+ public void testTemplate() {
+ mailTest(sendMethods[5]);
+ }
+
+ @Test
+ public void testServlet() {
+ mailTest(sendMethods[6]);
+ }
+
+ /**
+ * Fills in html text inputs.
+ */
+ private void fillInInputs() {
+ type(getBy("FIRSTNAME_INPUT"), getProperty("FIRSTNAME"));
+ type(getBy("LASTNAME_INPUT"), getProperty("LASTNAME"));
+ type(getBy("ADDRESS_INPUT"), getProperty("ADDRESS"));
+ type(getBy("SERVLET_NAME_INPUT"), getProperty("FIRSTNAME") + " " + getProperty("LASTNAME"));
+ type(getBy("SERVLET_ADDRESS_INPUT"), getProperty("ADDRESS"));
+ }
+
+ /**
+ * Sends an email by clicking on specified button. If the send method is
+ * asynchronous, waits for the associated action to take place. It assures
+ * that the email was sent by verifying appropriate message.
+ *
+ * @param buttonToClick
+ */
+ private void sendEmail(By buttonToClick) {
+ clickAndWaitHttp(buttonToClick);
+ if (buttonToClick.equals(getBy("SEND_ASYNCHRONOUS_BUTTON"))) {
+ assertTrue(isTextInSource("Seam Email")); // asynchronous email send produces no message, so we just check that we didn't end up on a debug page
+ } else {
+ assertTrue("Expected message about successfuly sent mail. See also JBSEAM-3769.", isTextInSource("Email sent successfully"));
+ }
+ }
+
+ /**
+ * Checks that the expected email was delivered.
+ *
+ * @param expectedMessageContents
+ */
+ private void checkDelivered(String[] expectedMessageContents) {
+ assertFalse("Expected a message", wiser.getMessages().isEmpty());
+ WiserMessage message = wiser.getMessages().get(0); // although "send plain text" example sends 3 mails (To:, CC:, Bcc:) Wiser cannot distinquish between them so we just check the first mail.
+ assertEquals(getProperty("ADDRESS"), message.getEnvelopeReceiver());
+ assertTrue("Envelope sender (" + message.getEnvelopeSender() + ") doesn't match expected one (" + getProperty("ENVELOPE_SENDER") + ")", message.getEnvelopeSender().matches(getProperty("ENVELOPE_SENDER")));
+
+ for (String expectedMessageContent : expectedMessageContents) {
+ assertTrue("Didn't find expected text (" + expectedMessageContent + ") in the received email.", new String(message.getData()).contains(expectedMessageContent));
+ }
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/mail/mail-ftest/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/mail/mail-ftest/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/mail/mail-ftest/src/test/resources/ftest.properties
===================================================================
--- branches/enterprise/WFK-2_1/examples/mail/mail-ftest/src/test/resources/ftest.properties (rev 0)
+++ branches/enterprise/WFK-2_1/examples/mail/mail-ftest/src/test/resources/ftest.properties 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,18 @@
+HOME_PAGE index.seam
+HOME_PAGE_TITLE Seam Mail
+ENVELOPE_SENDER peter@example.com|do-not-reply(a)jboss.com
+FIRSTNAME_INPUT id=emailform:firstname
+FIRSTNAME John
+LASTNAME_INPUT id=emailform:lastname
+LASTNAME Smith
+ADDRESS_INPUT id=emailform:address
+ADDRESS john.smith@localhost
+SERVLET_NAME_INPUT id=name
+SERVLET_ADDRESS_INPUT id=email
+SEND_SIMPLE_BUTTON id=emailform:sendSimple
+SEND_PLAIN_BUTTON id=emailform:sendPlain
+SEND_HTML_BUTTON id=emailform:sendHtml
+SEND_ATTACHMENT_BUTTON id=emailform:sendAttachment
+SEND_ASYNCHRONOUS_BUTTON id=emailform:sendAsynchronous
+SEND_TEMPLATE_BUTTON id=emailform:sendTemplate
+SEND_SERVLET_BUTTON id=sendServlet
Modified: branches/enterprise/WFK-2_1/examples/messages/README.html
===================================================================
--- branches/enterprise/WFK-2_1/examples/messages/README.html 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/messages/README.html 2013-09-13 14:11:17 UTC (rev 15588)
@@ -1,6 +1,6 @@
<h1>Seam Message List Example</h1>
-<p>This is a simple example of the use of @DataModel for the Seam tutorial.</p>
+<p>This is a simple example of the use of @DataModel for the Seam tutorial. </p>
<h2>Running the example</h2>
@@ -9,27 +9,25 @@
<ol>
<li><p>In the example root directory run:</p>
-<pre><code> mvn clean install
+<pre><code>mvn clean install
</code></pre></li>
<li><p>Set JBOSS_HOME environment property.</p></li>
<li><p>In the messages-ear directory run:</p>
-<pre><code> mvn jboss-as:deploy
+<pre><code>mvn jboss-as:deploy
</code></pre></li>
<li><p>Open this URL in a web browser: http://localhost:8080/seam-messages</p></li>
</ol>
-
<h2>Testing the example</h2>
-<p>This example is covered by integration tests. All tests use the following technologies:</p>
+<p>This example is covered by integration and functional tests. All tests use the following technologies:</p>
<ul>
<li><strong>Arquillian</strong> - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,</li>
<li><strong>ShrinkWrap</strong> - to create the test archive (WAR).</li>
</ul>
-
<h3>Integration tests</h3>
<p>Integration tests cover core application logic and reside in the EJB module. In addition to Arquillian and ShrinkWrap, the integration tests also use:</p>
@@ -39,9 +37,8 @@
<li><strong>ShrinkWrap Resolver</strong> - to resolve dependencies of the project for packaging in the test archive.</li>
</ul>
+<p>The tests are executed in Maven's test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-<p>The tests are executed in Maven’s test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-
<pre><code>mvn clean test -Darquillian=jbossas-managed-7
</code></pre>
@@ -52,6 +49,41 @@
<pre><code>mvn clean test -Darquillian=jbossas-remote-7
</code></pre>
+<h3>Functional tests</h3>
+
+<p>Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:</p>
+
+<ul>
+<li><strong>Arquillian Graphene Extension</strong> - an advanced Ajax-capable type-safe Selenium-based browser testing tool,</li>
+<li><strong>Arquillian Drone Extension</strong> - to automatically run and stop browser instances.</li>
+</ul>
+
+<p><em>Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server.</em></p>
+
+<p>Run the functional test on JBoss AS instance with</p>
+
+<pre><code>mvn -f messages-ftest/pom.xml clean test
+</code></pre>
+
+<p>The <code>JBOSS_HOME</code> environment variable must be set and point to a JBoss AS instance directory.</p>
+
+<p>Several variables can be configured:</p>
+
+<ul>
+<li><p>path to an alternative archive for testing</p>
+
+<pre><code>-DtestDeployment=/path/to/archive.ear
+</code></pre></li>
+<li><p>the browser to use for testing</p>
+
+<pre><code>-DbrowserCapabilities=htmlUnit
+</code></pre></li>
+<li><p>test on a running server</p>
+
+<pre><code>-Dremote
+</code></pre></li>
+</ul>
+
<h2>Testing in JBDS</h2>
<h3>Integration tests</h3>
@@ -60,11 +92,20 @@
<li>Open JBDS and start a configured instance of JBoss AS</li>
<li>Import the example project and its submodules</li>
<li>In the <em>Project Explorer</em>, select the EJB module project, then
-
<ol>
<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and check <code>integration-tests</code> and <code>arq-jbossas-7-remote</code></li>
<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-</li>
+
+<h3>Functional tests</h3>
+
+<ol>
+<li>Open JBDS and start a configured instance of JBoss AS</li>
+<li>Import the <code>ftest</code> project of the example</li>
+<li>In the <em>Project Explorer</em>, select the ftest project, then
+<ol>
+<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and activate <code>arq-jbossas-7-remote</code> profile and deactivate <code>arq-jbossas-7-managed</code> profile</li>
+<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-
Modified: branches/enterprise/WFK-2_1/examples/messages/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/messages/README.md 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/messages/README.md 2013-09-13 14:11:17 UTC (rev 15588)
@@ -24,7 +24,7 @@
Testing the example
-------------------
-This example is covered by integration tests. All tests use the following technologies:
+This example is covered by integration and functional tests. All tests use the following technologies:
* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
* __ShrinkWrap__ - to create the test archive (WAR).
@@ -47,7 +47,35 @@
mvn clean test -Darquillian=jbossas-remote-7
+### Functional tests
+Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:
+
+* __Arquillian Graphene Extension__ - an advanced Ajax-capable type-safe Selenium-based browser testing tool,
+* __Arquillian Drone Extension__ - to automatically run and stop browser instances.
+
+_Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server._
+
+Run the functional test on JBoss AS instance with
+
+ mvn -f messages-ftest/pom.xml clean test
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+Several variables can be configured:
+
+* path to an alternative archive for testing
+
+ -DtestDeployment=/path/to/archive.ear
+
+* the browser to use for testing
+
+ -DbrowserCapabilities=htmlUnit
+
+* test on a running server
+
+ -Dremote
+
Testing in JBDS
---------------
### Integration tests
@@ -57,3 +85,11 @@
3. In the _Project Explorer_, select the EJB module project, then
1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and check `integration-tests` and `arq-jbossas-7-remote`
2. Right-click the module and select _Run As_ - _JUnit Test_
+
+### Functional tests
+
+1. Open JBDS and start a configured instance of JBoss AS
+2. Import the `ftest` project of the example
+3. In the _Project Explorer_, select the ftest project, then
+ 1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and activate `arq-jbossas-7-remote` profile and deactivate `arq-jbossas-7-managed` profile
+ 2. Right-click the module and select _Run As_ - _JUnit Test_
Added: branches/enterprise/WFK-2_1/examples/messages/messages-ftest/pom.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/messages/messages-ftest/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/messages/messages-ftest/src/test/java/org/jboss/seam/example/messages/test/graphene/MessagesFunctionalTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/messages/messages-ftest/src/test/java/org/jboss/seam/example/messages/test/graphene/MessagesFunctionalTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/messages/messages-ftest/src/test/java/org/jboss/seam/example/messages/test/graphene/MessagesFunctionalTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,83 @@
+/*
+ * 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.example.messages.test.graphene;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.junit.InSequence;
+import org.jboss.seam.example.common.test.DeploymentResolver;
+import org.jboss.seam.example.common.test.SeamGrapheneTest;
+import org.jboss.shrinkwrap.api.Archive;
+import static org.junit.Assert.*;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Test for messages example
+ *
+ * @author Jozef Hartinger
+ *
+ */
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class MessagesFunctionalTest extends SeamGrapheneTest {
+
+ @Deployment(testable = false)
+ public static Archive<?> createDeployment() {
+ return DeploymentResolver.createDeployment();
+ }
+ private Object[][] messages = {
+ {0, "Greetings Earthling", "This is another example of a message."},
+ {1, "Hello World", "This is an example of a message."}};
+
+ @Test
+ @InSequence(1)
+ public void readMessageTest() {
+ for (Object[] message : messages) {
+ int i = (Integer) message[0];
+ String title = (String) message[1];
+ String text = (String) message[2];
+
+ clickAndWaitHttp(getBy("MESSAGES_LINK", i));
+ assertEquals("Unexpected message title displayed.", title, getText(getBy("MESSAGE_TITLE")));
+ assertEquals("Unexpected message text displayed.", text, getText(getBy("MESSAGE_TEXT")));
+ assertTrue("Checkbox should be checked after message is read.", browser.findElement(getBy("MESSAGES_CHECKBOX", i)).isSelected());
+ }
+ }
+
+ @Test
+ @InSequence(2)
+ public void deleteMessageTest() {
+ for (Object[] message : messages) {
+ int i = (Integer) message[0];
+ String title = (String) message[1];
+ String text = (String) message[2];
+
+ int messageCount = getXpathCount(getBy("MESSAGES_COUNT"));
+ // delete first message in a table
+ clickAndWaitHttp(getBy("MESSAGES_DELETE", 0));
+ assertEquals("Unexpected count of messages.", --messageCount, getXpathCount(getBy("MESSAGES_COUNT")));
+ assertFalse("Message title still present.", isTextInSource(title));
+ }
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/messages/messages-ftest/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/messages/messages-ftest/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/messages/messages-ftest/src/test/resources/ftest.properties
===================================================================
--- branches/enterprise/WFK-2_1/examples/messages/messages-ftest/src/test/resources/ftest.properties (rev 0)
+++ branches/enterprise/WFK-2_1/examples/messages/messages-ftest/src/test/resources/ftest.properties 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,7 @@
+MESSAGES_URL messages.seam
+MESSAGES_LINK id=messages:{0}:link
+MESSAGES_DELETE id=messages:{0}:delete
+MESSAGES_CHECKBOX id=messages:{0}:read
+MESSAGES_COUNT xpath=//table[@id='messages']/tbody/tr
+MESSAGE_TITLE id=title
+MESSAGE_TEXT id=text
Modified: branches/enterprise/WFK-2_1/examples/nestedbooking/README.html
===================================================================
--- branches/enterprise/WFK-2_1/examples/nestedbooking/README.html 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/nestedbooking/README.html 2013-09-13 14:11:17 UTC (rev 15588)
@@ -1,6 +1,6 @@
<h1>Seam NestedBooking Example</h1>
-<p>This example demonstrates the use of Seam nested conversations and runs
+<p>This example demonstrates the use of Seam nested conversations and runs
on JBoss AS as an EAR.</p>
<h2>Running the example</h2>
@@ -12,27 +12,25 @@
<ol>
<li><p>In the example root directory run:</p>
-<pre><code> mvn clean install
+<pre><code>mvn clean install
</code></pre></li>
<li><p>Set JBOSS_HOME environment property.</p></li>
<li><p>In the nestedbooking-ear directory run:</p>
-<pre><code> mvn jboss-as:deploy
+<pre><code>mvn jboss-as:deploy
</code></pre></li>
<li><p>Open this URL in a web browser: http://localhost:8080/seam-nestedbooking</p></li>
</ol>
-
<h2>Testing the example</h2>
-<p>This example is covered by integration tests. All tests use the following technologies:</p>
+<p>This example is covered by integration and functional tests. All tests use the following technologies:</p>
<ul>
<li><strong>Arquillian</strong> - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,</li>
<li><strong>ShrinkWrap</strong> - to create the test archive (WAR).</li>
</ul>
-
<h3>Integration tests</h3>
<p>Integration tests cover core application logic and reside in the EJB module. In addition to Arquillian and ShrinkWrap, the integration tests also use:</p>
@@ -42,9 +40,8 @@
<li><strong>ShrinkWrap Resolver</strong> - to resolve dependencies of the project for packaging in the test archive.</li>
</ul>
+<p>The tests are executed in Maven's test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-<p>The tests are executed in Maven’s test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-
<pre><code>mvn clean test -Darquillian=jbossas-managed-7
</code></pre>
@@ -55,6 +52,41 @@
<pre><code>mvn clean test -Darquillian=jbossas-remote-7
</code></pre>
+<h3>Functional tests</h3>
+
+<p>Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:</p>
+
+<ul>
+<li><strong>Arquillian Graphene Extension</strong> - an advanced Ajax-capable type-safe Selenium-based browser testing tool,</li>
+<li><strong>Arquillian Drone Extension</strong> - to automatically run and stop browser instances.</li>
+</ul>
+
+<p><em>Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server.</em></p>
+
+<p>Run the functional test on JBoss AS instance with</p>
+
+<pre><code>mvn -f blog-ftest/pom.xml clean test
+</code></pre>
+
+<p>The <code>JBOSS_HOME</code> environment variable must be set and point to a JBoss AS instance directory.</p>
+
+<p>Several variables can be configured:</p>
+
+<ul>
+<li><p>path to an alternative archive for testing</p>
+
+<pre><code>-DtestDeployment=/path/to/archive.ear
+</code></pre></li>
+<li><p>the browser to use for testing</p>
+
+<pre><code>-DbrowserCapabilities=htmlUnit
+</code></pre></li>
+<li><p>test on a running server</p>
+
+<pre><code>-Dremote
+</code></pre></li>
+</ul>
+
<h2>Testing in JBDS</h2>
<h3>Integration tests</h3>
@@ -67,7 +99,9 @@
<ol>
<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and check <code>integration-tests</code> and <code>arq-jbossas-7-remote</code></li>
<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-</li>
-</ol>
+<h3>Functional tests</h3>
+
+<p>It is not possible to run the functional tests of this example in JBDS, because they use the maven-dependency-plugin to copy test classes from a different maven artifact, which is not a configuration supported by JBDS.</p>
Modified: branches/enterprise/WFK-2_1/examples/nestedbooking/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/nestedbooking/README.md 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/nestedbooking/README.md 2013-09-13 14:11:17 UTC (rev 15588)
@@ -26,7 +26,7 @@
Testing the example
-------------------
-This example is covered by integration tests. All tests use the following technologies:
+This example is covered by integration and functional tests. All tests use the following technologies:
* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
* __ShrinkWrap__ - to create the test archive (WAR).
@@ -49,6 +49,35 @@
mvn clean test -Darquillian=jbossas-remote-7
+### Functional tests
+
+Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:
+
+* __Arquillian Graphene Extension__ - an advanced Ajax-capable type-safe Selenium-based browser testing tool,
+* __Arquillian Drone Extension__ - to automatically run and stop browser instances.
+
+_Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server._
+
+Run the functional test on JBoss AS instance with
+
+ mvn -f blog-ftest/pom.xml clean test
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+Several variables can be configured:
+
+* path to an alternative archive for testing
+
+ -DtestDeployment=/path/to/archive.ear
+
+* the browser to use for testing
+
+ -DbrowserCapabilities=htmlUnit
+
+* test on a running server
+
+ -Dremote
+
Testing in JBDS
---------------
### Integration tests
@@ -60,3 +89,7 @@
3. In the _Project Explorer_, select the EJB module project, then
1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and check `integration-tests` and `arq-jbossas-7-remote`
2. Right-click the module and select _Run As_ - _JUnit Test_
+
+### Functional tests
+
+It is not possible to run the functional tests of this example in JBDS, because they use the maven-dependency-plugin to copy test classes from a different maven artifact, which is not a configuration supported by JBDS.
\ No newline at end of file
Added: branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/pom.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/src/test/java/org/jboss/seam/example/nestedbooking/test/graphene/NestedConversationTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/src/test/java/org/jboss/seam/example/nestedbooking/test/graphene/NestedConversationTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/src/test/java/org/jboss/seam/example/nestedbooking/test/graphene/NestedConversationTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,96 @@
+/*
+ * 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.example.nestedbooking.test.graphene;
+
+import java.net.MalformedURLException;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.example.common.test.booking.graphene.BookingFunctionalTestBase;
+import static org.junit.Assert.*;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * This class tests only nested conversations
+ *
+ * @author mgencur
+ */
+
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class NestedConversationTest extends BookingFunctionalTestBase {
+
+ protected final String CREDIT_CARD = "0123456789012345";
+ protected final String CREDIT_CARD_NAME = "visa";
+
+ @Before
+ @Override
+ public void beforeTest() throws MalformedURLException {
+ Assume.assumeTrue(isRealBrowser());// need window handling
+ super.beforeTest();
+ }
+
+ @Test
+ public void nestedConversationTest() {
+
+ openWindow(contextPath + getProperty("MAIN_PAGE"), "1");
+
+ selectWindow("1");
+ if (!isLoggedIn()) {
+ login();
+ }
+ enterSearchQuery("W Hotel");
+ clickAndWaitHttp(getBy("SEARCH_RESULT_TABLE_SECOND_ROW_LINK"));
+
+ //open the url in a second window
+ String url = browser.getCurrentUrl();
+ openWindow(url, "2");
+
+ //go next to confirm button in browser 1
+ selectWindow("1");
+ clickAndWaitHttp(getBy("BOOKING_BOOK"));
+ clickAndWaitHttp(getBy("SELECT_ROOM_BUTTON"));
+ clickAndWaitHttp(getBy("SELECT_WONDERFUL_ROOM"));
+ type(getBy("PAYMENT_CREDIT_CARD"), CREDIT_CARD);
+ type(getBy("PAYMENT_CREDIT_CARD_NAME"), CREDIT_CARD_NAME);
+ clickAndWaitHttp(getBy("PAYMENT_PROCEED"));
+
+ //go next to confirm button in browser 2
+ selectWindow("2");
+ clickAndWaitHttp(getBy("BOOKING_BOOK"));
+ clickAndWaitHttp(getBy("SELECT_ROOM_BUTTON"));
+ clickAndWaitHttp(getBy("SELECT_FANTASTIC_ROOM"));
+ type(getBy("PAYMENT_CREDIT_CARD"), CREDIT_CARD);
+ type(getBy("PAYMENT_CREDIT_CARD_NAME"), CREDIT_CARD_NAME);
+ clickAndWaitHttp(getBy("PAYMENT_PROCEED"));
+
+ //confirm in browser 1 (WONDERFUL room should be selected)
+ selectWindow("1");
+ clickAndWaitHttp(getBy("CONFIRM_CONFIRM"));
+ assertTrue(isTextOnPage("$450.00") && isTextOnPage("Wonderful Room"));
+ assertFalse(isTextOnPage("$1,000.00") || isTextOnPage("Fantastic Suite"));
+ logout();
+ }
+
+}
Added: branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/src/test/java/org/jboss/seam/example/nestedbooking/test/graphene/NestedSimpleBookingTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/src/test/java/org/jboss/seam/example/nestedbooking/test/graphene/NestedSimpleBookingTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/src/test/java/org/jboss/seam/example/nestedbooking/test/graphene/NestedSimpleBookingTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,81 @@
+/*
+ * 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.example.nestedbooking.test.graphene;
+
+import org.jboss.seam.example.common.test.booking.graphene.SimpleBookingTest;
+
+/**
+ * This class alters behaviour of SimpleBookingTest to match nestedbooking example
+ *
+ * @author jharting
+ */
+
+public class NestedSimpleBookingTest extends SimpleBookingTest {
+
+ @Override
+ protected int bookHotel(String hotelName) {
+ return bookHotel(hotelName, 0, CREDIT_CARD, CREDIT_CARD_NAME);
+ }
+
+ protected int bookHotel(String hotelName, int room, String creditCard, String creditCardName) {
+ if (!isLoggedIn()) {
+ return -1;
+ }
+
+ if (!isElementPresent(getBy("SEARCH_SUBMIT"))) {
+ open(contextPath + getProperty("MAIN_PAGE"));
+ }
+
+ enterSearchQuery(hotelName);
+ clickAndWaitHttp(getBy("SEARCH_RESULT_TABLE_FIRST_ROW_LINK"));
+
+ // hotel page
+ clickAndWaitHttp(getBy("BOOKING_BOOK"));
+
+ // book page
+ clickAndWaitHttp(getBy("BOOKING_SELECT_ROOM"));
+
+ // room select page
+ clickAndWaitHttp(getBy("ROOM_LINK", room));
+
+ // payment page
+ type(getBy("PAYMENT_CREDIT_CARD"), creditCard);
+ type(getBy("PAYMENT_CREDIT_CARD_NAME"), creditCardName);
+ clickAndWaitHttp(getBy("PAYMENT_PROCEED"));
+
+ // confirm page
+ clickAndWaitHttp(getBy("CONFIRM_CONFIRM"));
+
+ // main page
+ String message = getText(getBy("HOTEL_MESSAGE"));
+ if (message.matches(getProperty("BOOKING_CONFIRMATION_MESSAGE", EXPECTED_NAME, hotelName))) {
+ String[] messageParts = message.split(" ");
+ int confirmationNumber = Integer.parseInt(messageParts[messageParts.length - 1]);
+ return confirmationNumber;
+ } else {
+ return -1;
+ }
+ }
+
+ @Override
+ protected void populateBookingFields() {}
+}
Added: branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/src/test/resources/ftest.properties
===================================================================
--- branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/src/test/resources/ftest.properties (rev 0)
+++ branches/enterprise/WFK-2_1/examples/nestedbooking/nestedbooking-ftest/src/test/resources/ftest.properties 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,91 @@
+ #
+ # 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.
+ #
+HOME_PAGE /home.seam
+MAIN_PAGE /main.seam
+PAGE_TITLE JBoss Suites: Seam Framework
+LOGIN_USERNAME_FIELD id=login:username
+LOGIN_PASSWORD_FIELD id=login:password
+LOGIN_SUBMIT id=login:login
+LOGOUT id=logout
+PASSWORD_UPDATED_MESSAGE Password updated
+PASSWORD_REENTER_MESSAGE Re-enter new password
+PASSWORD_VALUE_REQUIRED_MESSAGE xpath=//*[@id='setpassword:PasswordDecorate:message' or @id='setpassword:VerifyDecorate:message']
+PASSWORD_LENGTH_MESSAGE size must be between
+PASSWORD_PASSWORD id=setpassword:PasswordDecorate:password
+PASSWORD_VERIFY id=setpassword:VerifyDecorate:verify
+PASSWORD_SUBMIT id=setpassword:change
+SETTINGS id=settings
+SEARCH_STRING_FIELD id=main:searchString
+SEARCH_SUBMIT id=main:findHotels
+NO_HOTELS_FOUND id=NoHotelsFoundMessage
+SEARCH_RESULT_TABLE xpath=//table[@id = 'hotels']/tbody
+SEARCH_RESULT_TABLE_FIRST_ROW_LINK id=hotels:0:viewHotel
+SEARCH_RESULT_TABLE_SECOND_ROW_LINK id=hotels:1:viewHotel
+BOOKING_BOOK id=hotel:bookHotel
+BOOKING_CANCEL id=hotel:cancel
+BOOKING_SELECT_ROOM id=booking:room_preference
+HOTEL_BED_FIELD id=booking:bedsDecorate:beds
+HOTEL_BED_FIELD_SELECT_CRITERIA value=
+HOTEL_CHECKIN_DATE_FIELD id=booking:checkinDateDecorate:checkinDateInputDate
+HOTEL_CHECKIN_DATE_MESSAGE id=booking:checkinDateDecorate:message
+HOTEL_CHECKOUT_DATE_FIELD id=booking:checkoutDateDecorate:checkoutDateInputDate
+HOTEL_CHECKOUT_DATE_MESSAGE id=booking:checkoutDateDecorate:message
+HOTEL_SMOKING id=booking:smokingDecorate:smoking:
+HOTEL_PROCEED id=booking:room_preference
+HOTEL_CANCEL id=booking:cancel
+HOTEL_CONFIRM id=confirm:confirm
+HOTEL_MESSAGE xpath=//ul[@id='main:messages']/li
+ROOM_LINK id=room_selections_form:rooms:{0}:selectRoomPreference
+PAYMENT_CREDIT_CARD id=payment:creditCardDecorate:creditCard
+PAYMENT_CREDIT_CARD_NAME id=payment:creditCardNameDecorate:creditCardName
+PAYMENT_PROCEED id=payment:proceed
+CONFIRM_CONFIRM id=confirm:buttonDecorate:confirm
+REGISTRATION id=login:register
+REGISTRATION_USERNAME id=register:usernameDecorate:username
+REGISTRATION_USERNAME_MESSAGE id=register:usernameDecorate:message
+REGISTRATION_NAME id=register:nameDecorate:name
+REGISTRATION_NAME_MESSAGE id=register:nameDecorate:message
+REGISTRATION_PASSWORD id=register:passwordDecorate:password
+REGISTRATION_PASSWORD_MESSAGE id=register:passwordDecorate:message
+REGISTRATION_VERIFY id=register:verifyDecorate:verify
+REGISTRATION_VERIFY_MESSAGE id=register:verifyDecorate:message
+REGISTRATION_SUBMIT id=register:register
+REGISTRATION_REENTER_MESSAGE Re-enter your password
+REGISTRATION_LENGTH_MESSAGE size must be between
+REGISTRATION_SUCCESSFUL_MESSAGE
+REGISTRATION_USER_EXISTS_MESSAGE Username {0} already exists
+NOT_LOGGED_IN_MESSAGE Please log in first
+CONVERSATION_TIMEOUT_MESSAGE The conversation ended, timed out or was processing another request
+BOOKING_TABLE_ITEM xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text()) \= "{0}"][normalize-space(td[1]/text()) \= "{1}"]
+BOOKING_TABLE_ITEM_LINK xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text()) \= "{0}"][normalize-space(td[1]/text()) \= "{1}"]/td[7]/a
+BOOKING_CANCELLED_MESSAGE Booking cancelled for confirmation number {0}
+BOOKING_CONFIRMATION_MESSAGE Thank you, {0}, your confimation number for {1} is \\d+
+BOOKING_INVALID_DATE_MESSAGE1 Check out date must be later than check in date
+BOOKING_INVALID_DATE_MESSAGE2 Check in date must be a future date
+WORKSPACE_BOOKING_TEXT Book hotel: {0}
+WORKSPACE_VIEW_TEXT View hotel: {0}
+WORKSPACE_TABLE_LINK_BY_ID id=ConversationListForm:ConversationListDataTable:{0}:EntryDescriptionLink
+WORKSPACE_TABLE_ROW_COUNT xpath=//table[@id\='ConversationListForm\:ConversationListDataTable']/tbody/tr
+SPINNER id\=main\:SpinnerGif
+SELECT_ROOM_BUTTON id=booking:room_preference
+SELECT_WONDERFUL_ROOM id=room_selections_form:rooms:0:selectRoomPreference
+SELECT_FANTASTIC_ROOM id=room_selections_form:rooms:2:selectRoomPreference
Modified: branches/enterprise/WFK-2_1/examples/openid/README.html
===================================================================
--- branches/enterprise/WFK-2_1/examples/openid/README.html 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/openid/README.html 2013-09-13 14:11:17 UTC (rev 15588)
@@ -9,27 +9,25 @@
<ol>
<li><p>In the example root directory run:</p>
-<pre><code> mvn clean install
+<pre><code>mvn clean install
</code></pre></li>
<li><p>Set JBOSS_HOME environment property.</p></li>
<li><p>In the openid-ear directory run:</p>
-<pre><code> mvn jboss-as:deploy
+<pre><code>mvn jboss-as:deploy
</code></pre></li>
<li><p>Open this URL in a web browser: http://localhost:8080/seam-openid</p></li>
</ol>
-
<h2>Testing the example</h2>
-<p>This example is covered by integration tests. All tests use the following technologies:</p>
+<p>This example is covered by integration and functional tests. All tests use the following technologies:</p>
<ul>
<li><strong>Arquillian</strong> - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,</li>
<li><strong>ShrinkWrap</strong> - to create the test archive (WAR).</li>
</ul>
-
<h3>Integration tests</h3>
<p>Integration tests cover core application logic and reside in the EJB module. In addition to Arquillian and ShrinkWrap, the integration tests also use:</p>
@@ -39,9 +37,8 @@
<li><strong>ShrinkWrap Resolver</strong> - to resolve dependencies of the project for packaging in the test archive.</li>
</ul>
+<p>The tests are executed in Maven's test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-<p>The tests are executed in Maven’s test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-
<pre><code>mvn clean test -Darquillian=jbossas-managed-7
</code></pre>
@@ -52,6 +49,41 @@
<pre><code>mvn clean test -Darquillian=jbossas-remote-7
</code></pre>
+<h3>Functional tests</h3>
+
+<p>Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:</p>
+
+<ul>
+<li><strong>Arquillian Graphene Extension</strong> - an advanced Ajax-capable type-safe Selenium-based browser testing tool,</li>
+<li><strong>Arquillian Drone Extension</strong> - to automatically run and stop browser instances.</li>
+</ul>
+
+<p><em>Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server.</em></p>
+
+<p>Run the functional test on JBoss AS instance with</p>
+
+<pre><code>mvn -f openid-ftest/pom.xml clean test
+</code></pre>
+
+<p>The <code>JBOSS_HOME</code> environment variable must be set and point to a JBoss AS instance directory.</p>
+
+<p>Several variables can be configured:</p>
+
+<ul>
+<li><p>path to an alternative archive for testing</p>
+
+<pre><code>-DtestDeployment=/path/to/archive.ear
+</code></pre></li>
+<li><p>the browser to use for testing</p>
+
+<pre><code>-DbrowserCapabilities=htmlUnit
+</code></pre></li>
+<li><p>test on a running server</p>
+
+<pre><code>-Dremote
+</code></pre></li>
+</ul>
+
<h2>Testing in JBDS</h2>
<h3>Integration tests</h3>
@@ -60,11 +92,20 @@
<li>Open JBDS and start a configured instance of JBoss AS</li>
<li>Import the example project and its submodules</li>
<li>In the <em>Project Explorer</em>, select the EJB module project, then
-
<ol>
<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and check <code>integration-tests</code> and <code>arq-jbossas-7-remote</code></li>
<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-</li>
+
+<h3>Functional tests</h3>
+
+<ol>
+<li>Open JBDS and start a configured instance of JBoss AS</li>
+<li>Import the <code>ftest</code> project of the example</li>
+<li>In the <em>Project Explorer</em>, select the ftest project, then
+<ol>
+<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and activate <code>arq-jbossas-7-remote</code> profile and deactivate <code>arq-jbossas-7-managed</code> profile</li>
+<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-
Modified: branches/enterprise/WFK-2_1/examples/openid/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/openid/README.md 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/openid/README.md 2013-09-13 14:11:17 UTC (rev 15588)
@@ -24,7 +24,7 @@
Testing the example
-------------------
-This example is covered by integration tests. All tests use the following technologies:
+This example is covered by integration and functional tests. All tests use the following technologies:
* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
* __ShrinkWrap__ - to create the test archive (WAR).
@@ -47,7 +47,35 @@
mvn clean test -Darquillian=jbossas-remote-7
+### Functional tests
+Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:
+
+* __Arquillian Graphene Extension__ - an advanced Ajax-capable type-safe Selenium-based browser testing tool,
+* __Arquillian Drone Extension__ - to automatically run and stop browser instances.
+
+_Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server._
+
+Run the functional test on JBoss AS instance with
+
+ mvn -f openid-ftest/pom.xml clean test
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+Several variables can be configured:
+
+* path to an alternative archive for testing
+
+ -DtestDeployment=/path/to/archive.ear
+
+* the browser to use for testing
+
+ -DbrowserCapabilities=htmlUnit
+
+* test on a running server
+
+ -Dremote
+
Testing in JBDS
---------------
### Integration tests
@@ -57,3 +85,11 @@
3. In the _Project Explorer_, select the EJB module project, then
1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and check `integration-tests` and `arq-jbossas-7-remote`
2. Right-click the module and select _Run As_ - _JUnit Test_
+
+### Functional tests
+
+1. Open JBDS and start a configured instance of JBoss AS
+2. Import the `ftest` project of the example
+3. In the _Project Explorer_, select the ftest project, then
+ 1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and activate `arq-jbossas-7-remote` profile and deactivate `arq-jbossas-7-managed` profile
+ 2. Right-click the module and select _Run As_ - _JUnit Test_
Added: branches/enterprise/WFK-2_1/examples/openid/openid-ftest/pom.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/openid/openid-ftest/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/openid/openid-ftest/src/test/java/org/jboss/seam/example/openid/test/graphene/OpenIdFunctionalTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/openid/openid-ftest/src/test/java/org/jboss/seam/example/openid/test/graphene/OpenIdFunctionalTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/openid/openid-ftest/src/test/java/org/jboss/seam/example/openid/test/graphene/OpenIdFunctionalTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,83 @@
+/*
+ * 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.example.openid.test.graphene;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.junit.InSequence;
+import org.jboss.seam.example.common.test.DeploymentResolver;
+import org.jboss.seam.example.common.test.SeamGrapheneTest;
+import org.jboss.shrinkwrap.api.Archive;
+import static org.junit.Assert.*;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * This class tests basic functionality of Seam OpenId example.
+ *
+ * @author Martin Gencur
+ *
+ */
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class OpenIdFunctionalTest extends SeamGrapheneTest {
+
+ @Deployment(testable = false)
+ public static Archive<?> createDeployment() {
+ return DeploymentResolver.createDeployment();
+ }
+
+ /**
+ * Place holder - just verifies that example deploys
+ */
+ @Test
+ @InSequence(1)
+ public void homePageLoadTest() {
+ assertEquals("Unexpected page title.", getProperty("HOME_PAGE_TITLE"), browser.getTitle());
+ }
+
+ /**
+ * Method verifies login and logout operations.
+ */
+ @Test
+ @InSequence(2)
+ public void openIdLoginLogoutTest() {
+ deleteCookies();
+ type(getBy("LOGIN_INPUT"), getProperty("OPENID_ACCOUNT"));
+ clickAndWaitHttp(getBy("LOGIN_LINK"));
+ type(getBy("PASSWORD_INPUT"), getProperty("OPENID_PASSWORD"));
+ clickAndWaitHttp(getBy("SIGNIN_BUTTON"));
+ if (isElementPresent(getBy("CONTINUE_BUTTON"))) {
+ clickAndWaitHttp(getBy("CONTINUE_BUTTON"));
+ }
+
+ assertTrue("Page should contain information about successful login", isTextInSource("OpenID login successful..."));
+ clickAndWaitHttp(getBy("LOGOUT_BUTTON"));
+ assertTrue("Page should contain input field which means that user is not logged in anymore", isElementPresent(getBy("LOGIN_INPUT")));
+ }
+
+ private void deleteCookies() {
+ browser.manage().deleteCookieNamed("session_id");
+ browser.manage().deleteCookieNamed("secure_session_id");
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/openid/openid-ftest/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/openid/openid-ftest/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/openid/openid-ftest/src/test/resources/ftest.properties
===================================================================
--- branches/enterprise/WFK-2_1/examples/openid/openid-ftest/src/test/resources/ftest.properties (rev 0)
+++ branches/enterprise/WFK-2_1/examples/openid/openid-ftest/src/test/resources/ftest.properties 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,9 @@
+HOME_PAGE_TITLE OpenID Wall
+LOGIN_LINK xpath=//input[@value='OpenID Login']
+LOGIN_INPUT xpath=//input[@class='openid_input']
+PASSWORD_INPUT id=password
+SIGNIN_BUTTON id=signin_button
+CONTINUE_BUTTON id=continue-button
+LOGOUT_BUTTON xpath=//input[@value='Logout']
+OPENID_ACCOUNT seamqa.myopenid.com
+OPENID_PASSWORD jboss42
Modified: branches/enterprise/WFK-2_1/examples/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/pom.xml 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/pom.xml 2013-09-13 14:11:17 UTC (rev 15588)
@@ -66,37 +66,92 @@
<maven.compiler.argument.source>${maven.compiler.source}</maven.compiler.argument.source>
</properties>
-
- <modules>
- <module>blog</module>
- <module>booking</module>
- <module>contactlist</module>
- <module>excel</module>
- <module>groovybooking</module>
- <module>hibernate</module>
- <module>itext</module>
- <module>jee6</module>
- <module>jpa</module>
- <module>mail</module>
- <module>messages</module>
- <module>nestedbooking</module>
- <module>openid</module>
- <module>quartz</module>
- <module>registration</module>
- <module>remoting/chatroom</module>
- <module>remoting/helloworld</module>
- <module>restbay</module>
- <module>seambay</module>
- <module>seamdiscs</module>
- <module>seampay</module>
- <module>seamspace</module>
- <module>spring</module>
- <module>tasks</module>
- <module>ui</module>
- </modules>
-
+
<profiles>
<profile>
+ <id>default</id>
+ <activation>
+ <property>
+ <name>!ftest</name>
+ </property>
+ </activation>
+ <modules>
+ <module>blog</module>
+ <module>booking</module>
+ <module>contactlist</module>
+ <module>drools</module>
+ <module>dvdstore</module>
+ <module>excel</module>
+ <module>groovybooking</module>
+ <module>guice</module>
+ <module>hibernate</module>
+ <module>icefaces</module>
+ <module>itext</module>
+ <module>jee6</module>
+ <module>jpa</module>
+ <module>mail</module>
+ <module>messages</module>
+ <module>metawidget/booking</module>
+ <module>metawidget/groovybooking</module>
+ <module>nestedbooking</module>
+ <module>numberguess</module>
+ <module>openid</module>
+ <module>quartz</module>
+ <module>registration</module>
+ <module>remoting/chatroom</module>
+ <module>remoting/gwt</module>
+ <module>remoting/helloworld</module>
+ <module>remoting/progressbar</module>
+ <module>restbay</module>
+ <module>rss</module>
+ <module>seambay</module>
+ <module>seamdiscs</module>
+ <module>seampay</module>
+ <module>seamspace</module>
+ <module>spring</module>
+ <module>tasks</module>
+ <module>todo</module>
+ <module>ui</module>
+ <module>wicket</module>
+ </modules>
+ </profile>
+
+ <profile>
+ <id>ftest</id>
+ <activation>
+ <property>
+ <name>ftest</name>
+ </property>
+ </activation>
+ <modules>
+ <module>blog/blog-ftest</module>
+ <module>booking/booking-ftest</module>
+ <module>contactlist/contactlist-ftest</module>
+ <module>excel/excel-ftest</module>
+ <module>groovybooking/groovybooking-ftest</module>
+ <module>hibernate/hibernate-ftest</module>
+ <module>itext/itext-ftest</module>
+ <module>jee6/jee6-ftest</module>
+ <module>jpa/jpa-ftest</module>
+ <module>mail/mail-ftest</module>
+ <module>messages/messages-ftest</module>
+ <module>nestedbooking/nestedbooking-ftest</module>
+ <module>openid/openid-ftest</module>
+ <module>quartz/quartz-ftest</module>
+ <module>registration/registration-ftest</module>
+ <module>remoting/chatroom/chatroom-ftest</module>
+ <module>remoting/helloworld/helloworld-ftest</module>
+ <module>seambay/seambay-ftest</module>
+ <module>seamdiscs/seamdiscs-ftest</module>
+ <module>seampay/seampay-ftest</module>
+ <module>seamspace/seamspace-ftest</module>
+ <module>spring/spring-ftest</module>
+ <module>tasks/tasks-ftest</module>
+ <module>ui/ui-ftest</module>
+ </modules>
+ </profile>
+
+ <profile>
<id>distribution</id>
<build>
<plugins>
Modified: branches/enterprise/WFK-2_1/examples/quartz/README.html
===================================================================
--- branches/enterprise/WFK-2_1/examples/quartz/README.html 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/quartz/README.html 2013-09-13 14:11:17 UTC (rev 15588)
@@ -9,27 +9,25 @@
<ol>
<li><p>In the example root directory run:</p>
-<pre><code> mvn clean install
+<pre><code>mvn clean install
</code></pre></li>
<li><p>Set JBOSS_HOME environment property.</p></li>
<li><p>In the quartz-ear directory run:</p>
-<pre><code> mvn jboss-as:deploy
+<pre><code>mvn jboss-as:deploy
</code></pre></li>
<li><p>Open this URL in a web browser: http://localhost:8080/seam-quartz</p></li>
</ol>
-
<h2>Testing the example</h2>
-<p>This example is covered by integration tests. All tests use the following technologies:</p>
+<p>This example is covered by integration and functional tests. All tests use the following technologies:</p>
<ul>
<li><strong>Arquillian</strong> - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,</li>
<li><strong>ShrinkWrap</strong> - to create the test archive (WAR).</li>
</ul>
-
<h3>Integration tests</h3>
<p>Integration tests cover core application logic and reside in the EJB module. In addition to Arquillian and ShrinkWrap, the integration tests also use:</p>
@@ -39,9 +37,8 @@
<li><strong>ShrinkWrap Resolver</strong> - to resolve dependencies of the project for packaging in the test archive.</li>
</ul>
+<p>The tests are executed in Maven's test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-<p>The tests are executed in Maven’s test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-
<pre><code>mvn clean test -Darquillian=jbossas-managed-7
</code></pre>
@@ -52,6 +49,41 @@
<pre><code>mvn clean test -Darquillian=jbossas-remote-7
</code></pre>
+<h3>Functional tests</h3>
+
+<p>Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:</p>
+
+<ul>
+<li><strong>Arquillian Graphene Extension</strong> - an advanced Ajax-capable type-safe Selenium-based browser testing tool,</li>
+<li><strong>Arquillian Drone Extension</strong> - to automatically run and stop browser instances.</li>
+</ul>
+
+<p><em>Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server.</em></p>
+
+<p>Run the functional test on JBoss AS instance with</p>
+
+<pre><code>mvn -f quartz-ftest/pom.xml clean test
+</code></pre>
+
+<p>The <code>JBOSS_HOME</code> environment variable must be set and point to a JBoss AS instance directory.</p>
+
+<p>Several variables can be configured:</p>
+
+<ul>
+<li><p>path to an alternative archive for testing</p>
+
+<pre><code>-DtestDeployment=/path/to/archive.ear
+</code></pre></li>
+<li><p>the browser to use for testing</p>
+
+<pre><code>-DbrowserCapabilities=htmlUnit
+</code></pre></li>
+<li><p>test on a running server</p>
+
+<pre><code>-Dremote
+</code></pre></li>
+</ul>
+
<h2>Testing in JBDS</h2>
<h3>Integration tests</h3>
@@ -60,11 +92,20 @@
<li>Open JBDS and start a configured instance of JBoss AS</li>
<li>Import the example project and its submodules</li>
<li>In the <em>Project Explorer</em>, select the EJB module project, then
-
<ol>
<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and check <code>integration-tests</code> and <code>arq-jbossas-7-remote</code></li>
<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-</li>
+
+<h3>Functional tests</h3>
+
+<ol>
+<li>Open JBDS and start a configured instance of JBoss AS</li>
+<li>Import the <code>ftest</code> project of the example</li>
+<li>In the <em>Project Explorer</em>, select the ftest project, then
+<ol>
+<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and activate <code>arq-jbossas-7-remote</code> profile and deactivate <code>arq-jbossas-7-managed</code> profile</li>
+<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-
Modified: branches/enterprise/WFK-2_1/examples/quartz/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/quartz/README.md 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/quartz/README.md 2013-09-13 14:11:17 UTC (rev 15588)
@@ -24,7 +24,7 @@
Testing the example
-------------------
-This example is covered by integration tests. All tests use the following technologies:
+This example is covered by integration and functional tests. All tests use the following technologies:
* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
* __ShrinkWrap__ - to create the test archive (WAR).
@@ -47,6 +47,35 @@
mvn clean test -Darquillian=jbossas-remote-7
+### Functional tests
+
+Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:
+
+* __Arquillian Graphene Extension__ - an advanced Ajax-capable type-safe Selenium-based browser testing tool,
+* __Arquillian Drone Extension__ - to automatically run and stop browser instances.
+
+_Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server._
+
+Run the functional test on JBoss AS instance with
+
+ mvn -f quartz-ftest/pom.xml clean test
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+Several variables can be configured:
+
+* path to an alternative archive for testing
+
+ -DtestDeployment=/path/to/archive.ear
+
+* the browser to use for testing
+
+ -DbrowserCapabilities=htmlUnit
+
+* test on a running server
+
+ -Dremote
+
Testing in JBDS
---------------
### Integration tests
@@ -56,3 +85,11 @@
3. In the _Project Explorer_, select the EJB module project, then
1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and check `integration-tests` and `arq-jbossas-7-remote`
2. Right-click the module and select _Run As_ - _JUnit Test_
+
+### Functional tests
+
+1. Open JBDS and start a configured instance of JBoss AS
+2. Import the `ftest` project of the example
+3. In the _Project Explorer_, select the ftest project, then
+ 1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and activate `arq-jbossas-7-remote` profile and deactivate `arq-jbossas-7-managed` profile
+ 2. Right-click the module and select _Run As_ - _JUnit Test_
Added: branches/enterprise/WFK-2_1/examples/quartz/quartz-ftest/pom.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/quartz/quartz-ftest/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/quartz/quartz-ftest/src/test/java/org/jboss/seam/example/quartz/test/graphene/QuartzPaymentTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/quartz/quartz-ftest/src/test/java/org/jboss/seam/example/quartz/test/graphene/QuartzPaymentTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/quartz/quartz-ftest/src/test/java/org/jboss/seam/example/quartz/test/graphene/QuartzPaymentTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,89 @@
+/*
+ * 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.example.quartz.test.graphene;
+
+import java.math.BigDecimal;
+import java.text.ParseException;
+import org.jboss.seam.example.common.test.seampay.graphene.SeampayFunctionalTest;
+import static org.junit.Assert.*;
+import org.junit.Test;
+import org.openqa.selenium.By;
+
+/**
+ *
+ * @author jharting
+ *
+ */
+public class QuartzPaymentTest extends SeampayFunctionalTest {
+
+ /**
+ * Submits new payment using CRON and verifies that the balance is
+ * subtracted correctly
+ *
+ * @throws ParseException
+ * @throws InterruptedException
+ */
+ @Test
+ public void testCRON() throws ParseException, InterruptedException {
+ int account = 3;
+ BigDecimal amount = new BigDecimal(10);
+ String to = "foo";
+ By accountLinkLocator = getBy("ACCOUNT_TABLE_LINK", account);
+ By accountBalanceLocator = getBy("ACCOUNT_TABLE_BALANCE", account);
+ // send every 20 seconds
+ String cronExpression = "0/20 * * * * ?";
+
+ clickAndWaitHttp(accountLinkLocator);
+
+ // submit new cron job
+ type(getBy("PAYMENT_TO_FIELD"), to);
+ type(getBy("PAYMENT_AMOUNT_FIELD"), amount.toString());
+ type(getBy("PAYMENT_CRON_FIELD"), cronExpression);
+ clickAndWaitHttp(getBy("PAYMENT_CRON_SUBMIT"));
+
+ assertTrue("Scheduled payment not confirmed.", isTextInSource(getProperty("PAYMENT_CONFIRMATION_MESSAGE", to)));
+ assertEquals("Invalid count of payments.", 1, getXpathCount(getBy("PAYMENTS_COUNT")));
+ // wait
+ Thread.sleep(5000);
+ // get balance
+ clickAndWaitHttp(accountLinkLocator);
+
+ BigDecimal firstBalance = BigDecimal.valueOf(parseBalance(getText(accountBalanceLocator)));
+ // wait 20 seconds
+ Thread.sleep(20000);
+ // get balance after 20 seconds
+ clickAndWaitHttp(accountLinkLocator);
+
+ BigDecimal secondBalance = BigDecimal.valueOf(parseBalance(getText(accountBalanceLocator)));
+ // wait 20 seconds
+ Thread.sleep(20000);
+ // get balance after 40 seconds
+ clickAndWaitHttp(accountLinkLocator);
+
+ BigDecimal thirdBalance = BigDecimal.valueOf(parseBalance(getText(accountBalanceLocator)));
+
+ BigDecimal expectedSecondBalance = firstBalance.subtract(amount);
+ BigDecimal expectedThirdBalance = firstBalance.subtract(amount).subtract(amount);
+ assertEquals("Incorrect balance after 20 seconds.", expectedSecondBalance, secondBalance);
+ assertEquals("Incorrect balance after 40 seconds.", expectedThirdBalance, thirdBalance);
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/quartz/quartz-ftest/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/quartz/quartz-ftest/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/quartz/quartz-ftest/src/test/resources/ftest.properties
===================================================================
--- branches/enterprise/WFK-2_1/examples/quartz/quartz-ftest/src/test/resources/ftest.properties (rev 0)
+++ branches/enterprise/WFK-2_1/examples/quartz/quartz-ftest/src/test/resources/ftest.properties 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,34 @@
+ #
+ # 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.
+ #
+MAIN_PAGE search.seam
+MAIN_PAGE_TITLE Seam Pay
+ACCOUNT_TABLE_LINK id=accountTable:{0}:link
+ACCOUNT_TABLE_BALANCE id=accountTable:{0}:balance
+PAYMENT_TO_FIELD id=accountView:paymentForm:payee
+PAYMENT_AMOUNT_FIELD id=accountView:paymentForm:amount
+PAYMENT_CRON_FIELD id=accountView:paymentForm:paymentCron
+PAYMENT_CRON_SUBMIT id=accountView:paymentForm:cronSubmit
+PAYMENT_ONLY_ONCE_RADIO id=accountView:paymentForm:radioList:0
+PAYMENT_EVERY_MINUTE_RADIO id=accountView:paymentForm:radioList:1
+PAYMENT_SUBMIT id=accountView:paymentForm:submit
+PAYMENT_CONFIRMATION_MESSAGE Created a new payment to {0}
+PAYMENTS_COUNT xpath=//table[@id\='payments']/tbody/tr
Modified: branches/enterprise/WFK-2_1/examples/registration/README.html
===================================================================
--- branches/enterprise/WFK-2_1/examples/registration/README.html 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/registration/README.html 2013-09-13 14:11:17 UTC (rev 15588)
@@ -9,27 +9,25 @@
<ol>
<li><p>In the example root directory run:</p>
-<pre><code> mvn clean install
+<pre><code>mvn clean install
</code></pre></li>
<li><p>Set JBOSS_HOME environment property.</p></li>
<li><p>In the registration-ear directory run:</p>
-<pre><code> mvn jboss-as:deploy
+<pre><code>mvn jboss-as:deploy
</code></pre></li>
<li><p>Open this URL in a web browser: http://localhost:8080/seam-registration</p></li>
</ol>
-
<h2>Testing the example</h2>
-<p>This example is covered by integration tests. All tests use the following technologies:</p>
+<p>This example is covered by integration and functional tests. All tests use the following technologies:</p>
<ul>
<li><strong>Arquillian</strong> - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,</li>
<li><strong>ShrinkWrap</strong> - to create the test archive (WAR).</li>
</ul>
-
<h3>Integration tests</h3>
<p>Integration tests cover core application logic and reside in the EJB module. In addition to Arquillian and ShrinkWrap, the integration tests also use:</p>
@@ -39,9 +37,8 @@
<li><strong>ShrinkWrap Resolver</strong> - to resolve dependencies of the project for packaging in the test archive.</li>
</ul>
+<p>The tests are executed in Maven's test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-<p>The tests are executed in Maven’s test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-
<pre><code>mvn clean test -Darquillian=jbossas-managed-7
</code></pre>
@@ -52,6 +49,41 @@
<pre><code>mvn clean test -Darquillian=jbossas-remote-7
</code></pre>
+<h3>Functional tests</h3>
+
+<p>Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:</p>
+
+<ul>
+<li><strong>Arquillian Graphene Extension</strong> - an advanced Ajax-capable type-safe Selenium-based browser testing tool,</li>
+<li><strong>Arquillian Drone Extension</strong> - to automatically run and stop browser instances.</li>
+</ul>
+
+<p><em>Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server.</em></p>
+
+<p>Run the functional test on JBoss AS instance with</p>
+
+<pre><code>mvn -f registration-ftest/pom.xml clean test
+</code></pre>
+
+<p>The <code>JBOSS_HOME</code> environment variable must be set and point to a JBoss AS instance directory.</p>
+
+<p>Several variables can be configured:</p>
+
+<ul>
+<li><p>path to an alternative archive for testing</p>
+
+<pre><code>-DtestDeployment=/path/to/archive.ear
+</code></pre></li>
+<li><p>the browser to use for testing</p>
+
+<pre><code>-DbrowserCapabilities=htmlUnit
+</code></pre></li>
+<li><p>test on a running server</p>
+
+<pre><code>-Dremote
+</code></pre></li>
+</ul>
+
<h2>Testing in JBDS</h2>
<h3>Integration tests</h3>
@@ -60,11 +92,20 @@
<li>Open JBDS and start a configured instance of JBoss AS</li>
<li>Import the example project and its submodules</li>
<li>In the <em>Project Explorer</em>, select the EJB module project, then
-
<ol>
<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and check <code>integration-tests</code> and <code>arq-jbossas-7-remote</code></li>
<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-</li>
+
+<h3>Functional tests</h3>
+
+<ol>
+<li>Open JBDS and start a configured instance of JBoss AS</li>
+<li>Import the <code>ftest</code> project of the example</li>
+<li>In the <em>Project Explorer</em>, select the ftest project, then
+<ol>
+<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and activate <code>arq-jbossas-7-remote</code> profile and deactivate <code>arq-jbossas-7-managed</code> profile</li>
+<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-
Modified: branches/enterprise/WFK-2_1/examples/registration/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/registration/README.md 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/registration/README.md 2013-09-13 14:11:17 UTC (rev 15588)
@@ -24,7 +24,7 @@
Testing the example
-------------------
-This example is covered by integration tests. All tests use the following technologies:
+This example is covered by integration and functional tests. All tests use the following technologies:
* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
* __ShrinkWrap__ - to create the test archive (WAR).
@@ -47,7 +47,35 @@
mvn clean test -Darquillian=jbossas-remote-7
+### Functional tests
+Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:
+
+* __Arquillian Graphene Extension__ - an advanced Ajax-capable type-safe Selenium-based browser testing tool,
+* __Arquillian Drone Extension__ - to automatically run and stop browser instances.
+
+_Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server._
+
+Run the functional test on JBoss AS instance with
+
+ mvn -f registration-ftest/pom.xml clean test
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+Several variables can be configured:
+
+* path to an alternative archive for testing
+
+ -DtestDeployment=/path/to/archive.ear
+
+* the browser to use for testing
+
+ -DbrowserCapabilities=htmlUnit
+
+* test on a running server
+
+ -Dremote
+
Testing in JBDS
---------------
### Integration tests
@@ -57,3 +85,11 @@
3. In the _Project Explorer_, select the EJB module project, then
1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and check `integration-tests` and `arq-jbossas-7-remote`
2. Right-click the module and select _Run As_ - _JUnit Test_
+
+### Functional tests
+
+1. Open JBDS and start a configured instance of JBoss AS
+2. Import the `ftest` project of the example
+3. In the _Project Explorer_, select the ftest project, then
+ 1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and activate `arq-jbossas-7-remote` profile and deactivate `arq-jbossas-7-managed` profile
+ 2. Right-click the module and select _Run As_ - _JUnit Test_
Added: branches/enterprise/WFK-2_1/examples/registration/registration-ftest/pom.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/registration/registration-ftest/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/registration/registration-ftest/src/test/java/org/jboss/seam/example/registration/test/graphene/RegistrationFunctionalTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/registration/registration-ftest/src/test/java/org/jboss/seam/example/registration/test/graphene/RegistrationFunctionalTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/registration/registration-ftest/src/test/java/org/jboss/seam/example/registration/test/graphene/RegistrationFunctionalTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,97 @@
+/*
+ * 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.example.registration.test.graphene;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.junit.InSequence;
+import org.jboss.seam.example.common.test.DeploymentResolver;
+import org.jboss.seam.example.common.test.SeamGrapheneTest;
+import org.jboss.shrinkwrap.api.Archive;
+import static org.junit.Assert.*;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * This class tests registration form functionality in registration example.
+ *
+ * @author Jozef Hartinger
+ *
+ */
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class RegistrationFunctionalTest extends SeamGrapheneTest {
+
+ @Deployment(testable = false)
+ public static Archive<?> createDeployment() {
+ return DeploymentResolver.createDeployment();
+ }
+
+ @Override
+ @Before
+ public void beforeTest() {
+ open(contextPath + getProperty("REGISTRATION_URL"));
+ }
+
+ @Test
+ @InSequence(1)
+ public void simpleRegistrationTest() {
+ String username = "johny";
+ String name = "John Doe";
+ String password = "secretPassword";
+
+ submitRegistrationForm(username, name, password);
+ assertTrue("After-registration page expected.", browser.getCurrentUrl().contains(getProperty("REGISTERED_URL")));
+ assertTrue("Welcome message should contain username.", isTextInSource(username));
+ assertTrue("Welcome message should contain name.", isTextInSource(name));
+ }
+
+ @Test
+ @InSequence(2)
+ public void duplicateUsernameTest() {
+ String username = "janeDoe";
+ String name = "Jane Doe";
+ String password = "secretPassword";
+ submitRegistrationForm(username, name, password);
+ browser.navigate().back();
+ submitRegistrationForm(username, name, password);
+ assertTrue("Registration page expected.", browser.getCurrentUrl().contains(getProperty("REGISTRATION_URL")));
+ assertTrue("Error message did not appear.", isTextInSource("User " + username + " already exists"));
+ }
+
+ @Test
+ @InSequence(3)
+ public void emptyValuesTest() {
+ submitRegistrationForm("", "", "");
+ assertTrue("Registration page expected.", browser.getCurrentUrl().contains(getProperty("REGISTRATION_URL")));
+ assertEquals("Unexpected number of error messages.", 3, getXpathCount(getBy("REGISTRATION_MESSAGE_COUNT")));
+ }
+
+ protected void submitRegistrationForm(String username, String name, String password) {
+ type(getBy("REGISTRATION_USERNAME"), username);
+ type(getBy("REGISTRATION_NAME"), name);
+ type(getBy("REGISTRATION_PASSWORD"), password);
+ clickAndWaitHttp(getBy("REGISTRATION_SUBMIT"));
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/registration/registration-ftest/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/registration/registration-ftest/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/registration/registration-ftest/src/test/resources/ftest.properties
===================================================================
--- branches/enterprise/WFK-2_1/examples/registration/registration-ftest/src/test/resources/ftest.properties (rev 0)
+++ branches/enterprise/WFK-2_1/examples/registration/registration-ftest/src/test/resources/ftest.properties 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,8 @@
+REGISTRATION_URL register.seam
+REGISTRATION_USERNAME id=registration:username
+REGISTRATION_NAME id=registration:name
+REGISTRATION_PASSWORD id=registration:password
+REGISTRATION_SUBMIT id=registration:register
+REGISTRATION_MESSAGE id=registration:messages
+REGISTRATION_MESSAGE_COUNT xpath=//ul[@id='registration:messages']/li
+REGISTERED_URL registered.seam
Modified: branches/enterprise/WFK-2_1/examples/remoting/chatroom/README.html
===================================================================
--- branches/enterprise/WFK-2_1/examples/remoting/chatroom/README.html 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/remoting/chatroom/README.html 2013-09-13 14:11:17 UTC (rev 15588)
@@ -1,6 +1,6 @@
<h1>Seam Chatroom Example</h1>
-<p>This example shows using Seam Remoting to subscribe and publish messages to JMS.</p>
+<p>This example shows using Seam Remoting to subscribe and publish messages to JMS. </p>
<h2>Running the example</h2>
@@ -9,27 +9,25 @@
<ol>
<li><p>In the example root directory run:</p>
-<pre><code> mvn clean install
+<pre><code>mvn clean install
</code></pre></li>
<li><p>Set JBOSS_HOME environment property.</p></li>
<li><p>In the chatroom-ear directory run:</p>
-<pre><code> mvn jboss-as:deploy
+<pre><code>mvn jboss-as:deploy
</code></pre></li>
<li><p>Open this URL in a web browser: http://localhost:8080/seam-chatroom</p></li>
</ol>
-
<h2>Testing the example</h2>
-<p>This example is covered by integration tests. All tests use the following technologies:</p>
+<p>This example is covered by integration and functional tests. All tests use the following technologies:</p>
<ul>
<li><strong>Arquillian</strong> - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,</li>
<li><strong>ShrinkWrap</strong> - to create the test archive (WAR).</li>
</ul>
-
<h3>Integration tests</h3>
<p>Integration tests cover core application logic and reside in the EJB module. In addition to Arquillian and ShrinkWrap, the integration tests also use:</p>
@@ -39,9 +37,8 @@
<li><strong>ShrinkWrap Resolver</strong> - to resolve dependencies of the project for packaging in the test archive.</li>
</ul>
+<p>The tests are executed in Maven's test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-<p>The tests are executed in Maven’s test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-
<pre><code>mvn clean test -Darquillian=jbossas-managed-7
</code></pre>
@@ -52,6 +49,41 @@
<pre><code>mvn clean test -Darquillian=jbossas-remote-7
</code></pre>
+<h3>Functional tests</h3>
+
+<p>Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:</p>
+
+<ul>
+<li><strong>Arquillian Graphene Extension</strong> - an advanced Ajax-capable type-safe Selenium-based browser testing tool,</li>
+<li><strong>Arquillian Drone Extension</strong> - to automatically run and stop browser instances.</li>
+</ul>
+
+<p><em>Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server.</em></p>
+
+<p>Run the functional test on JBoss AS instance with</p>
+
+<pre><code>mvn -f chatroom-ftest/pom.xml clean test
+</code></pre>
+
+<p>The <code>JBOSS_HOME</code> environment variable must be set and point to a JBoss AS instance directory.</p>
+
+<p>Several variables can be configured:</p>
+
+<ul>
+<li><p>path to an alternative archive for testing</p>
+
+<pre><code>-DtestDeployment=/path/to/archive.ear
+</code></pre></li>
+<li><p>the browser to use for testing</p>
+
+<pre><code>-DbrowserCapabilities=htmlUnit
+</code></pre></li>
+<li><p>test on a running server</p>
+
+<pre><code>-Dremote
+</code></pre></li>
+</ul>
+
<h2>Testing in JBDS</h2>
<h3>Integration tests</h3>
@@ -60,11 +92,20 @@
<li>Open JBDS and start a configured instance of JBoss AS</li>
<li>Import the example project and its submodules</li>
<li>In the <em>Project Explorer</em>, select the EJB module project, then
-
<ol>
<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and check <code>integration-tests</code> and <code>arq-jbossas-7-remote</code></li>
<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-</li>
+
+<h3>Functional tests</h3>
+
+<ol>
+<li>Open JBDS and start a configured instance of JBoss AS</li>
+<li>Import the <code>ftest</code> project of the example</li>
+<li>In the <em>Project Explorer</em>, select the ftest project, then
+<ol>
+<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and activate <code>arq-jbossas-7-remote</code> profile and deactivate <code>arq-jbossas-7-managed</code> profile</li>
+<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-
Modified: branches/enterprise/WFK-2_1/examples/remoting/chatroom/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/remoting/chatroom/README.md 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/remoting/chatroom/README.md 2013-09-13 14:11:17 UTC (rev 15588)
@@ -24,7 +24,7 @@
Testing the example
-------------------
-This example is covered by integration tests. All tests use the following technologies:
+This example is covered by integration and functional tests. All tests use the following technologies:
* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
* __ShrinkWrap__ - to create the test archive (WAR).
@@ -47,7 +47,35 @@
mvn clean test -Darquillian=jbossas-remote-7
+### Functional tests
+Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:
+
+* __Arquillian Graphene Extension__ - an advanced Ajax-capable type-safe Selenium-based browser testing tool,
+* __Arquillian Drone Extension__ - to automatically run and stop browser instances.
+
+_Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server._
+
+Run the functional test on JBoss AS instance with
+
+ mvn -f chatroom-ftest/pom.xml clean test
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+Several variables can be configured:
+
+* path to an alternative archive for testing
+
+ -DtestDeployment=/path/to/archive.ear
+
+* the browser to use for testing
+
+ -DbrowserCapabilities=htmlUnit
+
+* test on a running server
+
+ -Dremote
+
Testing in JBDS
---------------
### Integration tests
@@ -57,3 +85,11 @@
3. In the _Project Explorer_, select the EJB module project, then
1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and check `integration-tests` and `arq-jbossas-7-remote`
2. Right-click the module and select _Run As_ - _JUnit Test_
+
+### Functional tests
+
+1. Open JBDS and start a configured instance of JBoss AS
+2. Import the `ftest` project of the example
+3. In the _Project Explorer_, select the ftest project, then
+ 1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and activate `arq-jbossas-7-remote` profile and deactivate `arq-jbossas-7-managed` profile
+ 2. Right-click the module and select _Run As_ - _JUnit Test_
Added: branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/pom.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/src/test/java/org/jboss/seam/example/remoting/chatroom/test/graphene/ChatroomFunctionalTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/src/test/java/org/jboss/seam/example/remoting/chatroom/test/graphene/ChatroomFunctionalTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/src/test/java/org/jboss/seam/example/remoting/chatroom/test/graphene/ChatroomFunctionalTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,195 @@
+/*
+ * 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.example.remoting.chatroom.test.graphene;
+
+import com.google.common.base.Predicate;
+import java.net.MalformedURLException;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.example.common.test.DeploymentResolver;
+import org.jboss.seam.example.common.test.SeamGrapheneTest;
+import static org.jboss.seam.example.common.test.SeamGrapheneTest.getProperty;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.After;
+import static org.junit.Assert.*;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.openqa.selenium.Keys;
+import org.openqa.selenium.NotFoundException;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.firefox.FirefoxDriver;
+import org.openqa.selenium.support.ui.WebDriverWait;
+
+/**
+ * This class tests functionality of remoting/chatroom example. The test opens
+ * two browsers and tests communication between users.
+ *
+ * @author Martin Gencur
+ *
+ */
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class ChatroomFunctionalTest extends SeamGrapheneTest {
+
+ public static long timeout = 2000;
+
+ @Deployment(testable = false)
+ public static Archive<?> createDeployment() {
+ return DeploymentResolver.createDeployment();
+ }
+
+ private WebDriver driver;
+
+ private WebDriver driver2;
+
+ @Before
+ @Override
+ public void beforeTest() throws MalformedURLException {
+ driver = new FirefoxDriver();
+ driver2 = new FirefoxDriver();
+
+ driver.navigate().to(contextPath + getProperty("HOME_PAGE"));
+ driver2.navigate().to(contextPath + getProperty("HOME_PAGE"));
+ }
+
+ @After
+ public void afterTest() throws MalformedURLException {
+ driver.quit();
+ driver2.quit();
+ }
+
+// Graphene-WebDriver can't do multiple browsers ARQGRA-72
+// @Drone
+// @Secon
+// protected WebDriver browser2;
+ @Test // place holder - should be replaced by better tests as soon as JBSEAM-3944 is resolved
+ public void homePageLoadTest() {
+ assertEquals("Unexpected page title.", getProperty("HOME_PAGE_TITLE"), driver.getTitle());
+ }
+
+ @Test
+ public void connectAndChatTest() {
+
+ /*connect user to chat*/
+ connect();
+ /*verify that user is connected and is seen by other users*/
+ verifyConnecting();
+ /*exchange several messages*/
+ chat();
+ /*disconnect user from chat*/
+ disconnect();
+ /*verify that user is disconnected and is not in a list of users anymore*/
+ verifyDisconnecting();
+ }
+
+ public void connect() {
+ driver.findElement(getBy("NAME_INPUT")).sendKeys(getProperty("NAME1"));
+ driver.findElement(getBy("CONNECT_BUTTON")).click();
+ }
+
+ public void verifyConnecting() {
+ waitForElement(driver, "MARTIN_LISTED");
+
+ driver2.findElement(getBy("NAME_INPUT")).sendKeys(getProperty("NAME2"));
+ driver2.findElement(getBy("CONNECT_BUTTON")).click();
+ waitForElement(driver2, "JOZEF_LISTED");
+ waitForElement(driver2, "MARTIN_LISTED");
+
+ waitForText(driver, "CHAT_WINDOW", "JOZEF_CONNECTED");
+ waitForElement(driver, "JOZEF_LISTED");
+ }
+
+ public void disconnect() {
+ driver2.findElement(getBy("DISCONNECT_BUTTON")).click();
+ }
+
+ public void verifyDisconnecting() {
+ waitForElementNotPresent(driver2, "JOZEF_LISTED");
+ waitForElement(driver2, "DISCONNECT_BUTTON_DISABLED");
+
+ waitForText(driver, "CHAT_WINDOW", "JOZEF_DISCONNECTED");
+ waitForElementNotPresent(driver, "JOZEF_LISTED");
+ driver.findElement(getBy("DISCONNECT_BUTTON")).click();
+ waitForElementNotPresent(driver,"MARTIN_LISTED");
+ waitForElement(driver, "DISCONNECT_BUTTON_DISABLED");
+ }
+
+ public void chat() {
+ /*first user is sending a message*/
+ driver.findElement(getBy("MESSAGE_INPUT")).sendKeys(getProperty("MESSAGE_FROM_MARTIN"));
+ driver.findElement(getBy("MESSAGE_INPUT")).sendKeys(Keys.RETURN);
+ waitForText(driver, "CHAT_WINDOW", "MARTIN_GT");
+ waitForText(driver, "CHAT_WINDOW", "MESSAGE_FROM_MARTIN");
+
+ waitForText(driver2, "CHAT_WINDOW", "MARTIN_GT");
+ waitForText(driver2, "CHAT_WINDOW", "MESSAGE_FROM_MARTIN");
+
+ /*second user is sending a message*/
+ driver2.findElement(getBy("MESSAGE_INPUT")).sendKeys(getProperty("MESSAGE_FROM_JOZEF"));
+ driver2.findElement(getBy("MESSAGE_INPUT")).sendKeys(Keys.RETURN);
+ waitForText(driver2, "CHAT_WINDOW", "JOZEF_GT");
+ waitForText(driver2, "CHAT_WINDOW", "MESSAGE_FROM_JOZEF");
+
+ waitForText(driver, "CHAT_WINDOW", "JOZEF_GT");
+ waitForText(driver, "CHAT_WINDOW", "MESSAGE_FROM_JOZEF");
+ }
+
+ private void waitForElement(WebDriver browser, final String propertyName, final Object... args) {
+ new WebDriverWait(browser, timeout).until(new Predicate<WebDriver>() {
+
+ @Override
+ public boolean apply(WebDriver input) {
+ return input.findElement(getBy(propertyName, args)).isDisplayed();
+ }
+
+ });
+ }
+
+ private void waitForText(WebDriver browser, final String elementPropertyName, final String textPropertyName, final Object... args) {
+ new WebDriverWait(browser, timeout).until(new Predicate<WebDriver>() {
+
+ @Override
+ public boolean apply(WebDriver input) {
+ return input.findElement(getBy(elementPropertyName, args)).getText().contains(getProperty(textPropertyName));
+ }
+
+ });
+ }
+
+ private void waitForElementNotPresent(WebDriver browser, final String propertyName, final Object... args) {
+ new WebDriverWait(browser, timeout).until(new Predicate<WebDriver>() {
+
+ @Override
+ public boolean apply(WebDriver input) {
+ try {
+ input.findElement(getBy(propertyName, args));
+ return false;
+ } catch(NotFoundException nfe) {
+ return true;
+ }
+ }
+
+ });
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/src/test/resources/ftest.properties
===================================================================
--- branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/src/test/resources/ftest.properties (rev 0)
+++ branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ftest/src/test/resources/ftest.properties 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,21 @@
+HOME_PAGE chatroom.seam
+HOME_PAGE_TITLE Chat Room Example
+NAME_INPUT id=username
+CONNECT_BUTTON id=btnConnect
+DISCONNECT_BUTTON id=btnDisconnect
+CONNECT_BUTTON_DISABLED xpath=//input[@id='btnConnect'][@disabled]
+DISCONNECT_BUTTON_DISABLED xpath=//input[@id='btnDisconnect'][@disabled]
+MESSAGE_INPUT id=messageText
+CHAT_AREA id=channelDisplay
+NAME1 Martin
+NAME2 Jozef
+MARTIN_CONNECTED Martin connected.
+MARTIN_LISTED xpath=//div/select[@id='userList']/option[contains(text(),'Martin')]
+JOZEF_CONNECTED Jozef connected.
+JOZEF_LISTED xpath=//div/select[@id='userList']/option[contains(text(),'Jozef')]
+JOZEF_DISCONNECTED Jozef disconnected.
+MESSAGE_FROM_MARTIN Hello
+MESSAGE_FROM_JOZEF Good evening
+MARTIN_GT Martin>
+JOZEF_GT Jozef>
+CHAT_WINDOW id=channelDisplay
Modified: branches/enterprise/WFK-2_1/examples/remoting/helloworld/README.html
===================================================================
--- branches/enterprise/WFK-2_1/examples/remoting/helloworld/README.html 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/remoting/helloworld/README.html 2013-09-13 14:11:17 UTC (rev 15588)
@@ -9,27 +9,25 @@
<ol>
<li><p>In the example root directory run:</p>
-<pre><code> mvn clean install
+<pre><code>mvn clean install
</code></pre></li>
<li><p>Set JBOSS_HOME environment property.</p></li>
<li><p>In the helloworld-ear directory run:</p>
-<pre><code> mvn jboss-as:deploy
+<pre><code>mvn jboss-as:deploy
</code></pre></li>
<li><p>Open this URL in a web browser: http://localhost:8080/seam-helloworld</p></li>
</ol>
-
<h2>Testing the example</h2>
-<p>This example is covered by integration tests. All tests use the following technologies:</p>
+<p>This example is covered by integration and functional tests. All tests use the following technologies:</p>
<ul>
<li><strong>Arquillian</strong> - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,</li>
<li><strong>ShrinkWrap</strong> - to create the test archive (WAR).</li>
</ul>
-
<h3>Integration tests</h3>
<p>Integration tests cover core application logic and reside in the EJB module. In addition to Arquillian and ShrinkWrap, the integration tests also use:</p>
@@ -39,9 +37,8 @@
<li><strong>ShrinkWrap Resolver</strong> - to resolve dependencies of the project for packaging in the test archive.</li>
</ul>
+<p>The tests are executed in Maven's test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-<p>The tests are executed in Maven’s test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-
<pre><code>mvn clean test -Darquillian=jbossas-managed-7
</code></pre>
@@ -52,6 +49,41 @@
<pre><code>mvn clean test -Darquillian=jbossas-remote-7
</code></pre>
+<h3>Functional tests</h3>
+
+<p>Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:</p>
+
+<ul>
+<li><strong>Arquillian Graphene Extension</strong> - an advanced Ajax-capable type-safe Selenium-based browser testing tool,</li>
+<li><strong>Arquillian Drone Extension</strong> - to automatically run and stop browser instances.</li>
+</ul>
+
+<p><em>Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server.</em></p>
+
+<p>Run the functional test on JBoss AS instance with</p>
+
+<pre><code>mvn -f helloworld-ftest/pom.xml clean test
+</code></pre>
+
+<p>The <code>JBOSS_HOME</code> environment variable must be set and point to a JBoss AS instance directory.</p>
+
+<p>Several variables can be configured:</p>
+
+<ul>
+<li><p>path to an alternative archive for testing</p>
+
+<pre><code>-DtestDeployment=/path/to/archive.ear
+</code></pre></li>
+<li><p>the browser to use for testing</p>
+
+<pre><code>-DbrowserCapabilities=htmlUnit
+</code></pre></li>
+<li><p>test on a running server</p>
+
+<pre><code>-Dremote
+</code></pre></li>
+</ul>
+
<h2>Testing in JBDS</h2>
<h3>Integration tests</h3>
@@ -60,11 +92,20 @@
<li>Open JBDS and start a configured instance of JBoss AS</li>
<li>Import the example project and its submodules</li>
<li>In the <em>Project Explorer</em>, select the EJB module project, then
-
<ol>
<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and check <code>integration-tests</code> and <code>arq-jbossas-7-remote</code></li>
<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-</li>
+
+<h3>Functional tests</h3>
+
+<ol>
+<li>Open JBDS and start a configured instance of JBoss AS</li>
+<li>Import the <code>ftest</code> project of the example</li>
+<li>In the <em>Project Explorer</em>, select the ftest project, then
+<ol>
+<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and activate <code>arq-jbossas-7-remote</code> profile and deactivate <code>arq-jbossas-7-managed</code> profile</li>
+<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-
Modified: branches/enterprise/WFK-2_1/examples/remoting/helloworld/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/remoting/helloworld/README.md 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/remoting/helloworld/README.md 2013-09-13 14:11:17 UTC (rev 15588)
@@ -24,7 +24,7 @@
Testing the example
-------------------
-This example is covered by integration tests. All tests use the following technologies:
+This example is covered by integration and functional tests. All tests use the following technologies:
* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
* __ShrinkWrap__ - to create the test archive (WAR).
@@ -47,7 +47,35 @@
mvn clean test -Darquillian=jbossas-remote-7
+### Functional tests
+Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:
+
+* __Arquillian Graphene Extension__ - an advanced Ajax-capable type-safe Selenium-based browser testing tool,
+* __Arquillian Drone Extension__ - to automatically run and stop browser instances.
+
+_Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server._
+
+Run the functional test on JBoss AS instance with
+
+ mvn -f helloworld-ftest/pom.xml clean test
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+Several variables can be configured:
+
+* path to an alternative archive for testing
+
+ -DtestDeployment=/path/to/archive.ear
+
+* the browser to use for testing
+
+ -DbrowserCapabilities=htmlUnit
+
+* test on a running server
+
+ -Dremote
+
Testing in JBDS
---------------
### Integration tests
@@ -57,3 +85,11 @@
3. In the _Project Explorer_, select the EJB module project, then
1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and check `integration-tests` and `arq-jbossas-7-remote`
2. Right-click the module and select _Run As_ - _JUnit Test_
+
+### Functional tests
+
+1. Open JBDS and start a configured instance of JBoss AS
+2. Import the `ftest` project of the example
+3. In the _Project Explorer_, select the ftest project, then
+ 1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and activate `arq-jbossas-7-remote` profile and deactivate `arq-jbossas-7-managed` profile
+ 2. Right-click the module and select _Run As_ - _JUnit Test_
Added: branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/pom.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/src/test/java/org/jboss/seam/example/remoting/helloworld/test/graphene/HelloworldFunctionalTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/src/test/java/org/jboss/seam/example/remoting/helloworld/test/graphene/HelloworldFunctionalTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/src/test/java/org/jboss/seam/example/remoting/helloworld/test/graphene/HelloworldFunctionalTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,98 @@
+/*
+ * 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.example.remoting.helloworld.test.graphene;
+
+import java.net.MalformedURLException;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.junit.InSequence;
+import org.jboss.seam.example.common.test.DeploymentResolver;
+import org.jboss.seam.example.common.test.SeamGrapheneTest;
+import org.jboss.shrinkwrap.api.Archive;
+import static org.junit.Assert.*;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.openqa.selenium.Alert;
+import org.openqa.selenium.NoAlertPresentException;
+
+/**
+ * This class tests a functionality of remoting/helloworld example.
+ *
+ * @author Martin Gencur
+ *
+ */
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class HelloworldFunctionalTest extends SeamGrapheneTest {
+
+ protected static final int TRIES = 5;
+ protected static final int INTERVAL = 2000;
+
+ @Deployment(testable = false)
+ public static Archive<?> createDeployment() {
+ return DeploymentResolver.createDeployment();
+ }
+
+ @Override
+ @Before
+ public void beforeTest() throws MalformedURLException {
+ Assume.assumeTrue(isRealBrowser());// due to alerts
+ open(contextPath.toString() + getProperty("HELLOWORLD_URL"));
+ }
+
+ @Test
+ @InSequence(1)
+ public void simplePageContentTest() {
+ assertTrue("Home page of Remoting/Helloworld Example expected",
+ browser.getCurrentUrl().contains(getProperty("HELLOWORLD_URL")));
+ assertTrue("Different page title expected", browser.getTitle().contains(getProperty("HELLOWORLD_TITLE")));
+ assertTrue("Home page should contain Say Hello button", isElementPresent(getBy("SAYHELLO_BUTTON")));
+ }
+
+ @Test
+ @InSequence(2)
+ public void sayHelloButtonTest() {
+ click(getBy("SAYHELLO_BUTTON"));
+ Alert prompt = browser.switchTo().alert();
+ prompt.sendKeys(getProperty("PROMPT_ANSWER"));
+ prompt.accept();
+
+ Alert alert = null;
+ // the second alert does not appear immediately
+ for (int i = 0; i < TRIES; i++) {
+ try {
+ alert = browser.switchTo().alert();
+ break;
+ } catch (NoAlertPresentException ex) {
+ try {
+ Thread.sleep(INTERVAL);
+ } catch (InterruptedException ex1) {
+ }
+ }
+ }
+ assertTrue("An alert message should show up and should contain \"Hello,\" and name.",
+ alert.getText().contains(getProperty("ALERT_MESSAGE")));
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/src/test/resources/ftest.properties
===================================================================
--- branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/src/test/resources/ftest.properties (rev 0)
+++ branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ftest/src/test/resources/ftest.properties 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,5 @@
+HELLOWORLD_TITLE Seam Remoting - Hello World Example
+SAYHELLO_BUTTON xpath=//button[contains(@onclick,"sayHello")]
+PROMPT_ANSWER Martin
+ALERT_MESSAGE Hello, Martin
+HELLOWORLD_URL /helloworld.seam
Modified: branches/enterprise/WFK-2_1/examples/seambay/README.html
===================================================================
--- branches/enterprise/WFK-2_1/examples/seambay/README.html 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/seambay/README.html 2013-09-13 14:11:17 UTC (rev 15588)
@@ -9,27 +9,25 @@
<ol>
<li><p>In the example root directory run:</p>
-<pre><code> mvn clean install
+<pre><code>mvn clean install
</code></pre></li>
<li><p>Set JBOSS_HOME environment property.</p></li>
<li><p>In the seambay-ear directory run:</p>
-<pre><code> mvn jboss-as:deploy
+<pre><code>mvn jboss-as:deploy
</code></pre></li>
<li><p>Open this URL in a web browser: http://localhost:8080/seam-seambay</p></li>
</ol>
-
<h2>Testing the example</h2>
-<p>This example is covered by integration tests. All tests use the following technologies:</p>
+<p>This example is covered by integration and functional tests. All tests use the following technologies:</p>
<ul>
<li><strong>Arquillian</strong> - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,</li>
<li><strong>ShrinkWrap</strong> - to create the test archive (WAR).</li>
</ul>
-
<h3>Integration tests</h3>
<p>Integration tests cover core application logic and reside in the EJB module. In addition to Arquillian and ShrinkWrap, the integration tests also use:</p>
@@ -39,9 +37,8 @@
<li><strong>ShrinkWrap Resolver</strong> - to resolve dependencies of the project for packaging in the test archive.</li>
</ul>
+<p>The tests are executed in Maven's test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-<p>The tests are executed in Maven’s test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-
<pre><code>mvn clean test -Darquillian=jbossas-managed-7
</code></pre>
@@ -52,6 +49,41 @@
<pre><code>mvn clean test -Darquillian=jbossas-remote-7
</code></pre>
+<h3>Functional tests</h3>
+
+<p>Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:</p>
+
+<ul>
+<li><strong>Arquillian Graphene Extension</strong> - an advanced Ajax-capable type-safe Selenium-based browser testing tool,</li>
+<li><strong>Arquillian Drone Extension</strong> - to automatically run and stop browser instances.</li>
+</ul>
+
+<p><em>Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server.</em></p>
+
+<p>Run the functional test on JBoss AS instance with</p>
+
+<pre><code>mvn -f seambay-ftest/pom.xml clean test
+</code></pre>
+
+<p>The <code>JBOSS_HOME</code> environment variable must be set and point to a JBoss AS instance directory.</p>
+
+<p>Several variables can be configured:</p>
+
+<ul>
+<li><p>path to an alternative archive for testing</p>
+
+<pre><code>-DtestDeployment=/path/to/archive.ear
+</code></pre></li>
+<li><p>the browser to use for testing</p>
+
+<pre><code>-DbrowserCapabilities=htmlUnit
+</code></pre></li>
+<li><p>test on a running server</p>
+
+<pre><code>-Dremote
+</code></pre></li>
+</ul>
+
<h2>Testing in JBDS</h2>
<h3>Integration tests</h3>
@@ -60,11 +92,20 @@
<li>Open JBDS and start a configured instance of JBoss AS</li>
<li>Import the example project and its submodules</li>
<li>In the <em>Project Explorer</em>, select the EJB module project, then
-
<ol>
<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and check <code>integration-tests</code> and <code>arq-jbossas-7-remote</code></li>
<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-</li>
+
+<h3>Functional tests</h3>
+
+<ol>
+<li>Open JBDS and start a configured instance of JBoss AS</li>
+<li>Import the <code>ftest</code> project of the example</li>
+<li>In the <em>Project Explorer</em>, select the ftest project, then
+<ol>
+<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and activate <code>arq-jbossas-7-remote</code> profile and deactivate <code>arq-jbossas-7-managed</code> profile</li>
+<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-
Modified: branches/enterprise/WFK-2_1/examples/seambay/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/seambay/README.md 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/seambay/README.md 2013-09-13 14:11:17 UTC (rev 15588)
@@ -24,7 +24,7 @@
Testing the example
-------------------
-This example is covered by integration tests. All tests use the following technologies:
+This example is covered by integration and functional tests. All tests use the following technologies:
* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
* __ShrinkWrap__ - to create the test archive (WAR).
@@ -47,7 +47,35 @@
mvn clean test -Darquillian=jbossas-remote-7
+### Functional tests
+Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:
+
+* __Arquillian Graphene Extension__ - an advanced Ajax-capable type-safe Selenium-based browser testing tool,
+* __Arquillian Drone Extension__ - to automatically run and stop browser instances.
+
+_Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server._
+
+Run the functional test on JBoss AS instance with
+
+ mvn -f seambay-ftest/pom.xml clean test
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+Several variables can be configured:
+
+* path to an alternative archive for testing
+
+ -DtestDeployment=/path/to/archive.ear
+
+* the browser to use for testing
+
+ -DbrowserCapabilities=htmlUnit
+
+* test on a running server
+
+ -Dremote
+
Testing in JBDS
---------------
### Integration tests
@@ -57,3 +85,11 @@
3. In the _Project Explorer_, select the EJB module project, then
1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and check `integration-tests` and `arq-jbossas-7-remote`
2. Right-click the module and select _Run As_ - _JUnit Test_
+
+### Functional tests
+
+1. Open JBDS and start a configured instance of JBoss AS
+2. Import the `ftest` project of the example
+3. In the _Project Explorer_, select the ftest project, then
+ 1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and activate `arq-jbossas-7-remote` profile and deactivate `arq-jbossas-7-managed` profile
+ 2. Right-click the module and select _Run As_ - _JUnit Test_
Added: branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/pom.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/BidTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/BidTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/BidTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,61 @@
+/*
+ * 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.example.seambay.test.graphene;
+
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import static org.junit.Assert.*;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ *
+ * @author Jozef Hartinger
+ *
+ */
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class BidTest extends SeamBayFunctionalTestBase {
+
+ @Test
+ public void simpleBidTest() {
+ String title = "Lost Tales Volume 1 by J.R.R. Tolkien";
+ String price = "10";
+ int bidCount;
+
+ login();
+ search(title);
+ clickAndWaitHttp(getBy("SEARCH_RESULTS_FIRST_ROW_LINK"));
+ clickAndWaitHttp(getBy("ITEM_BID_HISTORY"));
+ if (isElementPresent(getBy("BID_HISTORY_COUNT_EMPTY"))) {
+ bidCount = 0;
+ } else {
+ bidCount = getXpathCount(getBy("BID_HISTORY_COUNT"));
+ }
+ browser.navigate().back();
+ placeBid(price);
+ assertTrue("Auction page expected.", browser.getCurrentUrl().contains(getProperty("AUCTION_URL")));
+ clickAndWaitHttp(getBy("ITEM_BID_HISTORY"));
+ assertEquals("Unexpected count of bids.", ++bidCount, getXpathCount(getBy("BID_HISTORY_COUNT")));
+ }
+
+}
Added: branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/ComplexBidTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/ComplexBidTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/ComplexBidTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,215 @@
+package org.jboss.seam.example.seambay.test.graphene;
+
+import java.net.URL;
+import java.text.MessageFormat;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.test.api.ArquillianResource;
+import org.jboss.seam.example.common.test.DeploymentResolver;
+import static org.jboss.seam.example.common.test.SeamGrapheneTest.getProperty;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.After;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.openqa.selenium.By;
+import org.openqa.selenium.NoSuchElementException;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.firefox.FirefoxDriver;
+
+// Until Graphene handles two browsers, this test will be a mess
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class ComplexBidTest {
+
+ @Deployment(testable = false)
+ public static Archive<?> createDeployment() {
+ return DeploymentResolver.createDeployment();
+ }
+
+ @ArquillianResource
+ protected URL contextPath;
+
+ protected String defaultLogin = "demo";
+
+ protected String defaultPassword = "demo";
+
+ private WebDriver browser;
+
+ private WebDriver secondBrowser;
+
+ private WebDriver theBrowser;
+
+ @Before
+ public void beforeTest() {
+ browser = new FirefoxDriver();
+ secondBrowser = new FirefoxDriver();
+ theBrowser = browser;
+ open(contextPath.toString());
+ }
+
+ @After
+ public void afterTest() {
+ browser.quit();
+ secondBrowser.quit();
+ }
+
+ @Test
+ public void complexBidTest() {
+ String firstBidderName = "honestjoe";
+ String secondBidderName = "bidTester";
+ String title = "Nikon D80 Digital Camera";
+
+ if (isLoggedIn()) {
+ logout();
+ }
+
+ // register new user in first browser
+ clickAndWaitHttp(getBy("REGISTRATION"));
+ submitRegistrationForm(secondBidderName, "password", "password", "Slovakia");
+ assertTrue("Creating new user failed.", isLoggedIn());
+
+ // place a bid for a camera
+ search(title);
+ clickAndWaitHttp(getBy("SEARCH_RESULTS_FIRST_ROW_LINK"));
+ placeBid("2000");
+
+ theBrowser = secondBrowser;
+ open(contextPath + getProperty("HOME_PAGE"));
+
+ login(defaultLogin, defaultPassword);
+ search(title);
+ clickAndWaitHttp(getBy("SEARCH_RESULTS_FIRST_ROW_LINK"));
+ for (int i = 1100; i < 2000; i += 200) {
+ placeBid(String.valueOf(i));
+ assertTrue("'You have been outbid' page expected.", isElementPresent(getBy("BID_OUTBID")));
+ }
+ placeBid("2200");
+ assertFalse("Outbid unexpectedly", isElementPresent(getBy("BID_OUTBID")));
+ assertEquals("High bidder not recognized.", firstBidderName, getText(getBy("BID_HIGH_BIDDER")));
+
+ theBrowser = browser;
+ placeBid("2100");
+ assertTrue("'You have been outbid' page expected.", isElementPresent(getBy("BID_OUTBID")));
+ placeBid("2500");
+ assertEquals("High bidder not recognized.", secondBidderName, getText(getBy("BID_HIGH_BIDDER")));
+ }
+
+ public void placeBid(String price) {
+ if (isElementPresent(getBy("ITEM_NEW_BID_FIELD"))) {
+ type(getBy("ITEM_NEW_BID_FIELD"), price, true);
+ clickAndWaitHttp(getBy("ITEM_NEW_BID_SUBMIT"));
+ } else if (isElementPresent(getBy("BID_INCREASE_FIELD"))) {
+ type(getBy("BID_INCREASE_FIELD"), price, true);
+ clickAndWaitHttp(getBy("BID_INCREASE_SUBMIT"));
+ } else {
+ fail("Unable to place a bid.");
+ }
+ clickAndWaitHttp(getBy("BID_CONFIRM"));
+ }
+
+ public void clickAndWaitHttp(By by) {
+ theBrowser.findElement(by).click();
+ sleep(5000);
+ }
+
+ public boolean isLoggedIn() {
+ return isElementPresent(getBy("LOGOUT"));
+ }
+
+ public void logout() {
+ clickAndWaitHttp(getBy("LOGOUT"));
+ }
+
+ public boolean isElementPresent(By by) {
+ try {
+ return theBrowser.findElement(by).isDisplayed();
+ } catch(NoSuchElementException ex) {
+ return false;
+ }
+ }
+
+ public void submitRegistrationForm(String username, String password, String verify, String location) {
+ assertTrue("Registration page expected.", theBrowser.getCurrentUrl().contains(getProperty("REGISTRATION_URL")));
+ type(getBy("REGISTRATION_USERNAME"), username, true);
+ type(getBy("REGISTRATION_PASSWORD"), password, true);
+ type(getBy("REGISTRATION_VERIFY"), verify, true);
+ type(getBy("REGISTRATION_LOCATION"), location, true);
+ clickAndWaitHttp(getBy("REGISTRATION_SUBMIT"));
+ }
+
+ public int search(String keyword) {
+ type(getBy("SEARCH_FIELD"), keyword, true);
+ clickAndWaitHttp(getBy("SEARCH_SUBMIT"));
+ return getXpathCount(getBy("SEARCH_RESULTS_COUNT"));
+ }
+
+ public void open(String url) {
+ theBrowser.navigate().to(url);
+ sleep(1000);// the Navigation.to doesn't seem to block as well as it should
+ }
+
+ public void type(By by, CharSequence text, boolean clear) {
+ WebElement elem = theBrowser.findElement(by);
+ if (clear) {
+ elem.clear();
+ }
+ elem.sendKeys(text);
+ }
+
+ public String getText(By by) {
+ return theBrowser.findElement(by).getText();
+ }
+
+ public int getXpathCount(By by) {
+ return theBrowser.findElements(by).size();
+ }
+
+ public void login(String username, String password) {
+ if (!isLoggedIn()) {
+ clickAndWaitHttp(getBy("LOGIN"));
+ submitLoginForm(username, password);
+ }
+ }
+
+ public void submitLoginForm(String username, String password) {
+ type(getBy("LOGIN_USERNAME"), username, true);
+ type(getBy("LOGIN_PASSWORD"), password, true);
+ clickAndWaitHttp(getBy("LOGIN_SUBMIT"));
+ }
+
+ public By getBy(String seleniumLocatorProperty, Object... args) {
+ String seleniumLocator = getProperty(seleniumLocatorProperty);
+ if (seleniumLocator == null) {
+ seleniumLocator = seleniumLocatorProperty;
+ }
+ String locator = seleniumLocator.substring(seleniumLocator.indexOf("=") + 1);
+ if (args.length != 0) {
+ locator = MessageFormat.format(locator, args);
+ }
+ if (seleniumLocator.startsWith("id")) {
+ return By.id(locator);
+ } else if (seleniumLocator.startsWith("xpath")) {
+ return By.xpath(locator);
+ } else if (seleniumLocator.startsWith("css")) {
+ return By.cssSelector(locator);
+ } else if (seleniumLocator.startsWith("link")) {
+ return By.linkText(locator);
+ } else {
+ return null;
+ }
+ }
+
+ public void sleep(int millis) {
+ try {
+ Thread.sleep(millis);
+ } catch (InterruptedException ex) {
+ }
+ }
+}
\ No newline at end of file
Added: branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/RegistrationTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/RegistrationTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/RegistrationTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,74 @@
+/*
+ * 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.example.seambay.test.graphene;
+
+import java.net.MalformedURLException;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import static org.junit.Assert.*;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ *
+ * @author Jozef Hartinger
+ *
+ */
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class RegistrationTest extends SeamBayFunctionalTestBase {
+
+ @Override
+ @Before
+ public void beforeTest() throws MalformedURLException {
+ super.beforeTest();
+ if (isLoggedIn()) {
+ logout();
+ }
+ clickAndWaitHttp(getBy("REGISTRATION"));
+ }
+
+ @Test
+ public void testRegistration() {
+ submitRegistrationForm("tester", "password", "password", "location");
+ assertTrue("Registration failed.", isLoggedIn());
+ }
+
+ /**
+ * This test verifies that application will not crash after submitting empty
+ * registration form
+ */
+ @Test
+ public void testEmptyRegistration() {
+ submitRegistrationForm("", "", "", "");
+ assertFalse("Registration resulted in debug page.", browser.getCurrentUrl().contains(getProperty("DEBUG_PAGE")));
+ }
+
+ @Test
+ public void testPasswordConfirmation() {
+ submitRegistrationForm("tester1", "password", "differentPassword", "location");
+ assertTrue("Registration page expected.",
+ browser.getCurrentUrl().contains(getProperty("REGISTRATION_PAGE")));
+ assertTrue("Error message not displayed.", isElementPresent(getBy("REGISTRATION_CONFIRM_MESSAGE")));
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/SeamBayFunctionalTestBase.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/SeamBayFunctionalTestBase.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/SeamBayFunctionalTestBase.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,98 @@
+/*
+ * 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.example.seambay.test.graphene;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.seam.example.common.test.DeploymentResolver;
+import org.jboss.seam.example.common.test.SeamGrapheneTest;
+import org.jboss.shrinkwrap.api.Archive;
+import static org.junit.Assert.*;
+
+/**
+ * Main class for SeamBay example tests
+ *
+ * @author Jozef Hartinger
+ *
+ */
+public class SeamBayFunctionalTestBase extends SeamGrapheneTest {
+
+ @Deployment(testable = false)
+ public static Archive<?> createDeployment() {
+ return DeploymentResolver.createDeployment();
+ }
+ protected String defaultLogin = "demo";
+ protected String defaultPassword = "demo";
+
+ public void login(String username, String password) {
+ if (!isLoggedIn()) {
+ clickAndWaitHttp(getBy("LOGIN"));
+ submitLoginForm(username, password);
+ }
+ }
+
+ public void login() {
+ login(defaultLogin, defaultPassword);
+ }
+
+ public boolean isLoggedIn() {
+ return isElementPresent(getBy("LOGOUT"));
+ }
+
+ public void logout() {
+ clickAndWaitHttp(getBy("LOGOUT"));
+ }
+
+ public void submitRegistrationForm(String username, String password, String verify, String location) {
+ assertTrue("Registration page expected.", browser.getCurrentUrl().contains(getProperty("REGISTRATION_URL")));
+ type(getBy("REGISTRATION_USERNAME"), username);
+ type(getBy("REGISTRATION_PASSWORD"), password);
+ type(getBy("REGISTRATION_VERIFY"), verify);
+ type(getBy("REGISTRATION_LOCATION"), location);
+ clickAndWaitHttp(getBy("REGISTRATION_SUBMIT"));
+ }
+
+ public void submitLoginForm(String username, String password) {
+ type(getBy("LOGIN_USERNAME"), username);
+ type(getBy("LOGIN_PASSWORD"), password);
+ clickAndWaitHttp(getBy("LOGIN_SUBMIT"));
+ }
+
+ public int search(String keyword) {
+ type(getBy("SEARCH_FIELD"), keyword);
+ clickAndWaitHttp(getBy("SEARCH_SUBMIT"));
+ return getXpathCount(getBy("SEARCH_RESULTS_COUNT"));
+ }
+
+ public void placeBid(String price) {
+ if (isElementPresent(getBy("ITEM_NEW_BID_FIELD"))) {
+ type(getBy("ITEM_NEW_BID_FIELD"), price);
+ clickAndWaitHttp(getBy("ITEM_NEW_BID_SUBMIT"));
+ } else if (isElementPresent(getBy("BID_INCREASE_FIELD"))) {
+ type(getBy("BID_INCREASE_FIELD"), price);
+ clickAndWaitHttp(getBy("BID_INCREASE_SUBMIT"));
+ } else {
+ fail("Unable to place a bid.");
+ }
+ clickAndWaitHttp(getBy("BID_CONFIRM"));
+ }
+
+}
Added: branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/SearchTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/SearchTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/SearchTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,44 @@
+/*
+ * 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.example.seambay.test.graphene;
+
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import static org.junit.Assert.*;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ *
+ * @author Jozef Hartinger
+ *
+ */
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class SearchTest extends SeamBayFunctionalTestBase {
+
+ @Test
+ public void searchTest() {
+ String title = "Pontiac Firebird Trans Am T-top";
+ assertEquals("Unexpected number of search results.", 1, search(title));
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/SellTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/SellTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/SellTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,117 @@
+/*
+ * 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.example.seambay.test.graphene;
+
+import java.math.BigDecimal;
+import static org.junit.Assert.*;
+
+import java.text.NumberFormat;
+import java.text.ParseException;
+
+import org.junit.Test;
+
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import static org.jboss.arquillian.graphene.Graphene.*;
+import org.jboss.arquillian.junit.Arquillian;
+import org.junit.runner.RunWith;
+import org.openqa.selenium.support.ui.Select;
+
+/**
+ *
+ * @author Jozef Hartinger
+ *
+ */
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class SellTest extends SeamBayFunctionalTestBase {
+
+ private long listWaitTime = 5000;
+ private NumberFormat nf = NumberFormat.getInstance();
+
+ @Test
+ public void joystickSellingTest() throws NumberFormatException, ParseException {
+ String title = "Saitek X52 Pro Flight System";
+ int category = 7;
+ int subcategory = 3;
+ String duration = "7";
+ String price = "100";
+ String description = "The most fully integrated Stick and throttle flight controller: built to meet the demands of the best virtual pilots in the world!";
+
+ sellItem(title, category, subcategory, duration, price, description);
+ }
+
+ protected void sellItem(String title, int category, int subcategory, String duration, String price, String description) throws NumberFormatException, ParseException {
+ login();
+ clickAndWaitHttp(getBy("SELL"));
+ submitSell1Page(title);
+ submitSell2Page(category, subcategory);
+ submitSell3Page(duration, price);
+ submitSell4Page();
+ submitSell5Page(description);
+ validatePreview(price, description);
+ clickAndWaitHttp(getBy("SELL_CONFIRM"));
+ assertTrue("Navigation failure, home page expected", browser.getCurrentUrl().contains(getProperty("HOME_PAGE")));
+ assertEquals("Unexpected number of search results.", 1, search(title));
+ }
+
+ protected void submitSell1Page(String title) {
+ assertTrue("Navigation failure, sell1 page expected", browser.getCurrentUrl().contains(getProperty("SELL_1_URL")));
+ type(getBy("SELL_TITLE"), title);
+ clickAndWaitHttp(getBy("SELL_NEXT"));
+ }
+
+ protected void submitSell2Page(int category, int subcategory) {
+ assertTrue("Navigation failure, sell2 page expected", browser.getCurrentUrl().contains(getProperty("SELL_2_URL")));
+ waitModel().until(element(getBy("SELL_CATEGORY_SELECT_SECOND_OPTION")).isPresent());
+ new Select(browser.findElement(getBy("SELL_CATEGORY_SELECT"))).selectByIndex(category);
+
+ if (subcategory != 0) {
+ waitModel().until(element(getBy("SELL_SUBCATEGORY_SELECT")).isPresent());
+ new Select(browser.findElement(getBy("SELL_SUBCATEGORY_SELECT"))).selectByIndex(subcategory);
+ }
+ clickAndWaitHttp(getBy("SELL_NEXT"));
+ }
+
+ protected void submitSell3Page(String duration, String price) {
+ assertTrue("Navigation failure, sell3 page expected", browser.getCurrentUrl().contains(getProperty("SELL_3_URL")));
+ type(getBy("SELL_DURATION"), duration);
+ type(getBy("SELL_PRICE"), price);
+ clickAndWaitHttp(getBy("SELL_NEXT"));
+ }
+
+ protected void submitSell4Page() {
+ assertTrue("Navigation failure, sell4 page expected", browser.getCurrentUrl().contains(getProperty("SELL_4_URL")));
+ clickAndWaitHttp(getBy("SELL_NEXT"));
+ }
+
+ protected void submitSell5Page(String description) {
+ assertTrue("Navigation failure, sell5 page expected", browser.getCurrentUrl().contains(getProperty("SELL_5_URL")));
+ type(getBy("SELL_DESCRIPTION"), description);
+ clickAndWaitHttp(getBy("SELL_NEXT"));
+ }
+
+ protected void validatePreview(String price, String description) throws NumberFormatException, ParseException {
+ assertTrue("Must be on preview page to validate preview.", browser.getCurrentUrl().contains(getProperty("SELL_PREVIEW_URL")));
+ assertEquals("Unexpected price on preview page.", new BigDecimal(price), new BigDecimal(nf.parse(getText(getBy("SELL_PREVIEW_PRICE"))).doubleValue()));
+ assertEquals("Unexpected description on description page.", description, getText(getBy("SELL_PREVIEW_DESCRIPTION")));
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/WebServicesTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/WebServicesTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/WebServicesTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,315 @@
+package org.jboss.seam.example.seambay.test.graphene;
+
+import com.google.common.base.Predicate;
+import java.net.MalformedURLException;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import static org.jboss.arquillian.graphene.Graphene.*;
+import org.jboss.arquillian.graphene.wait.WebDriverWait;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.junit.InSequence;
+import org.jboss.seam.example.common.test.DeploymentResolver;
+import org.jboss.seam.example.common.test.SeamGrapheneTest;
+import org.jboss.shrinkwrap.api.Archive;
+import static org.junit.Assert.*;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.openqa.selenium.By;
+
+/**
+ * Tests Web Services of Seambay example. Uses WebDriver to test, browser is
+ * chosen according to parameter passed
+ *
+ * @author kpiwko
+ *
+ */
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class WebServicesTest extends SeamGrapheneTest {
+
+ protected static final int WAIT_TIME = 1000;
+ protected static final int WAIT_TIMEOUT = 10;//seconds
+ protected static final int JS_TIMEOUT = 500;//ms
+ protected static final By HERE_LINK = By.partialLinkText("here");
+ protected static final String SERVICE_PAGE_URL = "test.seam";
+ protected static final By INVOKE_SERVICE_BUTTON = By.xpath("//button[contains(@onclick,'sendRequest')]");
+ protected static final By REQUEST_AREA = By.id("serviceRequest");
+ protected static final By RESPONSE_AREA = By.id("serviceResponse");
+ protected static final By SELECTED_SERVICE = By.id("selectedService");
+ protected static final String LOGIN_LINK_TEXT = "Login";
+ protected static final String LIST_CATEGORIES_LINK_TEXT = "List Categories";
+ protected static final String CREATE_NEW_AUCTION_LINK_TEXT = "Create new auction";
+ protected static final String UPDATE_AUCTION_DETAILS_LINK_TEXT = "Update auction details";
+ protected static final String SET_AUCTION_DURATION_LINK_TEXT = "Set auction duration";
+ protected static final String SET_STARTING_PRICE_LINK_TEXT = "Set starting price";
+ protected static final String GET_AUCTION_DETAILS_LINK_TEXT = "Get the auction details";
+ protected static final String CONFIRM_AUCTION_LINK_TEXT = "Confirm auction";
+ protected static final String FIND_AUCTIONS_LINK_TEXT = "Find Auctions";
+ protected static final String LOGOUT_LINK_TEXT = "Logout";
+
+ /* login parameters */
+ protected static final By LOGIN_INPUT_USERNAME = By.id("username");
+ protected static final By LOGIN_INPUT_PASSWORD = By.id("password");
+
+ /* create new auction parameters */
+ protected static final By AUCTION_TITLE = By.id("title");
+ protected static final By AUCTION_DESCRIPTION = By.id("description");
+ protected static final By AUCTION_CATEGORY_ID = By.id("categoryId");
+
+ /* parameters for other tests */
+ protected static final By SEARCH_TERM = By.id("searchTerm");
+ protected static final By AUCTION_DURATION = By.id("duration");
+ protected static final By STARTING_PRICE = By.id("price");
+
+ /* responses */
+ protected static final String LIST_CATEGORIES_RESPONSE = "<ns2:listCategoriesResponse xmlns:ns2=\"http://seambay.example.seam.jboss.org/\"><return><categoryId>1</categoryId><name>Antiques</name></return><return><categoryId>2</categoryId><name>Art</name></return><return><categoryId>3</categoryId><name>Books</name></return><return><categoryId>4</categoryId><name>Cameras and Photography</name></return><return><categoryId>5</categoryId><name>Cars and Boats</name></return><return><categoryId>6</categoryId><name>Cell Phones</name></return><return><categoryId>7</categoryId><name>Clothing and Shoes</name></return><return><categoryId>8</categoryId><name>Computers</name></return><return><categoryId>9</categoryId><name>Music</name></return><return><categoryId>10</categoryId><name>Electronics</name></return><return><categoryId>11</categoryId><name>Home and Garden</name></return><return><categoryId>12</categoryId><name>Musical Instruments</name></return><return><categoryId>13</categ!
oryId><name>Sporting goods</name></return><return><categoryId>14</categoryId><name>Toys</name></return><return><categoryId>15</categoryId><name>Video Games</name></return><return><categoryId>1001</categoryId><name>Furniture</name><parent><categoryId>1</categoryId><name>Antiques</name></parent></return><return><categoryId>1002</categoryId><name>Silverware</name><parent><categoryId>1</categoryId><name>Antiques</name></parent></return><return><categoryId>2001</categoryId><name>Paintings</name><parent><categoryId>2</categoryId><name>Art</name></parent></return><return><categoryId>2002</categoryId><name>Prints</name><parent><categoryId>2</categoryId><name>Art</name></parent></return><return><categoryId>2003</categoryId><name>Sculptures</name><parent><categoryId>2</categoryId><name>Art</name></parent></return><return><categoryId>3001</categoryId><name>Fiction</name><parent><categoryId>3</categoryId><name>Books</name></parent></return><return><categoryId>3002</categoryId><name>Non!
Fiction</name><parent><categoryId>3</categoryId><name>Books</!
name></p
arent></return><return><categoryId>3003</categoryId><name>Comic Books</name><parent><categoryId>3</categoryId><name>Books</name></parent></return><return><categoryId>3004</categoryId><name>Children</name><parent><categoryId>3</categoryId><name>Books</name></parent></return><return><categoryId>4001</categoryId><name>Digital Cameras</name><parent><categoryId>4</categoryId><name>Cameras and Photography</name></parent></return><return><categoryId>4002</categoryId><name>Memory Cards</name><parent><categoryId>4</categoryId><name>Cameras and Photography</name></parent></return><return><categoryId>4003</categoryId><name>Film Cameras</name><parent><categoryId>4</categoryId><name>Cameras and Photography</name></parent></return><return><categoryId>4004</categoryId><name>Video Cameras</name><parent><categoryId>4</categoryId><name>Cameras and Photography</name></parent></return><return><categoryId>5001</categoryId><name>Cars</name><parent><categoryId>5</categoryId><name>Cars and Boats</n!
ame></parent></return><return><categoryId>5002</categoryId><name>Motorcycles</name><parent><categoryId>5</categoryId><name>Cars and Boats</name></parent></return><return><categoryId>5003</categoryId><name>Car Parts</name><parent><categoryId>5</categoryId><name>Cars and Boats</name></parent></return><return><categoryId>6001</categoryId><name>Mobile Phones</name><parent><categoryId>6</categoryId><name>Cell Phones</name></parent></return><return><categoryId>6002</categoryId><name>Mobile Accessories</name><parent><categoryId>6</categoryId><name>Cell Phones</name></parent></return><return><categoryId>6003</categoryId><name>Prepaid cards</name><parent><categoryId>6</categoryId><name>Cell Phones</name></parent></return><return><categoryId>7001</categoryId><name>Women</name><parent><categoryId>7</categoryId><name>Clothing and Shoes</name></parent></return><return><categoryId>7002</categoryId><name>Men</name><parent><categoryId>7</categoryId><name>Clothing and Shoes</name></parent><!
/return><return><categoryId>7003</categoryId><name>Girls</name!
><parent
><categoryId>7</categoryId><name>Clothing and Shoes</name></parent></return><return><categoryId>7004</categoryId><name>Boys</name><parent><categoryId>7</categoryId><name>Clothing and Shoes</name></parent></return><return><categoryId>7005</categoryId><name>Babies</name><parent><categoryId>7</categoryId><name>Clothing and Shoes</name></parent></return><return><categoryId>8001</categoryId><name>Notebooks</name><parent><categoryId>8</categoryId><name>Computers</name></parent></return><return><categoryId>8002</categoryId><name>Desktop PCs</name><parent><categoryId>8</categoryId><name>Computers</name></parent></return><return><categoryId>8003</categoryId><name>Servers</name><parent><categoryId>8</categoryId><name>Computers</name></parent></return><return><categoryId>8004</categoryId><name>Hardware</name><parent><categoryId>8</categoryId><name>Computers</name></parent></return><return><categoryId>8005</categoryId><name>Software</name><parent><categoryId>8</categoryId><name>Computer!
s</name></parent></return><return><categoryId>9001</categoryId><name>CDs</name><parent><categoryId>9</categoryId><name>Music</name></parent></return><return><categoryId>9002</categoryId><name>Records</name><parent><categoryId>9</categoryId><name>Music</name></parent></return><return><categoryId>10001</categoryId><name>Home Audio</name><parent><categoryId>10</categoryId><name>Electronics</name></parent></return><return><categoryId>10002</categoryId><name>MP3 Players</name><parent><categoryId>10</categoryId><name>Electronics</name></parent></return><return><categoryId>10003</categoryId><name>Television</name><parent><categoryId>10</categoryId><name>Electronics</name></parent></return><return><categoryId>10004</categoryId><name>Home theatre</name><parent><categoryId>10</categoryId><name>Electronics</name></parent></return><return><categoryId>11001</categoryId><name>Kitchen</name><parent><categoryId>11</categoryId><name>Home and Garden</name></parent></return><return><categoryI!
d>11002</categoryId><name>Real Estate</name><parent><categoryI!
d>11</ca
tegoryId><name>Home and Garden</name></parent></return><return><categoryId>11003</categoryId><name>Furniture</name><parent><categoryId>11</categoryId><name>Home and Garden</name></parent></return><return><categoryId>12001</categoryId><name>Guitars</name><parent><categoryId>12</categoryId><name>Musical Instruments</name></parent></return><return><categoryId>12002</categoryId><name>Pianos and Keyboards</name><parent><categoryId>12</categoryId><name>Musical Instruments</name></parent></return><return><categoryId>12003</categoryId><name>Percussion</name><parent><categoryId>12</categoryId><name>Musical Instruments</name></parent></return><return><categoryId>12004</categoryId><name>Orchestral</name><parent><categoryId>12</categoryId><name>Musical Instruments</name></parent></return><return><categoryId>13001</categoryId><name>Golf</name><parent><categoryId>13</categoryId><name>Sporting goods</name></parent></return><return><categoryId>13002</categoryId><name>Fishing</name><parent><!
categoryId>13</categoryId><name>Sporting goods</name></parent></return><return><categoryId>13003</categoryId><name>Tennis</name><parent><categoryId>13</categoryId><name>Sporting goods</name></parent></return><return><categoryId>14001</categoryId><name>Remote control</name><parent><categoryId>14</categoryId><name>Toys</name></parent></return><return><categoryId>14002</categoryId><name>Cars and trucks</name><parent><categoryId>14</categoryId><name>Toys</name></parent></return><return><categoryId>14003</categoryId><name>Dolls</name><parent><categoryId>14</categoryId><name>Toys</name></parent></return><return><categoryId>14004</categoryId><name>Educational</name><parent><categoryId>14</categoryId><name>Toys</name></parent></return><return><categoryId>15001</categoryId><name>PC</name><parent><categoryId>15</categoryId><name>Video Games</name></parent></return><return><categoryId>15002</categoryId><name>Nintendo Wii</name><parent><categoryId>15</categoryId><name>Video Games</name!
></parent></return><return><categoryId>15003</categoryId><name!
>Sony Pl
aystation 3</name><parent><categoryId>15</categoryId><name>Video Games</name></parent></return><return><categoryId>15004</categoryId><name>XBox 360</name><parent><categoryId>15</categoryId><name>Video Games</name></parent></return></ns2:listCategoriesResponse>";
+ protected static final String LOGIN_RIGHT_RESPONSE = "<return>true</return>";
+ protected static final String CREATE_NEW_AUCTION_RESPONSE_JBOSS_56 = "<ns2:createAuctionResponse xmlns:ns2=\"http://seambay.example.seam.jboss.org/\"";
+ protected static final String CREATE_NEW_AUCTION_RESPONSE_JBOSS_4 = "<createAuctionResponse xmlns=\"http://seambay.example.seam.jboss.org/\"";
+ protected static final String FIND_AUCTIONS_RESPONSE = "<description>You can buy an animal here</description>";
+ protected static final String UPDATE_AUCTION_RESPONSE_JBOSS_56 = "<ns2:updateAuctionDetailsResponse xmlns:ns2=\"http://seambay.example.seam.jboss.org/\"";
+ protected static final String UPDATE_AUCTION_RESPONSE_JBOSS_4 = "<updateAuctionDetailsResponse xmlns=\"http://seambay.example.seam.jboss.org";
+ protected static final String SET_DURATION_RESPONSE_JBOSS_56 = "<ns2:setAuctionDurationResponse xmlns:ns2=\"http://seambay.example.seam.jboss.org/\"";
+ protected static final String SET_DURATION_RESPONSE_JBOSS_4 = "<setAuctionDurationResponse xmlns=\"http://seambay.example.seam.jboss.org/";
+ protected static final String SET_STARTING_PRICE_RESPONSE_JBOSS_56 = "<ns2:setAuctionPriceResponse xmlns:ns2=\"http://seambay.example.seam.jboss.org/\"";
+ protected static final String SET_STARTING_PRICE_RESPONSE_JBOSS_4 = "<setAuctionPriceResponse xmlns=\"http://seambay.example.seam.jboss.org/";
+ protected static final String AUCTION_DETAILS_PRICE_RESPONSE = "<ns2:getNewAuctionDetailsResponse xmlns:ns2=\"http://seambay.example.seam.jboss.org/\"><return><account><accountId>-1</accountId><feedbackPercent>0.0</feedbackPercent><feedbackScore>0</feedbackScore><location>Sydney, NSW, Australia</location>";
+ protected static final String LOGOUT_RESPONSE = "<ns2:logoutResponse xmlns:ns2=\"http://seambay.example.seam.jboss.org/\"><return>true</return></ns2:logoutResponse>";
+ protected static final String CONFIRMATION_RESPONSE_JBOSS_56 = "<ns2:confirmAuctionResponse xmlns:ns2=\"http://seambay.example.seam.jboss.org/\"";
+ protected static final String CONFIRMATION_RESPONSE_JBOSS_4 = "<confirmAuctionResponse xmlns=\"http://seambay.example.seam.jboss.org/\"";
+
+ @Deployment(testable = false)
+ public static Archive<?> createDeployment() {
+ return DeploymentResolver.createDeployment();
+ }
+
+ @Before
+ public void beforeTest() throws MalformedURLException {
+ // it seems HTMLUnit doesn't play well with the JS
+ Assume.assumeTrue(isRealBrowser());
+ }
+
+ @Test
+ @InSequence(1)
+ public void testGoToWSPage() {
+ open(contextPath.toString());
+ clickAndWaitHttp(HERE_LINK);
+ assertTrue("URL contains web services page", browser.getCurrentUrl().contains(SERVICE_PAGE_URL));
+ }
+
+ @Test
+ @InSequence(2)
+ public void testLoginService() {
+ loginService();
+
+ // the same as Selenium, must use getValue to retrieve text inside
+ // <textarea></textarea>
+ waitCustom().withMessage("Response area should contain \"true\"").until(element(RESPONSE_AREA).attribute("value").contains(LOGIN_RIGHT_RESPONSE));
+ }
+
+ @Test
+ @InSequence(3)
+ public void listCategoriesTest() {
+ loginService();
+ clickAndWaitForPage(LIST_CATEGORIES_LINK_TEXT);
+ clickAndWaitAjax(INVOKE_SERVICE_BUTTON);
+ waitForCidUpdate();
+ waitCustom().withMessage("Response area should contain a list of categories.").until(element(RESPONSE_AREA).attribute("value").contains(LIST_CATEGORIES_RESPONSE));
+ }
+
+ @Test
+ @InSequence(4)
+ public void testCreateNewAuction() {
+ loginService();
+ createNewAuctionService();
+
+ waitCustom().withMessage("Response area should contain information about creating the auction.").until(new Predicate() {
+ public boolean apply(Object t) {
+ return element(RESPONSE_AREA).attribute("value").contains(CREATE_NEW_AUCTION_RESPONSE_JBOSS_56).apply(browser)
+ || element(RESPONSE_AREA).attribute("value").contains(CREATE_NEW_AUCTION_RESPONSE_JBOSS_4).apply(browser);
+ }
+ });
+ }
+
+ @Test
+ @InSequence(5)
+ public void findAuctionsTest() {
+ String searchTerm = "Animals";
+
+ loginService();
+ createNewAuctionService();
+ confirmAuctionService();
+ clickAndWaitForPage(FIND_AUCTIONS_LINK_TEXT);
+ type(SEARCH_TERM, searchTerm);
+ clickAndWaitAjax(INVOKE_SERVICE_BUTTON);
+ waitForCidUpdate();
+ waitCustom().withMessage("Response area should contain information about finding auction.").until(element(RESPONSE_AREA).attribute("value").contains(FIND_AUCTIONS_RESPONSE));
+ }
+
+ @Test
+ @InSequence(6)
+ public void updateAuctionTest() {
+ String title = "Animals";
+ String description = "Another description";
+ String categoryId = "5";
+ loginService();
+ createNewAuctionService();
+
+ clickAndWaitForPage(UPDATE_AUCTION_DETAILS_LINK_TEXT);
+ type(AUCTION_TITLE, title);
+ type(AUCTION_DESCRIPTION, description);
+ type(AUCTION_CATEGORY_ID, categoryId);
+ clickAndWaitAjax(INVOKE_SERVICE_BUTTON);
+ waitForCidUpdate();
+ waitCustom().withMessage("Response area should contain information about updating the auction.").until(new Predicate() {
+ public boolean apply(Object t) {
+ return element(RESPONSE_AREA).attribute("value").contains(UPDATE_AUCTION_RESPONSE_JBOSS_56).apply(browser)
+ || element(RESPONSE_AREA).attribute("value").contains(UPDATE_AUCTION_RESPONSE_JBOSS_4).apply(browser);
+ }
+ });
+ }
+
+ @Test
+ @InSequence(7)
+ public void setAuctionDurationTest() {
+ String duration = "20";
+ loginService();
+ createNewAuctionService();
+
+ clickAndWaitForPage(SET_AUCTION_DURATION_LINK_TEXT);
+ type(AUCTION_DURATION, duration);
+ clickAndWaitAjax(INVOKE_SERVICE_BUTTON);
+ waitForCidUpdate();
+ waitCustom().withMessage("Response area should contain information about setting duration.").until(new Predicate() {
+ public boolean apply(Object t) {
+ return element(RESPONSE_AREA).attribute("value").contains(SET_DURATION_RESPONSE_JBOSS_56).apply(browser)
+ || element(RESPONSE_AREA).attribute("value").contains(SET_DURATION_RESPONSE_JBOSS_4).apply(browser);
+ }
+ });
+
+ }
+
+ @Test
+ @InSequence(8)
+ public void setStartingPriceTest() {
+ String price = "1000";
+ loginService();
+ createNewAuctionService();
+
+ clickAndWaitForPage(SET_STARTING_PRICE_LINK_TEXT);
+ type(STARTING_PRICE, price);
+ clickAndWaitAjax(INVOKE_SERVICE_BUTTON);
+ waitForCidUpdate();
+ waitCustom().withMessage("Response area should contain information about setting starting price.").until(new Predicate() {
+ public boolean apply(Object t) {
+ return element(RESPONSE_AREA).attribute("value").contains(SET_STARTING_PRICE_RESPONSE_JBOSS_56).apply(browser)
+ || element(RESPONSE_AREA).attribute("value").contains(SET_STARTING_PRICE_RESPONSE_JBOSS_4).apply(browser);
+ }
+ });
+ }
+
+ @Test
+ @InSequence(9)
+ public void getAuctionDetailsTest() {
+ loginService();
+ createNewAuctionService();
+
+ clickAndWaitForPage(GET_AUCTION_DETAILS_LINK_TEXT);
+ clickAndWaitAjax(INVOKE_SERVICE_BUTTON);
+ waitUntilValueNotEmpty(RESPONSE_AREA);
+ waitForCidUpdate();
+ waitCustom().withMessage("Response area should contain auction details.").until(element(RESPONSE_AREA).attribute("value").contains(AUCTION_DETAILS_PRICE_RESPONSE));
+ }
+
+ @Test
+ @InSequence(10)
+ public void logOutTest() {
+ loginService();
+ clickAndWaitForPage(LOGOUT_LINK_TEXT);
+ clickAndWaitAjax(INVOKE_SERVICE_BUTTON);
+
+ waitCustom().withMessage("Response area should contain logout confirmation.").until(element(RESPONSE_AREA).attribute("value").contains(LOGOUT_RESPONSE));
+ }
+
+ @Test
+ @InSequence(11)
+ public void confirmAuctionTest() {
+ loginService();
+ createNewAuctionService();
+ confirmAuctionService();
+ waitCustom().withMessage("Response area should contain information about confirmation.").until(new Predicate() {
+ public boolean apply(Object t) {
+ return element(RESPONSE_AREA).attribute("value").contains(CONFIRMATION_RESPONSE_JBOSS_56).apply(browser)
+ || element(RESPONSE_AREA).attribute("value").contains(CONFIRMATION_RESPONSE_JBOSS_4).apply(browser);
+ }
+ });
+ }
+
+ /**
+ * Goes to web services page and logs user in
+ */
+ protected void loginService() {
+ String username = "demo";
+ String password = "demo";
+
+ open(contextPath.toString() + getProperty("HOME_PAGE"));
+ waitCustom().until(element(HERE_LINK).isPresent());
+ clickAndWaitHttp(HERE_LINK);
+
+ clickAndWaitForPage(LOGIN_LINK_TEXT);
+
+ type(LOGIN_INPUT_USERNAME, username);
+ type(LOGIN_INPUT_PASSWORD, password);
+
+ clickAndWaitAjax(INVOKE_SERVICE_BUTTON);
+ waitForCidUpdate();
+ waitCustom().until(element(RESPONSE_AREA).attribute("value").contains(LOGIN_RIGHT_RESPONSE));
+ }
+
+ protected void confirmAuctionService() {
+ clickAndWaitForPage(CONFIRM_AUCTION_LINK_TEXT);
+ clickAndWaitAjax(INVOKE_SERVICE_BUTTON);
+ waitForCidUpdate();
+ }
+
+ protected void createNewAuctionService() {
+ String title = "Animals";
+ String description = "You can buy an animal here";
+ String categoryId = "6";
+ clickAndWaitForPage(CREATE_NEW_AUCTION_LINK_TEXT);
+ type(AUCTION_TITLE, title);
+ type(AUCTION_DESCRIPTION, description);
+ type(AUCTION_CATEGORY_ID, categoryId);
+ clickAndWaitAjax(INVOKE_SERVICE_BUTTON);
+ waitForCidUpdate();
+ }
+
+ protected void clickAndWaitForPage(String linkText) {
+ waitCustom().until(element(By.partialLinkText(linkText)).isPresent());
+ click(By.partialLinkText(linkText));
+ waitCustom().until(element(SELECTED_SERVICE).text().contains(linkText));
+ }
+
+ protected void waitForCidUpdate() {
+ waitUntilValueNotEmpty(RESPONSE_AREA);
+ waitUntilValueNotEmpty(By.id("conversationId"));
+ try {
+ Thread.sleep(JS_TIMEOUT);
+ } catch (InterruptedException ex) {
+ }
+ }
+
+ public WebDriverWait waitCustom() {
+ return new WebDriverWait<Void>(null, browser, WAIT_TIMEOUT);
+ }
+
+ protected void waitUntilValueNotEmpty(final By by) {
+ waitCustom().until(new Predicate() {
+ public boolean apply(Object t) {
+ return !browser.findElement(by).getAttribute("value").isEmpty();
+ }
+ });
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/resources/ftest.properties
===================================================================
--- branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/resources/ftest.properties (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seambay/seambay-ftest/src/test/resources/ftest.properties 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,70 @@
+HOME_PAGE home.seam
+DEBUG_PAGE debug.seam
+REGISTRATION_PAGE register.seam
+LOGIN id=login
+LOGOUT id=logout
+REGISTRATION id=register
+SELL id=sell
+LOGIN_URL login.seam
+LOGIN_USERNAME id=login:username
+LOGIN_PASSWORD id=login:password
+LOGIN_SUBMIT id=login:submit
+REGISTRATION_USERNAME id=registration:username
+REGISTRATION_PASSWORD id=registration:password
+REGISTRATION_VERIFY id=registration:confirm
+REGISTRATION_LOCATION id=registration:location
+REGISTRATION_SUBMIT id=registration:submit
+REGISTRATION_CONFIRM_MESSAGE id=registration:confirmMessage
+SELL_LINK id=sell
+REGISTRATION_URL register.seam
+ITEMDETAIL_URL itemdetail
+AUCTION_URL auction.seam
+SELL_1_URL sell.seam
+SELL_2_URL sell2.seam
+SELL_3_URL sell3.seam
+SELL_4_URL sell4.seam
+SELL_5_URL sell5.seam
+SELL_PREVIEW_URL preview.seam
+SELL_PREVIEW_PRICE id=price
+SELL_PREVIEW_DESCRIPTION id=description
+SELL_TITLE id=sellForm:title
+SELL_DURATION id=sellForm:duration
+SELL_PRICE id=sellForm:price
+SELL_DESCRIPTION id=sellForm:description
+SELL_NEXT id=sellForm:next
+SELL_CONFIRM id=sellForm:confirm
+SELL_CATEGORY_SELECT id=rootCategory
+# availability of second option indicates that category list has been loaded (2)
+SELL_CATEGORY_SELECT_SECOND_OPTION xpath=id("rootCategory")/option[14]
+SELL_SUBCATEGORY_SELECT id=tier2
+
+SEARCH_FIELD id=search:searchTerm
+SEARCH_SUBMIT id=search:submit
+SEARCH_RESULTS_COUNT xpath=//table[@id='auctions']/tbody/tr
+SEARCH_RESULTS_FIRST_ROW_LINK xpath=//table[@id='auctions']/tbody/tr[1]/td[2]/a
+
+ITEM_NEW_BID_FIELD id=newBid:bidAmount
+ITEM_NEW_BID_SUBMIT id=newBid:placeBidWithAmount
+ITEM_NEW_BID_LINK id=bid:placeBid
+ITEM_BID_HISTORY id=bidHistory
+BID_INCREASE_FIELD id=increaseBid:bidAmount
+BID_INCREASE_SUBMIT id=increaseBid:bidAgain
+
+BID_CONFIRM id=confirm:confirmBid
+BID_HISTORY_COUNT xpath=//table[@id='history']/tbody/tr
+BID_HISTORY_COUNT_EMPTY xpath=//table[@id='history']/tbody/tr/td[not(text())]
+BID_OUTBID id=outbid
+BID_HIGH_BIDDER id=highBidder
+BID_HISTORY_BACK id=back
+LIST_CATEGORIES_RESPONSE <ns2\:listCategoriesResponse xmlns\:ns2\="http\://seambay.example.seam.jboss.org/"><return><categoryId>1</categoryId><name>Antiques</name></return><return><categoryId>2</categoryId><name>Art</name></return><return><categoryId>3</categoryId><name>Books</name></return><return><categoryId>4</categoryId><name>Cameras and Photography</name></return><return><categoryId>5</categoryId><name>Cars and Boats</name></return><return><categoryId>6</categoryId><name>Cell Phones</name></return><return><categoryId>7</categoryId><name>Clothing and Shoes</name></return><return><categoryId>8</categoryId><name>Computers</name></return><return><categoryId>9</categoryId><name>Music</name></return><return><categoryId>10</categoryId><name>Electronics</name></return><return><categoryId>11</categoryId><name>Home and Garden</name></return><return><categoryId>12</categoryId><name>Musical Instruments</name></return><return><categoryId>13</categoryId><name>Sporting goods</name></!
return><return><categoryId>14</categoryId><name>Toys</name></return><return><categoryId>15</categoryId><name>Video Games</name></return><return><categoryId>1001</categoryId><name>Furniture</name><parent><categoryId>1</categoryId><name>Antiques</name></parent></return><return><categoryId>1002</categoryId><name>Silverware</name><parent><categoryId>1</categoryId><name>Antiques</name></parent></return><return><categoryId>2001</categoryId><name>Paintings</name><parent><categoryId>2</categoryId><name>Art</name></parent></return><return><categoryId>2002</categoryId><name>Prints</name><parent><categoryId>2</categoryId><name>Art</name></parent></return><return><categoryId>2003</categoryId><name>Sculptures</name><parent><categoryId>2</categoryId><name>Art</name></parent></return><return><categoryId>3001</categoryId><name>Fiction</name><parent><categoryId>3</categoryId><name>Books</name></parent></return><return><categoryId>3002</categoryId><name>Non Fiction</name><parent><categoryId>!
3</categoryId><name>Books</name></parent></return><return><cat!
egoryId>
3003</categoryId><name>Comic Books</name><parent><categoryId>3</categoryId><name>Books</name></parent></return><return><categoryId>3004</categoryId><name>Children</name><parent><categoryId>3</categoryId><name>Books</name></parent></return><return><categoryId>4001</categoryId><name>Digital Cameras</name><parent><categoryId>4</categoryId><name>Cameras and Photography</name></parent></return><return><categoryId>4002</categoryId><name>Memory Cards</name><parent><categoryId>4</categoryId><name>Cameras and Photography</name></parent></return><return><categoryId>4003</categoryId><name>Film Cameras</name><parent><categoryId>4</categoryId><name>Cameras and Photography</name></parent></return><return><categoryId>4004</categoryId><name>Video Cameras</name><parent><categoryId>4</categoryId><name>Cameras and Photography</name></parent></return><return><categoryId>5001</categoryId><name>Cars</name><parent><categoryId>5</categoryId><name>Cars and Boats</name></parent></return><return><cate!
goryId>5002</categoryId><name>Motorcycles</name><parent><categoryId>5</categoryId><name>Cars and Boats</name></parent></return><return><categoryId>5003</categoryId><name>Car Parts</name><parent><categoryId>5</categoryId><name>Cars and Boats</name></parent></return><return><categoryId>6001</categoryId><name>Mobile Phones</name><parent><categoryId>6</categoryId><name>Cell Phones</name></parent></return><return><categoryId>6002</categoryId><name>Mobile Accessories</name><parent><categoryId>6</categoryId><name>Cell Phones</name></parent></return><return><categoryId>6003</categoryId><name>Prepaid cards</name><parent><categoryId>6</categoryId><name>Cell Phones</name></parent></return><return><categoryId>7001</categoryId><name>Women</name><parent><categoryId>7</categoryId><name>Clothing and Shoes</name></parent></return><return><categoryId>7002</categoryId><name>Men</name><parent><categoryId>7</categoryId><name>Clothing and Shoes</name></parent></return><return><categoryId>7003</c!
ategoryId><name>Girls</name><parent><categoryId>7</categoryId>!
<name>Cl
othing and Shoes</name></parent></return><return><categoryId>7004</categoryId><name>Boys</name><parent><categoryId>7</categoryId><name>Clothing and Shoes</name></parent></return><return><categoryId>7005</categoryId><name>Babies</name><parent><categoryId>7</categoryId><name>Clothing and Shoes</name></parent></return><return><categoryId>8001</categoryId><name>Notebooks</name><parent><categoryId>8</categoryId><name>Computers</name></parent></return><return><categoryId>8002</categoryId><name>Desktop PCs</name><parent><categoryId>8</categoryId><name>Computers</name></parent></return><return><categoryId>8003</categoryId><name>Servers</name><parent><categoryId>8</categoryId><name>Computers</name></parent></return><return><categoryId>8004</categoryId><name>Hardware</name><parent><categoryId>8</categoryId><name>Computers</name></parent></return><return><categoryId>8005</categoryId><name>Software</name><parent><categoryId>8</categoryId><name>Computers</name></parent></return><return><!
categoryId>9001</categoryId><name>CDs</name><parent><categoryId>9</categoryId><name>Music</name></parent></return><return><categoryId>9002</categoryId><name>Records</name><parent><categoryId>9</categoryId><name>Music</name></parent></return><return><categoryId>10001</categoryId><name>Home Audio</name><parent><categoryId>10</categoryId><name>Electronics</name></parent></return><return><categoryId>10002</categoryId><name>MP3 Players</name><parent><categoryId>10</categoryId><name>Electronics</name></parent></return><return><categoryId>10003</categoryId><name>Television</name><parent><categoryId>10</categoryId><name>Electronics</name></parent></return><return><categoryId>10004</categoryId><name>Home theatre</name><parent><categoryId>10</categoryId><name>Electronics</name></parent></return><return><categoryId>11001</categoryId><name>Kitchen</name><parent><categoryId>11</categoryId><name>Home and Garden</name></parent></return><return><categoryId>11002</categoryId><name>Real Esta!
te</name><parent><categoryId>11</categoryId><name>Home and Gar!
den</nam
e></parent></return><return><categoryId>11003</categoryId><name>Furniture</name><parent><categoryId>11</categoryId><name>Home and Garden</name></parent></return><return><categoryId>12001</categoryId><name>Guitars</name><parent><categoryId>12</categoryId><name>Musical Instruments</name></parent></return><return><categoryId>12002</categoryId><name>Pianos and Keyboards</name><parent><categoryId>12</categoryId><name>Musical Instruments</name></parent></return><return><categoryId>12003</categoryId><name>Percussion</name><parent><categoryId>12</categoryId><name>Musical Instruments</name></parent></return><return><categoryId>12004</categoryId><name>Orchestral</name><parent><categoryId>12</categoryId><name>Musical Instruments</name></parent></return><return><categoryId>13001</categoryId><name>Golf</name><parent><categoryId>13</categoryId><name>Sporting goods</name></parent></return><return><categoryId>13002</categoryId><name>Fishing</name><parent><categoryId>13</categoryId><name>Spo!
rting goods</name></parent></return><return><categoryId>13003</categoryId><name>Tennis</name><parent><categoryId>13</categoryId><name>Sporting goods</name></parent></return><return><categoryId>14001</categoryId><name>Remote control</name><parent><categoryId>14</categoryId><name>Toys</name></parent></return><return><categoryId>14002</categoryId><name>Cars and trucks</name><parent><categoryId>14</categoryId><name>Toys</name></parent></return><return><categoryId>14003</categoryId><name>Dolls</name><parent><categoryId>14</categoryId><name>Toys</name></parent></return><return><categoryId>14004</categoryId><name>Educational</name><parent><categoryId>14</categoryId><name>Toys</name></parent></return><return><categoryId>15001</categoryId><name>PC</name><parent><categoryId>15</categoryId><name>Video Games</name></parent></return><return><categoryId>15002</categoryId><name>Nintendo Wii</name><parent><categoryId>15</categoryId><name>Video Games</name></parent></return><return><categor!
yId>15003</categoryId><name>Sony Playstation 3</name><parent><!
category
Id>15</categoryId><name>Video Games</name></parent></return><return><categoryId>15004</categoryId><name>XBox 360</name><parent><categoryId>15</categoryId><name>Video Games</name></parent></return></ns2\:listCategoriesResponse>
+LOGIN_RIGHT_RESPONSE <return>true</return>
+CREATE_NEW_AUCTION_RESPONSE_JBOSS_56 <ns2\:createAuctionResponse xmlns\:ns2\="http\://seambay.example.seam.jboss.org/"/>
+CREATE_NEW_AUCTION_RESPONSE_JBOSS_4 <createAuctionResponse xmlns="http\://seambay.example.seam.jboss.org/"/>
+
+FIND_AUCTIONS_RESPONSE <description>You can buy an animal here</description>
+UPDATE_AUCTION_RESPONSE <ns2\:updateAuctionDetailsResponse xmlns\:ns2\="http\://seambay.example.seam.jboss.org/"/>
+SET_DURATION_RESPONSE <ns2\:setAuctionDurationResponse xmlns\:ns2\="http\://seambay.example.seam.jboss.org/"/>
+SET_STARTING_PRICE_RESPONSE <ns2\:setAuctionPriceResponse xmlns\:ns2\="http\://seambay.example.seam.jboss.org/"/>
+AUCTION_DETAILS_PRICE_RESPONSE <ns2\:getNewAuctionDetailsResponse xmlns\:ns2\="http\://seambay.example.seam.jboss.org/"><return><account><accountId>1</accountId><feedbackPercent>0.0</feedbackPercent><feedbackScore>0</feedbackScore><location>Sydney, NSW, Australia</location>
+LOGOUT_RESPONSE <ns2\:logoutResponse xmlns\:ns2\="http\://seambay.example.seam.jboss.org/"><return>true</return></ns2\:logoutResponse>
+CONFIRMATION_RESPONSE <env\:Body><ns2\:confirmAuctionResponse xmlns\:ns2\="http\://seambay.example.seam.jboss.org/"/></env\:Body>
Modified: branches/enterprise/WFK-2_1/examples/seamdiscs/README.html
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamdiscs/README.html 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/seamdiscs/README.html 2013-09-13 14:11:17 UTC (rev 15588)
@@ -1,17 +1,17 @@
<h1>Seam SeamDiscs Example</h1>
-<p>The seamdiscs example is a simple example built using the Seam Application
-Framework which allows you to record your favourite albums and artists. It
-uses a mix of RichFaces and Trinidad components. It also uses the “inplace
-editing” pattern; the same facelets are used for editing and display of data
+<p>The seamdiscs example is a simple example built using the Seam Application
+Framework which allows you to record your favourite albums and artists. It
+uses a mix of RichFaces and Trinidad components. It also uses the "inplace
+editing" pattern; the same facelets are used for editing and display of data
(login to edit a disc or artist).</p>
-<p>The Seam-Trinidad integration (for now built into the example) provides a
-<code>DataModel</code> which, when backed by a Seam Application Framework Query, provides
-lazy loading of data for paging, sorting in the Persistence Context and strong
-row keys. If you want to use, you’ll need to copy the classes in
-<code>org.jboss.seam.trinidad</code> to your own project. This may be offered as a
-standalone jar in the Seam project in the future. One caveat is that you must
+<p>The Seam-Trinidad integration (for now built into the example) provides a
+<code>DataModel</code> which, when backed by a Seam Application Framework Query, provides
+lazy loading of data for paging, sorting in the Persistence Context and strong
+row keys. If you want to use, you'll need to copy the classes in
+<code>org.jboss.seam.trinidad</code> to your own project. This may be offered as a
+standalone jar in the Seam project in the future. One caveat is that you must
ensure the rows property on the <code><tr:table></code> is the same as the <code>maxResults</code>
property on the Query.</p>
@@ -31,27 +31,25 @@
<ol>
<li><p>In the example root directory run:</p>
-<pre><code> mvn clean install
+<pre><code>mvn clean install
</code></pre></li>
<li><p>Set JBOSS_HOME environment property.</p></li>
<li><p>In the seamdiscs-ear directory run:</p>
-<pre><code> mvn jboss-as:deploy
+<pre><code>mvn jboss-as:deploy
</code></pre></li>
<li><p>Open this URL in a web browser: http://localhost:8080/seam-seamdiscs</p></li>
</ol>
-
<h2>Testing the example</h2>
-<p>This example is covered by integration tests. All tests use the following technologies:</p>
+<p>This example is covered by integration and functional tests. All tests use the following technologies:</p>
<ul>
<li><strong>Arquillian</strong> - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,</li>
<li><strong>ShrinkWrap</strong> - to create the test archive (WAR).</li>
</ul>
-
<h3>Integration tests</h3>
<p>Integration tests cover core application logic and reside in the EJB module. In addition to Arquillian and ShrinkWrap, the integration tests also use:</p>
@@ -61,9 +59,8 @@
<li><strong>ShrinkWrap Resolver</strong> - to resolve dependencies of the project for packaging in the test archive.</li>
</ul>
+<p>The tests are executed in Maven's test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-<p>The tests are executed in Maven’s test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-
<pre><code>mvn clean test -Darquillian=jbossas-managed-7
</code></pre>
@@ -74,6 +71,41 @@
<pre><code>mvn clean test -Darquillian=jbossas-remote-7
</code></pre>
+<h3>Functional tests</h3>
+
+<p>Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:</p>
+
+<ul>
+<li><strong>Arquillian Graphene Extension</strong> - an advanced Ajax-capable type-safe Selenium-based browser testing tool,</li>
+<li><strong>Arquillian Drone Extension</strong> - to automatically run and stop browser instances.</li>
+</ul>
+
+<p><em>Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server.</em></p>
+
+<p>Run the functional test on JBoss AS instance with</p>
+
+<pre><code>mvn -f seamdiscs-ftest/pom.xml clean test
+</code></pre>
+
+<p>The <code>JBOSS_HOME</code> environment variable must be set and point to a JBoss AS instance directory.</p>
+
+<p>Several variables can be configured:</p>
+
+<ul>
+<li><p>path to an alternative archive for testing</p>
+
+<pre><code>-DtestDeployment=/path/to/archive.ear
+</code></pre></li>
+<li><p>the browser to use for testing</p>
+
+<pre><code>-DbrowserCapabilities=htmlUnit
+</code></pre></li>
+<li><p>test on a running server</p>
+
+<pre><code>-Dremote
+</code></pre></li>
+</ul>
+
<h2>Testing in JBDS</h2>
<h3>Integration tests</h3>
@@ -82,11 +114,20 @@
<li>Open JBDS and start a configured instance of JBoss AS</li>
<li>Import the example project and its submodules</li>
<li>In the <em>Project Explorer</em>, select the EJB module project, then
-
<ol>
<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and check <code>integration-tests</code> and <code>arq-jbossas-7-remote</code></li>
<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-</li>
+
+<h3>Functional tests</h3>
+
+<ol>
+<li>Open JBDS and start a configured instance of JBoss AS</li>
+<li>Import the <code>ftest</code> project of the example</li>
+<li>In the <em>Project Explorer</em>, select the ftest project, then
+<ol>
+<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and activate <code>arq-jbossas-7-remote</code> profile and deactivate <code>arq-jbossas-7-managed</code> profile</li>
+<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-
Modified: branches/enterprise/WFK-2_1/examples/seamdiscs/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamdiscs/README.md 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/seamdiscs/README.md 2013-09-13 14:11:17 UTC (rev 15588)
@@ -46,7 +46,7 @@
Testing the example
-------------------
-This example is covered by integration tests. All tests use the following technologies:
+This example is covered by integration and functional tests. All tests use the following technologies:
* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
* __ShrinkWrap__ - to create the test archive (WAR).
@@ -69,7 +69,35 @@
mvn clean test -Darquillian=jbossas-remote-7
+### Functional tests
+Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:
+
+* __Arquillian Graphene Extension__ - an advanced Ajax-capable type-safe Selenium-based browser testing tool,
+* __Arquillian Drone Extension__ - to automatically run and stop browser instances.
+
+_Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server._
+
+Run the functional test on JBoss AS instance with
+
+ mvn -f seamdiscs-ftest/pom.xml clean test
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+Several variables can be configured:
+
+* path to an alternative archive for testing
+
+ -DtestDeployment=/path/to/archive.ear
+
+* the browser to use for testing
+
+ -DbrowserCapabilities=htmlUnit
+
+* test on a running server
+
+ -Dremote
+
Testing in JBDS
---------------
### Integration tests
@@ -79,3 +107,11 @@
3. In the _Project Explorer_, select the EJB module project, then
1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and check `integration-tests` and `arq-jbossas-7-remote`
2. Right-click the module and select _Run As_ - _JUnit Test_
+
+### Functional tests
+
+1. Open JBDS and start a configured instance of JBoss AS
+2. Import the `ftest` project of the example
+3. In the _Project Explorer_, select the ftest project, then
+ 1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and activate `arq-jbossas-7-remote` profile and deactivate `arq-jbossas-7-managed` profile
+ 2. Right-click the module and select _Run As_ - _JUnit Test_
Added: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ftest/pom.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ftest/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ftest/src/test/java/org/jboss/seam/example/seamdiscs/test/graphene/SeamDiscsFunctionalTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ftest/src/test/java/org/jboss/seam/example/seamdiscs/test/graphene/SeamDiscsFunctionalTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ftest/src/test/java/org/jboss/seam/example/seamdiscs/test/graphene/SeamDiscsFunctionalTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,267 @@
+/*
+ * 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.example.seamdiscs.test.graphene;
+
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.junit.InSequence;
+import static org.junit.Assert.*;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * This class tests artists management in SeamDiscs application
+ *
+ * @author Ondrej Skutka
+ *
+ */
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class SeamDiscsFunctionalTest extends SeamDiscsFunctionalTestBase {
+
+ // TRINIDAD-2223 - A problem in Trinidad's ADF RequestQueue.js causes trouble in HTMLUnit and PhantomJS:
+ // TypeError: Cannot call method "toLowerCase" of undefined (http://127.0.0.1:8080/seam-seamdiscs/adf/jsLibs/Common2_0_0_beta_2.js#6909)
+ // form.enctype is the 'undefined' for some reason
+ @Before
+ public void assumeRealBrowser() {
+ Assume.assumeTrue(isRealBrowser());
+ }
+
+ @Test
+ @InSequence(1)
+ public void createWithDiscsTest() {
+ clickAndWaitHttp(MANAGE_ARTISTS);
+ clickAndWaitHttp(CREATE_ARTIST_BUTTON);
+ type(ARTIST_NAME, "Lou Reed");
+ type(ARTIST_DESCRIPTION, "First came to prominence as the guitarist and principal singer-songwriter of The Velvet Underground. Than began a long and eclectic solo career.");
+ createDisc("Metal Machine Music", "1975");
+ createDisc("Sally Can't Dance", "1974");
+ createDisc("Rock and Roll Heart", "1977");
+ clickAndWaitHttp(ARTIST_PERSIST);
+ assertTrue("Cannot create artist with discs", isTextInSource("Successfully created"));
+
+ findAndClickArtist("Lou Reed");
+
+ // check whether it is the Lou Reed
+ assertEquals("This artist is not Lou Reed!", "Lou Reed", getValue(ARTIST_NAME));
+
+ // check discs (they should be sorted by release date)
+ checkDisc(1, "Sally Can't Dance", "1974", EMPTY_DISC_DESCRIPTION);
+ checkDisc(2, "Metal Machine Music", "1975", EMPTY_DISC_DESCRIPTION);
+ checkDisc(3, "Rock and Roll Heart", "1977", EMPTY_DISC_DESCRIPTION);
+ }
+
+ @Test
+ @InSequence(2)
+ public void paginationTest() {
+ clickAndWaitHttp(MANAGE_ARTISTS);
+ findAndClickArtist("Fairport Convention"); // should be on second page
+ checkDisc(1, "Liege and Lief", "", "The first folk-rock album ever made in the UK, this was the only studio recording of the classic line up of Sandy Denny, Richard Thompson, Dave Swarbick, Ashley Hutchings and Simon Nicol");
+ }
+// TODO check creating empty disc
+
+ @Test
+ @InSequence(3)
+ public void editDiscsTest() {
+ clickAndWaitHttp(MANAGE_ARTISTS);
+ // correct Rock and Roll Heart releas date
+ findAndClickArtist("Lou Reed");
+ type(getBy(ARTIST_NTH_DISC_YEAR, "last()"), "1976");
+
+ clickAndWaitHttp(ARTIST_UPDATE);
+ findAndClickArtist("Lou Reed");
+
+ checkDisc(1, "Sally Can't Dance", "1974", EMPTY_DISC_DESCRIPTION);
+ checkDisc(2, "Metal Machine Music", "1975", EMPTY_DISC_DESCRIPTION);
+ checkDisc(3, "Rock and Roll Heart", "1976", EMPTY_DISC_DESCRIPTION); // this was altered
+ }
+
+ @Test
+ @InSequence(4)
+ public void addBandTest() {
+ clickAndWaitHttp(MANAGE_ARTISTS);
+ clickAndWaitHttp(CREATE_BAND_BUTTON);
+ type(ARTIST_NAME, "The Velvet Underground");
+ type(ARTIST_DESCRIPTION, "An underground band.");
+ createDisc("White Light/White Heat", "1968");
+ createDisc("The Velvet Underground and Nico", "1967");
+
+ addBandMember("Lou Reed");
+ addBandMember("Sterling Morrison");
+ addBandMember("John Cale");
+ addBandMember("Maureen Tucker");
+ addBandMember("Nico");
+
+ clickAndWaitHttp(ARTIST_PERSIST);
+ assertTrue("Cannot create artist with discs", isTextInSource("Successfully created"));
+
+ findAndClickArtist("The Velvet Underground");
+
+ // check whether it is the Lou Reed
+ assertEquals("This artist is not the Velvet Underground!", "The Velvet Underground", getValue(ARTIST_NAME));
+
+ // check discs (they should be sorted by release date)
+ checkDisc(1, "The Velvet Underground and Nico", "1967", EMPTY_DISC_DESCRIPTION);
+ checkDisc(2, "White Light/White Heat", "1968", EMPTY_DISC_DESCRIPTION);
+
+ checkBandMember(1, "Lou Reed");
+ checkBandMember(2, "Sterling Morrison");
+ checkBandMember(3, "John Cale");
+ checkBandMember(4, "Maureen Tucker");
+ checkBandMember(5, "Nico");
+ }
+
+ @Test
+ @InSequence(5)
+ public void filterTest() {
+ clickAndWaitHttp(MANAGE_ARTISTS);
+ type(ARTIST_FILTER, "Fairport");
+ sleep(3000);
+ clickAndWaitHttp(ARTISTS_FIRST_ARTIST_LINK);
+ checkDisc(1, "Liege and Lief", "", "The first folk-rock album ever made in the UK, this was the only studio recording of the classic line up of Sandy Denny, Richard Thompson, Dave Swarbick, Ashley Hutchings and Simon Nicol");
+ }
+
+ @Test
+ @Ignore("bz975128")
+ @InSequence(6)
+ public void editDiscTest() {
+ clickAndWaitHttp(MANAGE_DISCS);
+ // correct Rock and Roll Heart description
+ findAndClickDisc("Rock and Roll Heart"); // should not be on the first page
+ checkDiscDetail("Rock and Roll Heart", "1976", "", "Lou Reed");
+
+ type(DISC_DETAIL_DESCRIPTION, "A sensitive and revealing look into the prince of darkness.");
+
+ clickAndWaitHttp(DISC_DETAIL_UPDATE);
+
+ findAndClickDisc("Rock and Roll Heart");
+ checkDiscDetail("Rock and Roll Heart", "1976", "A sensitive and revealing look into the prince of darkness.", "Lou Reed");
+
+ // check whether it's ok from the artists' perspective
+ clickAndWaitHttp(MANAGE_ARTISTS);
+
+ findAndClickArtist("Lou Reed");
+
+ // check whether it is the Lou Reed
+ assertEquals("This artist is not Lou Reed!", "Lou Reed", getValue(ARTIST_NAME));
+
+ // check discs (they should be sorted by release date)
+ checkDisc(1, "Sally Can't Dance", "1974", EMPTY_DISC_DESCRIPTION);
+ checkDisc(2, "Metal Machine Music", "1975", EMPTY_DISC_DESCRIPTION);
+ checkDisc(3, "Rock and Roll Heart", "1976", "A sensitive and revealing look into the prince of darkness.");
+ }
+
+ @Test
+ @Ignore("bz975128")
+ @InSequence(7)
+ public void discPaginationTest() {
+ findAndClickDisc("Rock and Roll Heart"); // should not be on the first page
+ checkDiscDetail("Rock and Roll Heart", "1976", "A sensitive and revealing look into the prince of darkness.", "Lou Reed");
+ }
+
+ @Test
+ @Ignore("bz975128")
+ @InSequence(8)
+ public void addDiscTest() {
+ clickAndWaitHttp(MANAGE_DISCS);
+ clickAndWaitHttp(CREATE_DISC_BUTTON);
+ type(DISC_DETAIL_TITLE, "Berlin");
+ selectByValue(DISC_DETAIL_ARTIST, "Lou Reed");
+ type(DISC_DETAIL_RELEASE_DATE, "1973");
+ type(DISC_DETAIL_DESCRIPTION, "A tragic rock opera about a doomed couple that addresses themes of drug use and depression.");
+ clickAndWaitHttp(DISC_DETAIL_PERSIST);
+ assertTrue("Cannot create disc", isTextInSource("Successfully created"));
+
+ // check whether it's ok from the artists' perspective
+ clickAndWaitHttp(MANAGE_ARTISTS);
+
+ findAndClickArtist("Lou Reed");
+
+ // check whether it is the Lou Reed
+ assertEquals("This artist is not Lou Reed!", "Lou Reed", getValue(ARTIST_NAME));
+
+ // check discs (they should be sorted by release date)
+ checkDisc(1, "Berlin", "1973", "A tragic rock opera about a doomed couple that addresses themes of drug use and depression.");
+ checkDisc(2, "Sally Can't Dance", "1974", EMPTY_DISC_DESCRIPTION);
+ checkDisc(3, "Metal Machine Music", "1975", EMPTY_DISC_DESCRIPTION);
+ checkDisc(4, "Rock and Roll Heart", "1976", "A sensitive and revealing look into the prince of darkness.");
+ }
+
+ @Test
+ @Ignore("bz975128")
+ @InSequence(9)
+ public void removeDiscTest() {
+ clickAndWaitHttp(MANAGE_DISCS);
+ // correct Rock and Roll Heart description
+ findAndClickDisc("Berlin");
+ checkDiscDetail("Berlin", "1973", "A tragic rock opera about a doomed couple that addresses themes of drug use and depression.", "Lou Reed");
+
+ clickAndWaitHttp(DISC_DETAIL_REMOVE);
+
+ // check whether it's ok from the artists' perspective
+ clickAndWaitHttp(MANAGE_ARTISTS);
+
+ findAndClickArtist("Lou Reed");
+
+ // check whether it is the Lou Reed
+ assertEquals("This artist is not Lou Reed!", "Lou Reed", getValue(ARTIST_NAME));
+
+ // check discs (they should be sorted by release date)
+ checkDisc(1, "Sally Can't Dance", "1974", EMPTY_DISC_DESCRIPTION);
+ checkDisc(2, "Metal Machine Music", "1975", EMPTY_DISC_DESCRIPTION);
+ checkDisc(3, "Rock and Roll Heart", "1976", "A sensitive and revealing look into the prince of darkness.");
+ }
+
+ @Test
+ @Ignore("bz975128")
+ @InSequence(10)
+ public void cancelDiscTest() {
+ clickAndWaitHttp(MANAGE_DISCS);
+ // correct Rock and Roll Heart description
+ findAndClickDisc("Rock and Roll Heart"); // should not be on the first page
+ checkDiscDetail("Rock and Roll Heart", "1976", "A sensitive and revealing look into the prince of darkness.", "Lou Reed");
+
+ type(DISC_DETAIL_DESCRIPTION, "Pretty lame album.");
+
+ clickAndWaitHttp(DISC_DETAIL_CANCEL);
+
+ findAndClickDisc("Rock and Roll Heart");
+ checkDiscDetail("Rock and Roll Heart", "1976", "A sensitive and revealing look into the prince of darkness.", "Lou Reed");
+
+ // check whether it's ok from the artists' perspective
+ clickAndWaitHttp(MANAGE_ARTISTS);
+
+ findAndClickArtist("Lou Reed");
+
+ // check whether it is the Lou Reed
+ assertEquals("This artist is not Lou Reed!", "Lou Reed", getValue(ARTIST_NAME));
+
+ // check discs (they should be sorted by release date)
+ checkDisc(1, "Sally Can't Dance", "1974", EMPTY_DISC_DESCRIPTION);
+ checkDisc(2, "Metal Machine Music", "1975", EMPTY_DISC_DESCRIPTION);
+ checkDisc(3, "Rock and Roll Heart", "1976", "A sensitive and revealing look into the prince of darkness.");
+
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ftest/src/test/java/org/jboss/seam/example/seamdiscs/test/graphene/SeamDiscsFunctionalTestBase.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ftest/src/test/java/org/jboss/seam/example/seamdiscs/test/graphene/SeamDiscsFunctionalTestBase.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ftest/src/test/java/org/jboss/seam/example/seamdiscs/test/graphene/SeamDiscsFunctionalTestBase.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,227 @@
+/*
+ * 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.example.seamdiscs.test.graphene;
+
+import com.thoughtworks.selenium.SeleniumException;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.seam.example.common.test.DeploymentResolver;
+import org.jboss.seam.example.common.test.SeamGrapheneTest;
+import org.jboss.shrinkwrap.api.Archive;
+import static org.junit.Assert.*;
+import org.junit.Before;
+import org.openqa.selenium.By;
+import org.openqa.selenium.support.ui.Select;
+
+/**
+ *
+ * @author Ondrej Skutka
+ *
+ */
+public abstract class SeamDiscsFunctionalTestBase extends SeamGrapheneTest {
+ // TODO final
+
+ public static By LOGIN = By.id("loginlink");
+ public static By LOGOUT = By.id("logout");
+ public static By LOGIN_USERNAME = By.id("login:username");
+ public static By LOGIN_PASSWORD = By.id("login:password");
+ public static By LOGIN_LOGIN = By.id("login:loginbutton");
+ public static String HOME_URL = "home.seam";
+// public static By SECURITY = By.id("security");
+//
+ public static By MANAGE_DISCS = By.id("manageDiscs");
+ public static By CREATE_ARTIST_BUTTON = By.id("addArtist");
+ public static By CREATE_BAND_BUTTON = By.id("addBand");
+ public static By ARTIST_FILTER = By.xpath("//form[1]//input[@type=\"text\"]");
+ public static By ARTIST_NAME = By.id("artist:name");
+ public static By ARTIST_CREATE_DISC_BUTTON = By.id("artist:addDisc");
+ public static By ARTIST_DESCRIPTION = By.id("artist:description");
+ public static By ARTIST_PERSIST = By.id("artist:persist");
+ public static By ARTIST_UPDATE = By.id("artist:update");
+ public static By ARTIST_CANCEL = By.id("artist:cancel");
+ public static By ARTIST_ADD_BAND_MEMBER = By.id("artist:addBandMember");
+ public static String ARTIST_NTH_BAND_MEMBER = "xpath=//form[@id=\"artist\"]//tr[1]//tr[3]/td[2]//ul/li[{0}]//input[@type=\"text\"]";
+ public static By ARTIST_LAST_BAND_MEMBER = By.xpath("//form[@id=\"artist\"]//tr[1]//tr[3]/td[2]//ul/li[last()]//input[@type=\"text\"]");
+ public static String ARTIST_NTH_DISC = "xpath=//div[@id=\"artist:discs\"]/table/tbody/tr/td/table/tbody/tr[{0}]";
+ public static String ARTIST_NTH_DISC_SHOW_DETAILS = ARTIST_NTH_DISC + "/td[1]/div/a[2]";
+ public static String ARTIST_NTH_DISC_NAME = ARTIST_NTH_DISC + "/td[2]/input";
+ public static String ARTIST_NTH_DISC_YEAR = ARTIST_NTH_DISC + "/td[3]//input";
+ public static String ARTIST_NTH_DISC_DETAIL = ARTIST_NTH_DISC + "/td";
+ public static By ARTISTS_FIRST_ARTIST_LINK = By.xpath("//span[@id=\"artists\"]//table/tbody/tr/td/table/tbody/tr[2]/td[2]/a");
+ public static By ARTISTS_NEXT_PAGE_LINK = By.xpath("//span[@id=\"artists\"]//td[1]//td[2]//td[5]/a");
+ public static String ARTIST_TABLE_ROW_BY_NAME = "xpath=//span[@id=\"artists\"]//tr[normalize-space(td/a/text())=\"{0}\"]";
+ // these locators can only be used catenated with ARTIST_TABLE_ROW_BY_NAME
+ public static String ARTIST_TABLE_ROW_LINK = ARTIST_TABLE_ROW_BY_NAME + "/td[2]/a";
+ public static By MANAGE_ARTISTS = By.id("manageArtists");
+ public static By CREATE_DISC_BUTTON = By.id("addDisc");
+ public static By DISC_DETAIL_TITLE = By.xpath("//form[@id=\"disc\"]//tr//tr[2]/td[2]/input");
+ public static By DISC_DETAIL_RELEASE_DATE = By.xpath("//form[@id=\"disc\"]//tr//tr[3]/td[2]//input");
+ public static By DISC_DETAIL_ARTIST = By.xpath("//form[@id=\"disc\"]//tr//tr[4]//select");
+ public static By DISC_DETAIL_DESCRIPTION = By.id("description");
+ public static By DISC_DETAIL_UPDATE = By.id("update");
+ public static By DISC_DETAIL_PERSIST = By.id("persist");
+ public static By DISC_DETAIL_REMOVE = By.id("remove");
+ public static By DISC_DETAIL_CANCEL = By.id("cancel");
+ public static By DISCS_NEXT_PAGE_LINK = By.xpath("//table[@id=\"discs\"]//td[1]//td[2]//td[5]/a");
+ public static String DISC_TABLE_ROW_BY_NAME = "xpath=//table[@id=\"discs\"]//tr/td/a[contains(text(), \"{0}\")]";
+ // these locators can only be used catenated with DISC_TABLE_ROW_BY_NAME
+ public static String DISC_TABLE_ROW_LINK = DISC_TABLE_ROW_BY_NAME + "/td[2]/a";
+ public static String EMPTY_DISC_DESCRIPTION = "None known";
+ public static String DEFAULT_USERNAME = "administrator";
+ public static String DEFAULT_PASSWORD = "administrator";
+
+ @Deployment(testable = false)
+ public static Archive<?> createDeployment() {
+ return DeploymentResolver.createDeployment();
+ }
+
+ @Override
+ @Before
+ public void beforeTest() {
+ open(contextPath + HOME_URL);
+ if (!isLoggedIn()) {
+ login();
+ }
+ }
+
+ public void login() {
+ login(DEFAULT_USERNAME, DEFAULT_PASSWORD);
+ }
+
+ public void login(String username, String password) {
+ clickAndWaitHttp(LOGIN);
+ type(LOGIN_USERNAME, username);
+ type(LOGIN_PASSWORD, password);
+ clickAndWaitHttp(LOGIN_LOGIN);
+ }
+
+ protected boolean isLoggedIn() {
+ return !isElementPresent(LOGIN) && isElementPresent(LOGOUT);
+ }
+
+ /**
+ * Checks whether specified disc contains expected data.
+ */
+ protected void checkDisc(int tableRow, String expectedDiscTitle, String expectedReleaseDate, String expectedDescription) {
+ tableRow++; // first row is header
+ String actualDiscTitle = getValue(getBy(ARTIST_NTH_DISC_NAME, tableRow));
+ assertEquals(expectedDiscTitle, actualDiscTitle);
+
+ String actualReleaseDate = "";
+ if (isElementPresent(getBy(ARTIST_NTH_DISC_YEAR, tableRow))) {
+ try {
+ actualReleaseDate = getValue(getBy(ARTIST_NTH_DISC_YEAR, tableRow));
+ } catch (SeleniumException ex) {
+ // intentianally left blank
+ }
+ assertEquals(expectedReleaseDate, actualReleaseDate);
+ }
+
+ clickAndWaitHttp(getBy(ARTIST_NTH_DISC_SHOW_DETAILS, tableRow));
+ String actualDescription = getText(getBy(ARTIST_NTH_DISC_DETAIL, tableRow + 1));
+ assertEquals(expectedDescription, actualDescription);
+ clickAndWaitHttp(getBy(ARTIST_NTH_DISC_SHOW_DETAILS, tableRow));
+ }
+
+ /**
+ * Checks whether specified disc contains expected data.
+ */
+ protected void checkDiscDetail(String expectedDiscTitle, String expectedReleaseDate, String expectedDescription, String expectedArtist) {
+ String actualDiscTitle = getValue(DISC_DETAIL_TITLE);
+ assertEquals(expectedDiscTitle, actualDiscTitle);
+
+ String actualReleaseDate = "";
+ if (!getValue(DISC_DETAIL_RELEASE_DATE).isEmpty()) {
+ actualReleaseDate = getValue(DISC_DETAIL_RELEASE_DATE);
+ assertEquals(expectedReleaseDate, actualReleaseDate);
+ }
+
+ String actualDescription = getText(DISC_DETAIL_DESCRIPTION);
+ assertEquals(expectedDescription, actualDescription);
+
+ String actualArtist = getSelectedLabel(DISC_DETAIL_ARTIST);
+ assertEquals(expectedArtist, actualArtist);
+ }
+
+ /**
+ * Creates new disc. Expected to be on artist's edit page.
+ *
+ */
+ protected void createDisc(String title, String year) {
+ clickAndWaitHttp(ARTIST_CREATE_DISC_BUTTON);
+ type(getBy(ARTIST_NTH_DISC_NAME, "last()"), title);
+ type(getBy(ARTIST_NTH_DISC_YEAR, "last()"), year);
+ }
+
+ /**
+ * Finds the specified artist in paginated artists page and clicks it.
+ * Expected to be on artists page.
+ *
+ */
+ protected void findAndClickArtist(String artistName) {
+ // find the artist's page (it's paginated) and click it
+ while (!isElementPresent(getBy(ARTIST_TABLE_ROW_BY_NAME, artistName))) { // click through pages
+ assertTrue("Artist " + artistName + " not found.", isElementPresent(ARTISTS_NEXT_PAGE_LINK));
+ click(ARTISTS_NEXT_PAGE_LINK); // ajax
+ // possibly wait for change of table here
+ sleep(3000);
+ }
+
+ clickAndWaitHttp(getBy(ARTIST_TABLE_ROW_LINK, artistName)); // click artist link
+ }
+
+ /**
+ * Finds the specified disc in paginated discs page and clicks it. Expected
+ * to be on discs page.
+ *
+ */
+ protected void findAndClickDisc(String discName) {
+ // find the disc page (it's paginated) and click it
+ while (!isElementPresent(getBy(DISC_TABLE_ROW_BY_NAME, discName))) { // click through pages
+ assertTrue("Disc " + discName + " not found.", isElementPresent(DISCS_NEXT_PAGE_LINK));
+ clickAndWaitAjax(DISCS_NEXT_PAGE_LINK); // ajax
+ sleep(3000);
+ }
+
+ clickAndWaitHttp(getBy(DISC_TABLE_ROW_LINK, discName)); // click disc link
+ }
+
+ protected void addBandMember(String artistName) {
+ clickAndWaitHttp(ARTIST_ADD_BAND_MEMBER);
+ type(ARTIST_LAST_BAND_MEMBER, artistName);
+ }
+
+ /**
+ * Checks whether specified disc contains expected data.
+ */
+ protected void checkBandMember(int tableRow, String expectedBandMember) {
+ String actualMemberName = getValue(getBy(ARTIST_NTH_BAND_MEMBER, tableRow));
+ assertEquals(expectedBandMember, actualMemberName);
+ }
+
+ protected String getSelectedLabel(By by) {
+ return new Select(browser.findElement(by)).getFirstSelectedOption().getText();
+ }
+
+ public String getValue(By by) {
+ return browser.findElement(by).getAttribute("value");
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ftest/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ftest/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Modified: branches/enterprise/WFK-2_1/examples/seampay/README.html
===================================================================
--- branches/enterprise/WFK-2_1/examples/seampay/README.html 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/seampay/README.html 2013-09-13 14:11:17 UTC (rev 15588)
@@ -1,6 +1,6 @@
<h1>Seam Seampay Example</h1>
-<p>This example shows Seam’s EJB3 timer support.</p>
+<p>This example shows Seam's EJB3 timer support.</p>
<h2>Running the example</h2>
@@ -9,27 +9,25 @@
<ol>
<li><p>In the example root directory run:</p>
-<pre><code> mvn clean install
+<pre><code>mvn clean install
</code></pre></li>
<li><p>Set JBOSS_HOME environment property.</p></li>
<li><p>In the seampay-ear directory run:</p>
-<pre><code> mvn jboss-as:deploy
+<pre><code>mvn jboss-as:deploy
</code></pre></li>
<li><p>Open this URL in a web browser: http://localhost:8080/seam-seampay</p></li>
</ol>
-
<h2>Testing the example</h2>
-<p>This example is covered by integration tests. All tests use the following technologies:</p>
+<p>This example is covered by integration and functional tests. All tests use the following technologies:</p>
<ul>
<li><strong>Arquillian</strong> - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,</li>
<li><strong>ShrinkWrap</strong> - to create the test archive (WAR).</li>
</ul>
-
<h3>Integration tests</h3>
<p>Integration tests cover core application logic and reside in the EJB module. In addition to Arquillian and ShrinkWrap, the integration tests also use:</p>
@@ -39,9 +37,8 @@
<li><strong>ShrinkWrap Resolver</strong> - to resolve dependencies of the project for packaging in the test archive.</li>
</ul>
+<p>The tests are executed in Maven's test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-<p>The tests are executed in Maven’s test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-
<pre><code>mvn clean test -Darquillian=jbossas-managed-7
</code></pre>
@@ -52,6 +49,41 @@
<pre><code>mvn clean test -Darquillian=jbossas-remote-7
</code></pre>
+<h3>Functional tests</h3>
+
+<p>Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:</p>
+
+<ul>
+<li><strong>Arquillian Graphene Extension</strong> - an advanced Ajax-capable type-safe Selenium-based browser testing tool,</li>
+<li><strong>Arquillian Drone Extension</strong> - to automatically run and stop browser instances.</li>
+</ul>
+
+<p><em>Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server.</em></p>
+
+<p>Run the functional test on JBoss AS instance with</p>
+
+<pre><code>mvn -f seampay-ftest/pom.xml clean test
+</code></pre>
+
+<p>The <code>JBOSS_HOME</code> environment variable must be set and point to a JBoss AS instance directory.</p>
+
+<p>Several variables can be configured:</p>
+
+<ul>
+<li><p>path to an alternative archive for testing</p>
+
+<pre><code>-DtestDeployment=/path/to/archive.ear
+</code></pre></li>
+<li><p>the browser to use for testing</p>
+
+<pre><code>-DbrowserCapabilities=htmlUnit
+</code></pre></li>
+<li><p>test on a running server</p>
+
+<pre><code>-Dremote
+</code></pre></li>
+</ul>
+
<h2>Testing in JBDS</h2>
<h3>Integration tests</h3>
@@ -60,11 +92,20 @@
<li>Open JBDS and start a configured instance of JBoss AS</li>
<li>Import the example project and its submodules</li>
<li>In the <em>Project Explorer</em>, select the EJB module project, then
-
<ol>
<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and check <code>integration-tests</code> and <code>arq-jbossas-7-remote</code></li>
<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-</li>
+
+<h3>Functional tests</h3>
+
+<ol>
+<li>Open JBDS and start a configured instance of JBoss AS</li>
+<li>Import the <code>ftest</code> project of the example</li>
+<li>In the <em>Project Explorer</em>, select the ftest project, then
+<ol>
+<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and activate <code>arq-jbossas-7-remote</code> profile and deactivate <code>arq-jbossas-7-managed</code> profile</li>
+<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-
Modified: branches/enterprise/WFK-2_1/examples/seampay/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/seampay/README.md 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/seampay/README.md 2013-09-13 14:11:17 UTC (rev 15588)
@@ -24,7 +24,7 @@
Testing the example
-------------------
-This example is covered by integration tests. All tests use the following technologies:
+This example is covered by integration and functional tests. All tests use the following technologies:
* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
* __ShrinkWrap__ - to create the test archive (WAR).
@@ -47,7 +47,35 @@
mvn clean test -Darquillian=jbossas-remote-7
+### Functional tests
+Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:
+
+* __Arquillian Graphene Extension__ - an advanced Ajax-capable type-safe Selenium-based browser testing tool,
+* __Arquillian Drone Extension__ - to automatically run and stop browser instances.
+
+_Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server._
+
+Run the functional test on JBoss AS instance with
+
+ mvn -f seampay-ftest/pom.xml clean test
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+Several variables can be configured:
+
+* path to an alternative archive for testing
+
+ -DtestDeployment=/path/to/archive.ear
+
+* the browser to use for testing
+
+ -DbrowserCapabilities=htmlUnit
+
+* test on a running server
+
+ -Dremote
+
Testing in JBDS
---------------
### Integration tests
@@ -57,3 +85,11 @@
3. In the _Project Explorer_, select the EJB module project, then
1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and check `integration-tests` and `arq-jbossas-7-remote`
2. Right-click the module and select _Run As_ - _JUnit Test_
+
+### Functional tests
+
+1. Open JBDS and start a configured instance of JBoss AS
+2. Import the `ftest` project of the example
+3. In the _Project Explorer_, select the ftest project, then
+ 1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and activate `arq-jbossas-7-remote` profile and deactivate `arq-jbossas-7-managed` profile
+ 2. Right-click the module and select _Run As_ - _JUnit Test_
Added: branches/enterprise/WFK-2_1/examples/seampay/seampay-ftest/pom.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seampay/seampay-ftest/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/seampay/seampay-ftest/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seampay/seampay-ftest/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/seampay/seampay-ftest/src/test/resources/ftest.properties
===================================================================
--- branches/enterprise/WFK-2_1/examples/seampay/seampay-ftest/src/test/resources/ftest.properties (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seampay/seampay-ftest/src/test/resources/ftest.properties 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,32 @@
+ #
+ # 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.
+ #
+MAIN_PAGE search.seam
+MAIN_PAGE_TITLE Seam Pay
+ACCOUNT_TABLE_LINK id=accountTable:{0}:link
+ACCOUNT_TABLE_BALANCE id=accountTable:{0}:balance
+PAYMENT_TO_FIELD id=accountView:paymentForm:payee
+PAYMENT_AMOUNT_FIELD id=accountView:paymentForm:amount
+PAYMENT_ONLY_ONCE_RADIO id=accountView:paymentForm:radioList:0
+PAYMENT_EVERY_MINUTE_RADIO id=accountView:paymentForm:radioList:1
+PAYMENT_SUBMIT id=accountView:paymentForm:submit
+PAYMENT_CONFIRMATION_MESSAGE Created a new payment to {0}
+PAYMENTS_COUNT xpath=//table[@id\='payments']/tbody/tr
Modified: branches/enterprise/WFK-2_1/examples/seamspace/README.html
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamspace/README.html 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/seamspace/README.html 2013-09-13 14:11:17 UTC (rev 15588)
@@ -11,43 +11,35 @@
<ol>
<li><p>In the example root directory run:</p>
-<pre><code> mvn clean install
+<pre><code>mvn clean install
</code></pre></li>
<li><p>Set JBOSS_HOME environment property.</p></li>
<li><p>In the seamspace-ear directory run:</p>
-<pre><code> mvn jboss-as:deploy
+<pre><code>mvn jboss-as:deploy
</code></pre></li>
<li><p>Open this URL in a web browser: http://localhost:8080/seam-seamspace</p></li>
</ol>
-
<h3>Using Ant</h3>
<ol>
<li><p>In the example root directory run:</p>
-<p> ant clean package</p></li>
+<p>ant clean package</p></li>
<li><p>Copy <code>seam-seamspace.ear</code> from directory <code>booking-ear/target</code> to the deployment directory of JBoss AS (<code>$JBOSS_HOME/standalone/deployments</code> by default)</p></li>
<li><p>Open this URL in a web browser: <code>http://localhost:8080/seam-seamspace</code></p></li>
</ol>
-
-<p><em>NOTE: If the Seam distribution is not unpacked in the same directory as the examples, the path to the Seam distribution must be set by defining <code>seam.dir</code> property</em></p>
-
-<pre><code>ant clean package -Dseam.dir=/path/to/jboss-seam
-</code></pre>
-
<h2>Testing the example</h2>
-<p>This example is covered by integration tests. All tests use the following technologies:</p>
+<p>This example is covered by integration and functional tests. All tests use the following technologies:</p>
<ul>
<li><strong>Arquillian</strong> - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,</li>
<li><strong>ShrinkWrap</strong> - to create the test archive (WAR).</li>
</ul>
-
<h3>Integration tests</h3>
<p>Integration tests cover core application logic and reside in the EJB module. In addition to Arquillian and ShrinkWrap, the integration tests also use:</p>
@@ -57,9 +49,8 @@
<li><strong>ShrinkWrap Resolver</strong> - to resolve dependencies of the project for packaging in the test archive.</li>
</ul>
+<p>The tests are executed in Maven's test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-<p>The tests are executed in Maven’s test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-
<pre><code>mvn clean test -Darquillian=jbossas-managed-7
</code></pre>
@@ -77,6 +68,41 @@
<pre><code>ant clean test
</code></pre>
+<h3>Functional tests</h3>
+
+<p>Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:</p>
+
+<ul>
+<li><strong>Arquillian Graphene Extension</strong> - an advanced Ajax-capable type-safe Selenium-based browser testing tool,</li>
+<li><strong>Arquillian Drone Extension</strong> - to automatically run and stop browser instances.</li>
+</ul>
+
+<p><em>Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server.</em></p>
+
+<p>Run the functional test on JBoss AS instance with</p>
+
+<pre><code>mvn -f seamspace-ftest/pom.xml clean test
+</code></pre>
+
+<p>The <code>JBOSS_HOME</code> environment variable must be set and point to a JBoss AS instance directory.</p>
+
+<p>Several variables can be configured:</p>
+
+<ul>
+<li><p>path to an alternative archive for testing</p>
+
+<pre><code>-DtestDeployment=/path/to/archive.ear
+</code></pre></li>
+<li><p>the browser to use for testing</p>
+
+<pre><code>-DbrowserCapabilities=htmlUnit
+</code></pre></li>
+<li><p>test on a running server</p>
+
+<pre><code>-Dremote
+</code></pre></li>
+</ul>
+
<h2>Testing in JBDS</h2>
<h3>Integration tests</h3>
@@ -85,11 +111,20 @@
<li>Open JBDS and start a configured instance of JBoss AS</li>
<li>Import the example project and its submodules</li>
<li>In the <em>Project Explorer</em>, select the EJB module project, then
-
<ol>
<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and check <code>integration-tests</code> and <code>arq-jbossas-7-remote</code></li>
<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-</li>
+
+<h3>Functional tests</h3>
+
+<ol>
+<li>Open JBDS and start a configured instance of JBoss AS</li>
+<li>Import the <code>ftest</code> project of the example</li>
+<li>In the <em>Project Explorer</em>, select the ftest project, then
+<ol>
+<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and activate <code>arq-jbossas-7-remote</code> profile and deactivate <code>arq-jbossas-7-managed</code> profile</li>
+<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-
Modified: branches/enterprise/WFK-2_1/examples/seamspace/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamspace/README.md 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/seamspace/README.md 2013-09-13 14:11:17 UTC (rev 15588)
@@ -33,15 +33,10 @@
3. Open this URL in a web browser: `http://localhost:8080/seam-seamspace`
-_NOTE: If the Seam distribution is not unpacked in the same directory as the examples, the path to the Seam distribution must be set by defining `seam.dir` property_
-
- ant clean package -Dseam.dir=/path/to/jboss-seam
-
-
Testing the example
-------------------
-This example is covered by integration tests. All tests use the following technologies:
+This example is covered by integration and functional tests. All tests use the following technologies:
* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
* __ShrinkWrap__ - to create the test archive (WAR).
@@ -71,6 +66,35 @@
ant clean test
+### Functional tests
+
+Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:
+
+* __Arquillian Graphene Extension__ - an advanced Ajax-capable type-safe Selenium-based browser testing tool,
+* __Arquillian Drone Extension__ - to automatically run and stop browser instances.
+
+_Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server._
+
+Run the functional test on JBoss AS instance with
+
+ mvn -f seamspace-ftest/pom.xml clean test
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+Several variables can be configured:
+
+* path to an alternative archive for testing
+
+ -DtestDeployment=/path/to/archive.ear
+
+* the browser to use for testing
+
+ -DbrowserCapabilities=htmlUnit
+
+* test on a running server
+
+ -Dremote
+
Testing in JBDS
---------------
### Integration tests
@@ -80,3 +104,11 @@
3. In the _Project Explorer_, select the EJB module project, then
1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and check `integration-tests` and `arq-jbossas-7-remote`
2. Right-click the module and select _Run As_ - _JUnit Test_
+
+### Functional tests
+
+1. Open JBDS and start a configured instance of JBoss AS
+2. Import the `ftest` project of the example
+3. In the _Project Explorer_, select the ftest project, then
+ 1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and activate `arq-jbossas-7-remote` profile and deactivate `arq-jbossas-7-managed` profile
+ 2. Right-click the module and select _Run As_ - _JUnit Test_
Added: branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/pom.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/BlogTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/BlogTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/BlogTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,60 @@
+/*
+ * 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.example.seamspace.test.graphene;
+
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import static org.junit.Assert.*;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * This class tests blog functionality of SeamSpace application
+ *
+ * @author Jozef Hartinger
+ *
+ */
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class BlogTest extends SeamSpaceFunctionalTestBase {
+
+
+
+ @Test
+ public void createBlogTest() {
+ String title = "What is Seam?";
+ String text = "Seam is a powerful open source development platform for building rich Internet applications in Java. Seam integrates technologies such as Asynchronous JavaScript and XML (AJAX), JavaServer Faces (JSF), Java Persistence (JPA), Enterprise Java Beans (EJB 3.0) and Business Process Management (BPM) into a unified full-stack solution, complete with sophisticated tooling.";
+ int blogCount = 0;
+
+ clickAndWaitHttp(getBy("VIEW_BLOG_ENTRY"));
+ blogCount = getXpathCount(getBy("BLOG_ENTRY_COUNT"));
+ browser.navigate().back();
+ clickAndWaitHttp(getBy("CREATE_BLOG_ENTRY"));
+ type(getBy("NEW_BLOG_TITLE"), title);
+ type(getBy("NEW_BLOG_TEXT"), text);
+ clickAndWaitHttp(getBy("NEW_BLOG_SUBMIT"));
+ assertEquals("Unexpected number of blog entries.", ++blogCount, getXpathCount(getBy("BLOG_ENTRY_COUNT")));
+ String blogEntry = getProperty("BLOG_ENTRY_BY_TITLE", title);
+ assertTrue("Blog entry not found. " + blogEntry, isElementPresent(getBy(blogEntry)));
+ assertEquals("Blog entry text has been modified.", text, getText(getBy(blogEntry + getProperty("BLOG_ENTRY_TEXT"))));
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/FriendRequestTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/FriendRequestTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/FriendRequestTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,49 @@
+/*
+ * 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.example.seamspace.test.graphene;
+
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import static org.junit.Assert.*;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * This class tests "Send a friend request" at seamspace example. This option is
+ * available when user opens somebody's profile.
+ *
+ * @author Martin Gencur
+ *
+ */
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class FriendRequestTest extends SeamSpaceFunctionalTestBase {
+
+ @Test
+ public void sendFriendRequestText() {
+ clickAndWaitHttp(getBy("DUKE_IMAGE"));
+ clickAndWaitHttp(getBy("FRIEND_REQUEST_LINK"));
+ type(getBy("MESSAGE_AREA"), getProperty("MESSAGE_TEXT"));
+ clickAndWaitHttp(getBy("REQUEST_SEND_BUTTON"));
+ assertTrue("Friend request sent page expected", isTextInSource(getProperty("REQUEST_SENT_MESSAGE")));
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/LoginTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/LoginTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/LoginTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,53 @@
+/*
+ * 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.example.seamspace.test.graphene;
+
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.junit.InSequence;
+import static org.junit.Assert.*;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Basic test covering user authentication
+ *
+ * @author Jozef Hartinger
+ *
+ */
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class LoginTest extends SeamSpaceFunctionalTestBase {
+
+ @Test
+ @InSequence(1)
+ public void loginTest() {
+ assertTrue("Login failed.", isLoggedIn());
+ }
+
+ @Test
+ @InSequence(2)
+ public void logoutTest() {
+ clickAndWaitHttp(getBy("LOGOUT"));
+ assertFalse("Logout failed.", isLoggedIn());
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/RoleTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/RoleTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/RoleTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,128 @@
+/*
+ * 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.example.seamspace.test.graphene;
+
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import static org.jboss.arquillian.graphene.Graphene.*;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.junit.InSequence;
+import static org.junit.Assert.*;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.openqa.selenium.Alert;
+
+/**
+ * This class tests role management in SeamSpace application
+ *
+ * @author Jozef Hartinger
+ *
+ */
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class RoleTest extends SeamSpaceFunctionalTestBase {
+
+ @Override
+ @Before
+ public void beforeTest() {
+ Assume.assumeTrue(isRealBrowser());// due to alerts
+ super.beforeTest();
+ clickAndWaitHttp(getBy("SECURITY"));
+ clickAndWaitHttp(getBy("MANAGE_ROLES"));
+ }
+
+ @Test
+ @InSequence(1)
+ public void roleCreatingTest() {
+ String roleName = "tester";
+ String[] roles = {"user", "admin"};
+ createNewRole(roleName, roles);
+ // check that new role is added to role list
+ String roleRow = getProperty("ROLE_TABLE_ROW_BY_NAME", roleName);
+ assertTrue("New role not found in role list.", isElementPresent(getBy(roleRow)));
+ String roleTableRoles = getText(getBy(roleRow + getProperty("ROLE_TABLE_ROLES")));
+ assertTrue("New role is not member of " + roles[0] + " role.", roleTableRoles.contains(roles[0]));
+ assertTrue("New role is not member of " + roles[1] + " role.", roleTableRoles.contains(roles[1]));
+ // check that new role is available to users
+ clickAndWaitHttp(getBy("SECURITY"));
+ clickAndWaitHttp(getBy("MANAGE_USERS"));
+ clickAndWaitHttp(getBy("CREATE_USER_BUTTON"));
+ assertTrue("New role is not available when creating new user.", isElementPresent(getBy("USER_ROLE_BY_NAME_CHECKBOX", roleName)));
+ }
+
+ @Test
+ @InSequence(2)
+ public void roleEditingTest() {
+ String oldRoleName = "QA";
+ String[] oldRoles = {"user"};
+ String newRoleName = "QE";
+ String[] newRoles = {"user", "admin"};
+
+ createNewRole(oldRoleName, oldRoles);
+ String oldRoleRow = getProperty("ROLE_TABLE_ROW_BY_NAME", oldRoleName);
+ assertTrue("New role not found.", isElementPresent(getBy(oldRoleRow)));
+ assertFalse("New role should not be member of admin role.", getText(getBy(oldRoleRow + getProperty("ROLE_TABLE_ROLES"))).contains("admin"));
+ clickAndWaitHttp(getBy(oldRoleRow + getProperty("ROLE_TABLE_EDIT")));
+ fillRoleDetails(newRoleName, newRoles);
+ clickAndWaitHttp(getBy("ROLE_SAVE"));
+ String newRoleRow = getProperty("ROLE_TABLE_ROW_BY_NAME", newRoleName);
+ assertFalse("Old role still present.", isElementPresent(getBy(oldRoleRow)));
+ assertTrue("Updated role not found in role table.", isElementPresent(getBy(newRoleRow)));
+ String updatedRoleTableRoles = getText(getBy(newRoleRow + getProperty("ROLE_TABLE_ROLES")));
+ assertTrue("New role is not member of " + newRoles[0] + " role.", updatedRoleTableRoles.contains(newRoles[0]));
+ assertTrue("New role is not member of " + newRoles[1] + " role.", updatedRoleTableRoles.contains(newRoles[1]));
+ }
+
+ @Test
+ @InSequence(3)
+ public void roleDeletingTest() {
+ String roleName = "commiter";
+ String[] roles = {"user"};
+
+ createNewRole(roleName, roles);
+ String roleRow = getProperty("ROLE_TABLE_ROW_BY_NAME", roleName);
+ assertTrue("New role not found.", isElementPresent(getBy(roleRow)));
+ click(getBy(roleRow + getProperty("ROLE_TABLE_DELETE")));
+ sleep(2000);
+ Alert confirm = browser.switchTo().alert();
+ assertTrue("Expected role deletion confirmation.", confirm.getText().contains(getProperty("ROLE_TABLE_DELETE_CONFIRMATION")));
+ confirm.accept();
+ sleep(2000);
+ waitModel().until(element(getBy(roleRow)).not().isPresent());
+ assertFalse("Removed role still present.", isElementPresent(getBy(roleRow)));
+ }
+
+ public void createNewRole(String name, String[] roles) {
+ clickAndWaitHttp(getBy("CREATE_ROLE_BUTTON"));
+ fillRoleDetails(name, roles);
+ clickAndWaitHttp(getBy("ROLE_SAVE"));
+ }
+
+ public void fillRoleDetails(String name, String[] roles) {
+ type(getBy("ROLE_NAME"), name);
+ for (String role : roles) {
+ assertTrue("Role not available: " + role, isElementPresent(getBy("ROLE_MEMBER_OF_BY_NAME_CHECKBOX", role)));
+ check(getBy("ROLE_MEMBER_OF_BY_NAME_CHECKBOX", role));
+ }
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/SeamSpaceFunctionalTestBase.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/SeamSpaceFunctionalTestBase.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/SeamSpaceFunctionalTestBase.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -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.example.seamspace.test.graphene;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.seam.example.common.test.DeploymentResolver;
+import org.jboss.seam.example.common.test.SeamGrapheneTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.After;
+import org.junit.Before;
+
+/**
+ *
+ * @author Jozef Hartinger
+ *
+ */
+public abstract class SeamSpaceFunctionalTestBase extends SeamGrapheneTest {
+
+ @Deployment(testable = false)
+ public static Archive<?> createDeployment() {
+ return DeploymentResolver.createDeployment();
+ }
+
+ @Override
+ @Before
+ public void beforeTest() {
+ open(contextPath + getProperty("HOME_URL"));
+ if (!isLoggedIn()) {
+ login();
+ }
+ }
+
+ @After
+ public void tearDown() {
+ if (isLoggedIn()) {
+ clickAndWaitHttp(getBy("LOGOUT"));
+ }
+ }
+
+ public void login() {
+ login(getProperty("DEFAULT_USERNAME"), getProperty("DEFAULT_PASSWORD"));
+ }
+
+ public void login(String username, String password) {
+ clickAndWaitHttp(getBy("LOGIN"));
+ type(getBy("LOGIN_USERNAME"), username);
+ type(getBy("LOGIN_PASSWORD"), password);
+ clickAndWaitHttp(getBy("LOGIN_LOGIN"));
+ }
+
+ protected boolean isLoggedIn() {
+ return !isElementPresent(getBy("LOGIN")) && isElementPresent(getBy("LOGOUT"));
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/UserTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/UserTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/UserTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,154 @@
+/*
+ * 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.example.seamspace.test.graphene;
+
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import static org.jboss.arquillian.graphene.Graphene.*;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.junit.InSequence;
+import static org.junit.Assert.*;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * This class tests user management in SeamSpace application
+ *
+ * @author Jozef Hartinger
+ *
+ */
+
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class UserTest extends SeamSpaceFunctionalTestBase {
+
+ @Override
+ @Before
+ public void beforeTest() {
+ Assume.assumeTrue(isRealBrowser());// due to alerts
+ super.beforeTest();
+ clickAndWaitHttp(getBy("SECURITY"));
+ clickAndWaitHttp(getBy("MANAGE_USERS"));
+ }
+
+ @Test
+ @InSequence(1)
+ public void userCreatingTest() {
+ String username = "jharting";
+ String password = "topSecret";
+ String[] roles = {"admin", "user"};
+ createNewUser("Jozef", "Hartinger", username, password, password, roles, true);
+ String userRow = getProperty("USER_TABLE_ROW_BY_NAME", username);
+ // check user list
+ assertTrue("User not found in userlist.", isElementPresent(getBy(userRow)));
+ assertTrue("User not in admin role.", getText(getBy(userRow + getProperty("USER_TABLE_ROLES"))).contains("admin"));
+ assertTrue("User not in user role.", getText(getBy(userRow + getProperty("USER_TABLE_ROLES"))).contains("user"));
+ assertTrue("User not enabled.", isElementPresent(getBy(userRow + getProperty("USER_TABLE_CHECKBOX_CHECKED"))));
+ // check new user can login
+ clickAndWaitHttp(getBy("LOGOUT"));
+ login(username, password);
+ assertTrue("Unable to login with new user's credentials.", isLoggedIn());
+ }
+
+ @Test
+ @InSequence(2)
+ public void userEditingTest() {
+ String username = "shadowman";
+ String password = "password";
+ String[] roles = {"admin", "user"};
+ String userRow = getProperty("USER_TABLE_ROW_BY_NAME", username);
+ clickAndWaitHttp(getBy(userRow + getProperty("USER_TABLE_EDIT")));
+ fillUpdatableUserDetails(password, password, roles, true);
+ clickAndWaitHttp(getBy("USER_SAVE"));
+ assertTrue("User not in admin role.", getText(getBy(userRow + getProperty("USER_TABLE_ROLES"))).contains("admin"));
+ assertTrue("User not in user role.", getText(getBy(userRow + getProperty("USER_TABLE_ROLES"))).contains("user"));
+ clickAndWaitHttp(getBy("LOGOUT"));
+ login(username, password);
+ assertTrue("Unable to login with changed password", isLoggedIn());
+ }
+
+ @Test
+ @InSequence(3)
+ public void userDeletingTest() throws InterruptedException {
+ String username = "mona";
+ String userRow = getProperty("USER_TABLE_ROW_BY_NAME", username);
+ assertTrue("User " + username + " not in user list.", isElementPresent(getBy(userRow)));
+ String windowHandle = browser.getWindowHandle();
+ click(getBy(userRow + getProperty("USER_TABLE_DELETE")));
+ browser.switchTo().alert().accept();
+ browser.switchTo().window(windowHandle);
+ waitModel().until(element(getBy(userRow)).not().isPresent());
+ assertFalse("User " + username + " exists after deletion", isElementPresent(getBy(userRow)));
+ }
+
+ @Test
+ @InSequence(4)
+ public void cancelledUserDeletingTest() throws InterruptedException {
+ String username = "demo";
+ String userRow = getProperty("USER_TABLE_ROW_BY_NAME", username);
+ assertTrue("User " + username + " not in user list.", isElementPresent(getBy(userRow)));
+ click(getBy(userRow + getProperty("USER_TABLE_DELETE")));
+ browser.switchTo().alert().dismiss();
+ browser.navigate().refresh();
+ assertTrue("User " + username + " missing in user list after cancelled deletion.", isElementPresent(getBy(userRow)));
+ }
+
+ @Test
+ @InSequence(5)
+ public void disablingUserAccountTest() {
+ String username = "johny";
+ String password = "password";
+ String userRow = getProperty("USER_TABLE_ROW_BY_NAME", username);
+ createNewUser("John", "Doe", username, password, password, new String[]{"user"}, false);
+ assertTrue("User not found in userlist.", isElementPresent(getBy(userRow)));
+ assertTrue("User account enabled.", isElementPresent(getBy(userRow + getProperty("USER_TABLE_CHECKBOX_UNCHECKED"))));
+ clickAndWaitHttp(getBy("LOGOUT"));
+ login(username, password);
+ assertFalse("User logged in despite his account was disabled.", isLoggedIn());
+ }
+
+ private void createNewUser(String firstName, String lastName, String username, String password, String confirm, String[] roles, boolean enabled) {
+ clickAndWaitHttp(getBy("CREATE_USER_BUTTON"));
+ fillNewUserDetails(firstName, lastName, username, password, confirm, roles, enabled);
+ clickAndWaitHttp(getBy("USER_SAVE"));
+ }
+
+ private void fillNewUserDetails(String firstName, String lastName, String username, String password, String confirm, String[] roles, boolean enabled) {
+ type(getBy("USER_FIRSTNAME"), firstName);
+ type(getBy("USER_LASTNAME"), lastName);
+ type(getBy("USER_NAME"), username);
+ fillUpdatableUserDetails(password, confirm, roles, enabled);
+ }
+
+ private void fillUpdatableUserDetails(String password, String confirm, String[] roles, boolean enabled) {
+ type(getBy("USER_PASSWORD"), password);
+ type(getBy("USER_CONFIRM"), confirm);
+ for (String role : roles) {
+ assertTrue("Unable to add user to role: " + role, isElementPresent(getBy("USER_ROLE_BY_NAME_CHECKBOX", role)));
+ check(getBy("USER_ROLE_BY_NAME_CHECKBOX", role));
+ }
+ if (enabled) {
+ check(getBy("USER_ENABLED"));
+ }
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/resources/ftest.properties
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/resources/ftest.properties (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seamspace/seamspace-ftest/src/test/resources/ftest.properties 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,63 @@
+LOGIN id=login
+LOGOUT id=logout
+LOGIN_USERNAME id=loginForm:name
+LOGIN_PASSWORD id=loginForm:password
+LOGIN_LOGIN id=loginForm:login
+HOME_URL home.seam
+SECURITY id=security
+MANAGE_USERS id=manageUsers
+CREATE_USER_BUTTON id=newUser
+USER_FIRSTNAME id=user:firstname
+USER_LASTNAME id=user:lastname
+USER_NAME id=user:username
+USER_PASSWORD id=user:password
+USER_CONFIRM id=user:confirm
+USER_ROLES id=user:roles
+USER_ROLE_BY_NAME_CHECKBOX xpath=//input[contains(@id, "user:roles:")][normalize-space(../label/text()) = "{0}"]
+USER_ENABLED id=user:enabled
+USER_SAVE id=user:save
+USER_CANCEL id=user:cancel
+
+USER_TABLE_ROW_BY_NAME xpath=//table[@id="threads"]/tbody/tr[normalize-space(./td[1]/text()) = "{0}"]
+# these locators can only be used catenated with USER_TABLE_ROW_BY_NAME
+USER_TABLE_ROLES /td[2]
+USER_TABLE_CHECKBOX_CHECKED /td[3]/div[@class="checkmark"]
+USER_TABLE_CHECKBOX_UNCHECKED /td[3]/div[@class="cross"]
+USER_TABLE_DELETE //a[contains(@id, "delete")]
+USER_TABLE_EDIT //a[contains(@id, "edit")]
+
+MANAGE_ROLES id=manageRoles
+CREATE_ROLE_BUTTON id=newRole
+ROLE_NAME id=role:name
+ROLE_ROLES id=role:roles
+ROLE_MEMBER_OF_BY_NAME_CHECKBOX xpath=//input[contains(@id, "role:roles:")][normalize-space(../label/text()) = "{0}"]
+ROLE_SAVE id=role:save
+ROLE_CANCEL id=role:cancel
+
+ROLE_TABLE_ROW_BY_NAME xpath=//table[@id="threads"]/tbody/tr[normalize-space(./td[1]/text()) = "{0}"]
+# these locators can only be used catenated with ROLE_TABLE_ROW_BY_NAME
+ROLE_TABLE_ROLES /td[2]
+ROLE_TABLE_DELETE //a[contains(@id, "delete")]
+ROLE_TABLE_EDIT //a[contains(@id, "edit")]
+
+ROLE_TABLE_DELETE_CONFIRMATION Are you sure you wish to delete this role? This action cannot be undone.
+
+DEFAULT_USERNAME demo
+DEFAULT_PASSWORD demo
+
+CREATE_BLOG_ENTRY id=createBlog
+VIEW_BLOG_ENTRY id=viewBlog
+BLOG_ENTRY_COUNT xpath=//div[@class="blogEntry"]
+NEW_BLOG_TITLE id=newBlog:title
+NEW_BLOG_TEXT id=newBlog:text
+NEW_BLOG_SUBMIT id=newBlog:submit
+NEW_BLOG_PREVIEW id=newBlog:preview
+BLOG_ENTRY_BY_TITLE xpath=//div[@class="blogEntry"][.//div[@class="blogTitle"]/text() = "{0}"]
+BLOG_ENTRY_TEXT //div[@class="blogText"]
+
+DUKE_IMAGE xpath=//img[contains(@src, "id=-2")]
+FRIEND_REQUEST_LINK link=Send a friend request
+MESSAGE_AREA xpath=//textarea[contains(@id,"introduction")]
+MESSAGE_TEXT Hi Duke, how are you?
+REQUEST_SEND_BUTTON xpath=//input[contains(@value,"Send request")]
+REQUEST_SENT_MESSAGE Friend request sent
Modified: branches/enterprise/WFK-2_1/examples/seamspace/seamspace-web/src/main/webapp/rolemanager.xhtml
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamspace/seamspace-web/src/main/webapp/rolemanager.xhtml 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/seamspace/seamspace-web/src/main/webapp/rolemanager.xhtml 2013-09-13 14:11:17 UTC (rev 15588)
@@ -24,7 +24,7 @@
<h2>Role Manager</h2>
- <s:button id="newRole" action="#{roleAction.createRole}" styleClass="newrole" rendered="#{s:hasPermission('seam.account', 'create', null)}"/>
+ <s:button id="newRole" action="#{roleAction.createRole}" styleClass="newrole" rendered="#{s:hasPermission('seam.account', 'create', null)}" value="New Role" />
<h:dataTable
id="threads"
Modified: branches/enterprise/WFK-2_1/examples/seamspace/seamspace-web/src/main/webapp/usermanager.xhtml
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamspace/seamspace-web/src/main/webapp/usermanager.xhtml 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/seamspace/seamspace-web/src/main/webapp/usermanager.xhtml 2013-09-13 14:11:17 UTC (rev 15588)
@@ -24,7 +24,7 @@
<h2>User Manager</h2>
- <s:button id="newUser" action="#{userAction.createUser}" styleClass="newuser" rendered="#{s:hasPermission('seam.account', 'create')}"/>
+ <s:button id="newUser" action="#{userAction.createUser}" styleClass="newuser" rendered="#{s:hasPermission('seam.account', 'create')}" value="New User"/>
<h:dataTable
id="threads"
Modified: branches/enterprise/WFK-2_1/examples/spring/README.html
===================================================================
--- branches/enterprise/WFK-2_1/examples/spring/README.html 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/spring/README.html 2013-09-13 14:11:17 UTC (rev 15588)
@@ -10,13 +10,62 @@
<ol>
<li><p>In the example root directory run:</p>
-<pre><code> mvn clean install
+<pre><code>mvn clean install
</code></pre></li>
<li><p>Set JBOSS_HOME environment property.</p></li>
<li><p>In the spring-web directory run:</p>
-<pre><code> mvn jboss-as:deploy
+<pre><code>mvn jboss-as:deploy
</code></pre></li>
<li><p>Open this URL in a web browser: http://localhost:8080/spring-web</p></li>
</ol>
+<h2>Testing the example</h2>
+
+<p>This example is covered by functional tests. All tests use the following technologies:</p>
+
+<ul>
+<li><strong>Arquillian</strong> - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,</li>
+<li><strong>ShrinkWrap</strong> - to create the test archive (WAR).</li>
+</ul>
+
+<h3>Functional tests</h3>
+
+<p>Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:</p>
+
+<ul>
+<li><strong>Arquillian Graphene Extension</strong> - an advanced Ajax-capable type-safe Selenium-based browser testing tool,</li>
+<li><strong>Arquillian Drone Extension</strong> - to automatically run and stop browser instances.</li>
+</ul>
+
+<p><em>Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server.</em></p>
+
+<p>Run the functional test on JBoss AS instance with</p>
+
+<pre><code>mvn -f spring-ftest/pom.xml clean test
+</code></pre>
+
+<p>The <code>JBOSS_HOME</code> environment variable must be set and point to a JBoss AS instance directory.</p>
+
+<p>Several variables can be configured:</p>
+
+<ul>
+<li><p>path to an alternative archive for testing</p>
+
+<pre><code>-DtestDeployment=/path/to/archive.ear
+</code></pre></li>
+<li><p>the browser to use for testing</p>
+
+<pre><code>-DbrowserCapabilities=htmlUnit
+</code></pre></li>
+<li><p>test on a running server</p>
+
+<pre><code>-Dremote
+</code></pre></li>
+</ul>
+
+<h2>Testing in JBDS</h2>
+
+<h3>Functional tests</h3>
+
+<p>It is not possible to run the functional tests of this example in JBDS, because they use the maven-dependency-plugin to copy test classes from a different maven artifact, which is not a configuration supported by JBDS.</p>
Modified: branches/enterprise/WFK-2_1/examples/spring/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/spring/README.md 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/spring/README.md 2013-09-13 14:11:17 UTC (rev 15588)
@@ -20,3 +20,49 @@
mvn jboss-as:deploy
4. Open this URL in a web browser: http://localhost:8080/spring-web
+
+
+Testing the example
+-------------------
+
+This example is covered by functional tests. All tests use the following technologies:
+
+* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
+* __ShrinkWrap__ - to create the test archive (WAR).
+
+
+### Functional tests
+
+Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:
+
+* __Arquillian Graphene Extension__ - an advanced Ajax-capable type-safe Selenium-based browser testing tool,
+* __Arquillian Drone Extension__ - to automatically run and stop browser instances.
+
+_Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server._
+
+Run the functional test on JBoss AS instance with
+
+ mvn -f spring-ftest/pom.xml clean test
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+Several variables can be configured:
+
+* path to an alternative archive for testing
+
+ -DtestDeployment=/path/to/archive.ear
+
+* the browser to use for testing
+
+ -DbrowserCapabilities=htmlUnit
+
+* test on a running server
+
+ -Dremote
+
+Testing in JBDS
+---------------
+
+### Functional tests
+
+It is not possible to run the functional tests of this example in JBDS, because they use the maven-dependency-plugin to copy test classes from a different maven artifact, which is not a configuration supported by JBDS.
\ No newline at end of file
Added: branches/enterprise/WFK-2_1/examples/spring/spring-ftest/pom.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/spring/spring-ftest/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/spring/spring-ftest/src/test/java/org/jboss/seam/example/spring/test/graphene/SpringChangePasswordTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/spring/spring-ftest/src/test/java/org/jboss/seam/example/spring/test/graphene/SpringChangePasswordTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/spring/spring-ftest/src/test/java/org/jboss/seam/example/spring/test/graphene/SpringChangePasswordTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -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.example.spring.test.graphene;
+
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.example.common.test.booking.graphene.ChangePasswordTest;
+import static org.junit.Assert.*;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * This class tests change password functionality.
+ *
+ * @author jbalunas
+ * @author jharting
+ *
+ */
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class SpringChangePasswordTest extends ChangePasswordTest {
+
+ /**
+ * Verifies that changing password works well. If clean-up part of this
+ * method fails it may affect other methods.
+ */
+ @Test
+ @Override
+ public void changePasswordTest() {
+ String newPassword = "password";
+ changePassword(newPassword, PASSWORD);
+ assertTrue("Password change failed.", isTextOnPage(getProperty("PASSWORD_UPDATED_MESSAGE")));
+ logout();
+ assertTrue("Login failed.", login(USERNAME, newPassword));
+ // cleanup - set default password
+ changePassword(PASSWORD, newPassword);
+ assertTrue("Password change failed.", isTextOnPage(getProperty("PASSWORD_UPDATED_MESSAGE")));
+ logout();
+ assertTrue("Login failed.", login(USERNAME, PASSWORD));
+ }
+
+ @Override
+ public void usingDifferentPasswordsTest() {
+ }
+
+ @Test
+ public void usingIncorrectOldPasswordTest() {
+ changePassword("password", "foobar1");
+ assertTrue("Password verification failed", isTextOnPage(getProperty("PASSWORD_REENTER_MESSAGE")));
+ }
+
+ @Override
+ public void changePassword(String newPassword, String oldpassword) {
+ clickAndWaitHttp(getBy("SETTINGS"));
+ type(getBy("PASSWORD_PASSWORD"), newPassword);
+ type(getBy("PASSWORD_VERIFY"), oldpassword);
+ clickAndWaitHttp(getBy("PASSWORD_SUBMIT"));
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/spring/spring-ftest/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/spring/spring-ftest/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/spring/spring-ftest/src/test/resources/ftest.properties
===================================================================
--- branches/enterprise/WFK-2_1/examples/spring/spring-ftest/src/test/resources/ftest.properties (rev 0)
+++ branches/enterprise/WFK-2_1/examples/spring/spring-ftest/src/test/resources/ftest.properties 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,86 @@
+ #
+ # 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.
+ #
+HOME_PAGE /home.seam
+MAIN_PAGE /main.seam
+PAGE_TITLE JBoss Suites: Seam Framework
+LOGIN_USERNAME_FIELD id=login:username
+LOGIN_PASSWORD_FIELD id=login:password
+LOGIN_SUBMIT id=login:login
+LOGOUT id=logout
+PASSWORD_UPDATED_MESSAGE Password updated
+PASSWORD_REENTER_MESSAGE Re-enter new password
+PASSWORD_VALUE_REQUIRED_MESSAGE xpath=//*[@id='setpassword:Message' or @id='setpassword:PasswordDecorate:Message']
+PASSWORD_LENGTH_MESSAGE size must be between
+PASSWORD_PASSWORD id=setpassword:PasswordDecorate:password
+PASSWORD_VERIFY id=setpassword:VerifyDecorate:verify
+PASSWORD_SUBMIT id=setpassword:change
+SETTINGS id=settings
+SEARCH_STRING_FIELD id=main:searchString
+SEARCH_SUBMIT id=main:findHotels
+NO_HOTELS_FOUND id=NoHotelsFoundMessage
+SEARCH_RESULT_TABLE xpath=//table[@id = 'hotels']/tbody
+SEARCH_RESULT_TABLE_FIRST_ROW_LINK id=hotels:0:viewHotel
+BOOKING_BOOK id=hotel:bookHotel
+BOOKING_CANCEL id=hotel:cancel
+HOTEL_BED_FIELD id=booking:bedsDecorate:beds
+HOTEL_BED_FIELD_SELECT_CRITERIA value=
+HOTEL_CHECKIN_DATE_FIELD id=booking:checkinDateDecorate:checkinDateInputDate
+HOTEL_CHECKIN_DATE_MESSAGE id=booking:Messages
+HOTEL_CHECKOUT_DATE_FIELD id=booking:checkoutDateDecorate:checkoutDateInputDate
+HOTEL_CHECKOUT_DATE_MESSAGE id=booking:Messages
+HOTEL_SMOKING_1 id=booking:smokingDecorate:smoking:0
+HOTEL_SMOKING_2 id=booking:smokingDecorate:smoking:1
+HOTEL_CREDIT_CARD id=booking:creditCardDecorate:creditCard
+HOTEL_CREDIT_CARD_NAME id=booking:creditCardNameDecorate:creditCardName
+HOTEL_PROCEED id=booking:proceed
+HOTEL_CANCEL id=booking:cancel
+HOTEL_CONFIRM id=confirm:confirm
+HOTEL_MESSAGE xpath=//ul[@id='main:messages']/li
+REGISTRATION id=login:register
+REGISTRATION_USERNAME id=register:usernameDecorate:username
+REGISTRATION_USERNAME_MESSAGE id=register:usernameDecorate:message
+REGISTRATION_NAME id=register:nameDecorate:name
+REGISTRATION_NAME_MESSAGE id=register:nameDecorate:message
+REGISTRATION_PASSWORD id=register:passwordDecorate:password
+REGISTRATION_PASSWORD_MESSAGE id=register:passwordDecorate:message
+REGISTRATION_VERIFY id=register:verifyDecorate:verify
+REGISTRATION_VERIFY_MESSAGE id=register:verifyDecorate:message
+REGISTRATION_SUBMIT id=register:register
+REGISTRATION_REENTER_MESSAGE verify
+REGISTRATION_LENGTH_MESSAGE size must be between
+REGISTRATION_SUCCESSFUL_MESSAGE Successfully registered as {0}
+REGISTRATION_USER_EXISTS_MESSAGE Username {0} already exists
+NOT_LOGGED_IN_MESSAGE Please log in first
+CONVERSATION_TIMEOUT_MESSAGE The conversation ended, timed out or was processing another request
+BOOKING_TABLE_ITEM xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text()) \= "{0}"][normalize-space(td[1]/text()) \= "{1}"]
+BOOKING_TABLE_ITEM_LINK xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text()) \= "{0}"][normalize-space(td[1]/text()) \= "{1}"]/td[7]/a
+BOOKING_CANCELLED_MESSAGE Booking cancelled for confirmation number {0}
+BOOKING_CONFIRMATION_MESSAGE Thank you, {0}, your confimation number for {1} is \\d+
+BOOKING_INVALID_DATE_MESSAGE1 Check out date must be later than check in date
+BOOKING_INVALID_DATE_MESSAGE2 Check in date must be a future date
+WORKSPACE_BOOKING_TEXT Book hotel: {0}
+WORKSPACE_VIEW_TEXT View hotel: {0}
+WORKSPACE_TABLE_LINK_BY_ID id=ConversationListForm:ConversationListDataTable:{0}:EntryDescriptionLink
+WORKSPACE_TABLE_ROW_COUNT xpath=//table[@id\='ConversationListForm\:ConversationListDataTable']/tbody/tr
+SPINNER id=main:Spinner
+# ajax not present in spring example - false required
+USE_AJAX_SEARCH FALSE
Modified: branches/enterprise/WFK-2_1/examples/tasks/README.html
===================================================================
--- branches/enterprise/WFK-2_1/examples/tasks/README.html 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/tasks/README.html 2013-09-13 14:11:17 UTC (rev 15588)
@@ -9,27 +9,25 @@
<ol>
<li><p>In the example root directory run:</p>
-<pre><code> mvn clean install
+<pre><code>mvn clean install
</code></pre></li>
<li><p>Set JBOSS_HOME environment property.</p></li>
<li><p>In the tasks-ear directory run:</p>
-<pre><code> mvn jboss-as:deploy
+<pre><code>mvn jboss-as:deploy
</code></pre></li>
<li><p>Open this URL in a web browser: http://localhost:8080/seam-tasks</p></li>
</ol>
-
<h2>Testing the example</h2>
-<p>This example is covered by integration tests. All tests use the following technologies:</p>
+<p>This example is covered by integration and functional tests. All tests use the following technologies:</p>
<ul>
<li><strong>Arquillian</strong> - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,</li>
<li><strong>ShrinkWrap</strong> - to create the test archive (WAR).</li>
</ul>
-
<h3>Integration tests</h3>
<p>Integration tests cover core application logic and reside in the EJB module. In addition to Arquillian and ShrinkWrap, the integration tests also use:</p>
@@ -39,9 +37,8 @@
<li><strong>ShrinkWrap Resolver</strong> - to resolve dependencies of the project for packaging in the test archive.</li>
</ul>
+<p>The tests are executed in Maven's test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-<p>The tests are executed in Maven’s test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-
<pre><code>mvn clean test -Darquillian=jbossas-managed-7
</code></pre>
@@ -52,6 +49,41 @@
<pre><code>mvn clean test -Darquillian=jbossas-remote-7
</code></pre>
+<h3>Functional tests</h3>
+
+<p>Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:</p>
+
+<ul>
+<li><strong>Arquillian Graphene Extension</strong> - an advanced Ajax-capable type-safe Selenium-based browser testing tool,</li>
+<li><strong>Arquillian Drone Extension</strong> - to automatically run and stop browser instances.</li>
+</ul>
+
+<p><em>Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server.</em></p>
+
+<p>Run the functional test on JBoss AS instance with</p>
+
+<pre><code>mvn -f tasks-ftest/pom.xml clean test
+</code></pre>
+
+<p>The <code>JBOSS_HOME</code> environment variable must be set and point to a JBoss AS instance directory.</p>
+
+<p>Several variables can be configured:</p>
+
+<ul>
+<li><p>path to an alternative archive for testing</p>
+
+<pre><code>-DtestDeployment=/path/to/archive.ear
+</code></pre></li>
+<li><p>the browser to use for testing</p>
+
+<pre><code>-DbrowserCapabilities=htmlUnit
+</code></pre></li>
+<li><p>test on a running server</p>
+
+<pre><code>-Dremote
+</code></pre></li>
+</ul>
+
<h2>Testing in JBDS</h2>
<h3>Integration tests</h3>
@@ -60,11 +92,20 @@
<li>Open JBDS and start a configured instance of JBoss AS</li>
<li>Import the example project and its submodules</li>
<li>In the <em>Project Explorer</em>, select the EJB module project, then
-
<ol>
<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and check <code>integration-tests</code> and <code>arq-jbossas-7-remote</code></li>
<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-</li>
+
+<h3>Functional tests</h3>
+
+<ol>
+<li>Open JBDS and start a configured instance of JBoss AS</li>
+<li>Import the <code>ftest</code> project of the example</li>
+<li>In the <em>Project Explorer</em>, select the ftest project, then
+<ol>
+<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and activate <code>arq-jbossas-7-remote</code> profile and deactivate <code>arq-jbossas-7-managed</code> profile</li>
+<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-
Modified: branches/enterprise/WFK-2_1/examples/tasks/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/tasks/README.md 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/tasks/README.md 2013-09-13 14:11:17 UTC (rev 15588)
@@ -24,7 +24,7 @@
Testing the example
-------------------
-This example is covered by integration tests. All tests use the following technologies:
+This example is covered by integration and functional tests. All tests use the following technologies:
* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
* __ShrinkWrap__ - to create the test archive (WAR).
@@ -47,7 +47,35 @@
mvn clean test -Darquillian=jbossas-remote-7
+### Functional tests
+Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:
+
+* __Arquillian Graphene Extension__ - an advanced Ajax-capable type-safe Selenium-based browser testing tool,
+* __Arquillian Drone Extension__ - to automatically run and stop browser instances.
+
+_Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server._
+
+Run the functional test on JBoss AS instance with
+
+ mvn -f tasks-ftest/pom.xml clean test
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+Several variables can be configured:
+
+* path to an alternative archive for testing
+
+ -DtestDeployment=/path/to/archive.ear
+
+* the browser to use for testing
+
+ -DbrowserCapabilities=htmlUnit
+
+* test on a running server
+
+ -Dremote
+
Testing in JBDS
---------------
### Integration tests
@@ -57,3 +85,11 @@
3. In the _Project Explorer_, select the EJB module project, then
1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and check `integration-tests` and `arq-jbossas-7-remote`
2. Right-click the module and select _Run As_ - _JUnit Test_
+
+### Functional tests
+
+1. Open JBDS and start a configured instance of JBoss AS
+2. Import the `ftest` project of the example
+3. In the _Project Explorer_, select the ftest project, then
+ 1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and activate `arq-jbossas-7-remote` profile and deactivate `arq-jbossas-7-managed` profile
+ 2. Right-click the module and select _Run As_ - _JUnit Test_
Added: branches/enterprise/WFK-2_1/examples/tasks/tasks-ftest/pom.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/tasks/tasks-ftest/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/tasks/tasks-ftest/src/test/java/org/jboss/seam/example/tasks/test/graphene/TasksFunctionalTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/tasks/tasks-ftest/src/test/java/org/jboss/seam/example/tasks/test/graphene/TasksFunctionalTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/tasks/tasks-ftest/src/test/java/org/jboss/seam/example/tasks/test/graphene/TasksFunctionalTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,308 @@
+/*
+ * 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.example.tasks.test.graphene;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import static org.jboss.arquillian.graphene.Graphene.*;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.example.common.test.DeploymentResolver;
+import org.jboss.seam.example.common.test.SeamGrapheneTest;
+import org.jboss.shrinkwrap.api.Archive;
+import static org.junit.Assert.*;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.openqa.selenium.By;
+
+/**
+ * This is the base class for Tasks functional tests. Uses jQuery library and
+ * Selenium to match AJAX updates.
+ *
+ * @author kpiwko
+ *
+ */
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class TasksFunctionalTest extends SeamGrapheneTest {
+
+ public static final String LOGIN_URL = "login.seam";
+ public static final String TASKS_URL = "tasks.seam";
+ public static final String LOGIN_USERNAME = "id=login:username";
+ public static final String LOGIN_PASSWORD = "id=login:password";
+ public static final String LOGIN_SUBMIT = "xpath=//input[@value='Login']";
+ public static final String ACTION_BUTTON_FORMATTER = "xpath=//td[contains(., '%s')]/ancestor::tr/descendant::img[@title='%s']";
+ public static final String RESOLVE_BTN_TITLE = "Resolve this task";
+ public static final String EDIT_BTN_TITLE = "Edit this task";
+ public static final String DELETE_BTN_TITLE = "Delete this task";
+ public static final String UNDO_BTN_TITLE = "Undo this task";
+ public static final String DELETE_BTN_CAT_TITLE = "Delete this category";
+ public static final String DEFAULT_USERNAME = "demo";
+ public static final String DEFAULT_PASSWORD = "demo";
+ public static final String TASKS_LINK = "xpath=//a[.='Tasks']";
+ public static final String RESOLVED_LINK = "xpath=//a[.='Resolved tasks']";
+ public static final String CATEGORIES_LINK = "xpath=//a[.='Categories']";
+ public static final String LOGOUT_LINK = "id=menuLogoutId";
+ public static final String EDIT_TASK_DESCRIPTION = "xpath=//form[@id='updateTask']/input[@class='nameField']";
+ public static final String EDIT_TASK_CATEGORY = "xpath=//form[@id='updateTask']/select[@id='editTaskCategory']";
+ public static final String EDIT_TASK_SUBMIT = "xpath=//form[@id='updateTask']/input[@id='update']";
+ public static final String NEW_TASK_DESCRIPTION = "xpath=//form[@id='newTask']/input[@id='editTaskName']";
+ public static final String NEW_TASK_CATEGORY = "xpath=//form[@id='newTask']/select[@id='editTaskCategory']";
+ public static final String NEW_TASK_SUBMIT = "xpath=//form[@id='newTask']/input[@id='editTaskSubmit']";
+ public static final String NEW_CATEGORY_DESCRIPTION = "xpath=//form[@id='newCategoryForm']/input[@id='editCategoryName']";
+ public static final String NEW_CATEGORY_SUBMIT = "xpath=//form[@id='newCategoryForm']/input[@id='editCategorySubmit']";
+ public static final String CATEGORIES_PRESENT = "xpath=//table[@id='categories']/tbody/tr";
+ public static final String TASKS_PRESENT = "xpath=//table[@id='tasks']/tbody/tr";
+
+ @Deployment(testable = false)
+ public static Archive<?> createDeployment() {
+ return DeploymentResolver.createDeployment();
+ }
+
+ @Before
+ @Override
+ public void beforeTest() {
+ // Graphene request guards act strange with HTMLUnit
+ Assume.assumeTrue(isRealBrowser());
+ open(contextPath + LOGIN_URL);
+ type(getBy(LOGIN_USERNAME), DEFAULT_USERNAME);
+ type(getBy(LOGIN_PASSWORD), DEFAULT_PASSWORD);
+ click(getBy(LOGIN_SUBMIT));
+ sleep(2000);// ugly, but need to wait until the table is fully (ajax) loaded
+ waitModel().until(element(getBy(CATEGORIES_PRESENT)).isPresent());
+
+ assertTrue("Navigation failure. Tasks page expected.", browser.getCurrentUrl().contains(TASKS_URL));
+ }
+
+ @Test
+ public void resolveTuringTask() {
+ String turing = "Build the Turing machine";
+ resolveTask(turing);
+ buttonMissing(turing, RESOLVE_BTN_TITLE);
+ click(getBy(RESOLVED_LINK));
+ sleep(2000);// ugly, but need to wait until the table is fully (ajax) loaded
+ waitModel().until(element(getBy(TASKS_PRESENT)).isPresent());
+
+ buttonPresent(turing, UNDO_BTN_TITLE);
+ clickAndWaitHttp(getBy(LOGOUT_LINK));
+ }
+
+ @Test
+ public void deleteMilkTask() {
+ String milk = "Buy milk";
+ deleteTask(milk);
+ buttonMissing(milk, RESOLVE_BTN_TITLE);
+ click(getBy(RESOLVED_LINK));
+ sleep(2000);// ugly, but need to wait until the table is fully (ajax) loaded
+ waitModel().until(element(getBy(TASKS_PRESENT)).isPresent());
+
+ buttonMissing(milk, UNDO_BTN_TITLE);
+ clickAndWaitHttp(getBy(LOGOUT_LINK));
+ }
+
+ @Test
+ public void undoTurtleTask() {
+ String turtle = "Buy a turtle";
+ click(getBy(RESOLVED_LINK));
+ sleep(2000);// ugly, but need to wait until the table is fully (ajax) loaded
+ waitModel().until(element(getBy(TASKS_PRESENT)).isPresent());
+
+ undoTask(turtle);
+ buttonMissing(turtle, UNDO_BTN_TITLE);
+
+ click(getBy(TASKS_LINK));
+ sleep(2000);// ugly, but need to wait until the table is fully (ajax) loaded
+ waitModel().until(element(getBy(CATEGORIES_PRESENT)).isPresent());
+
+ buttonPresent(turtle, RESOLVE_BTN_TITLE);
+ clickAndWaitHttp(getBy(LOGOUT_LINK));
+ }
+
+ @Test
+ public void editTurtleTask() {
+ String turtle = "Buy a turtle";
+ String newCategory = "Work";
+ String newDescription = "Buy a turtle and take it to work";
+ editTask(turtle, newCategory, newDescription);
+ buttonPresent(newDescription, RESOLVE_BTN_TITLE);
+ clickAndWaitHttp(getBy(LOGOUT_LINK));
+ }
+
+ @Test
+ public void createQACategory() {
+ String category = "JBoss QA";
+ click(getBy(CATEGORIES_LINK));
+ sleep(2000);// ugly, but need to wait until the table is fully (ajax) loaded
+ waitModel().until(element(getBy(CATEGORIES_PRESENT)).isPresent());
+
+ newCategory(category);
+ buttonPresent(category, DELETE_BTN_CAT_TITLE);
+ clickAndWaitHttp(getBy(LOGOUT_LINK));
+ }
+
+ @Test
+ public void createSeleniumTask() {
+ String description = "Create selenium ftests for all available examples";
+ newTask("Work", description);
+ buttonPresent(description, RESOLVE_BTN_TITLE);
+ clickAndWaitHttp(getBy(LOGOUT_LINK));
+ }
+
+ @Test
+ public void deleteSchoolCategory() {
+ String category = "School";
+ click(getBy(CATEGORIES_LINK));
+ sleep(2000);// ugly, but need to wait until the table is fully (ajax) loaded
+ waitModel().until(element(getBy(CATEGORIES_PRESENT)).isPresent());
+
+ buttonPress(category, DELETE_BTN_CAT_TITLE);
+ By by = getBy(String.format(ACTION_BUTTON_FORMATTER, category, DELETE_BTN_CAT_TITLE));
+ waitModel().until(element(by).not().isPresent());
+ buttonMissing(category, DELETE_BTN_CAT_TITLE);
+
+ // all tasks from category are deleted as well
+ click(getBy(TASKS_LINK));
+ sleep(2000);// ugly, but need to wait until the table is fully (ajax) loaded
+ buttonMissing("Finish the RESTEasy-Seam integration example", RESOLVE_BTN_TITLE);
+ clickAndWaitHttp(getBy(LOGOUT_LINK));
+ }
+
+ /**
+ * Presses undo button for given task
+ *
+ * @param task The task name
+ */
+ protected void undoTask(String task) {
+ By by = buttonPress(task, UNDO_BTN_TITLE);
+ waitModel().until(element(by).not().isPresent());
+ }
+
+ /**
+ * Presses resolve button for given task
+ *
+ * @param task The task name
+ */
+ protected void resolveTask(String task) {
+ By by = buttonPress(task, RESOLVE_BTN_TITLE);
+ waitModel().until(element(by).not().isPresent());
+ }
+
+ /**
+ * Presses delete button for given task
+ *
+ * @param task The task name
+ */
+ protected void deleteTask(String task) {
+ By by = buttonPress(task, DELETE_BTN_TITLE);
+ waitModel().until(element(by).not().isPresent());
+ }
+
+ /**
+ * Executes arbitrary button task, e.g. delete, undo, resolve
+ *
+ * @param description Name of task or description on which an action is
+ * triggered
+ * @param button Type of action to be triggered - title of the button
+ */
+ protected By buttonPress(String description, String button) {
+ By btn = buttonPresent(description, button);
+ clickAndWaitAjax(btn);
+ return btn;
+ }
+
+ /**
+ * Checks whether button is present on page
+ *
+ * @param description The task/category associated with button
+ * @param button Button type label
+ * @return Button locator
+ */
+ protected By buttonPresent(String description, String button) {
+ String btnStr = String.format(ACTION_BUTTON_FORMATTER, description, button);
+ By btn = getBy(btnStr);
+ waitModel().until(element(btn).isPresent());
+ assertTrue("There should be a '" + button + "' button for: " + description + ".", isElementPresent(btn));
+ return btn;
+ }
+
+ /**
+ * Checks whether button is not present on page
+ *
+ * @param description The task/category associated with button
+ * @param button Button type label
+ * @return Button locator
+ */
+ protected By buttonMissing(String task, String button) {
+ String btnStr = String.format(ACTION_BUTTON_FORMATTER, task, button);
+ By btn = getBy(btnStr);
+ assertFalse("There should NOT be a '" + button + "' button for: " + task + ".", isElementPresent(btn));
+ return btn;
+ }
+
+ /**
+ * Creates new task
+ *
+ * @param category Category of the task
+ * @param description Description of the task
+ */
+ protected void newTask(String category, String description) {
+ selectByValue(getBy(NEW_TASK_CATEGORY), category);
+ type(getBy(NEW_TASK_DESCRIPTION), description);
+ clickAndWaitAjax(getBy(NEW_TASK_SUBMIT));
+ By by = getBy(String.format(ACTION_BUTTON_FORMATTER, description, RESOLVE_BTN_TITLE));
+ waitModel().until(element(by).isPresent());
+
+ }
+
+ /**
+ * Edits task
+ *
+ * @param task Old description of the task
+ * @param newCategory New category
+ * @param newDescription Old description of the task
+ */
+ protected void editTask(String task, String newCategory, String newDescription) {
+ By btn = buttonPresent(task, EDIT_BTN_TITLE);
+ click(btn);
+ selectByValue(getBy(EDIT_TASK_CATEGORY), newCategory);
+ type(getBy(EDIT_TASK_DESCRIPTION), newDescription);
+ clickAndWaitAjax(getBy(EDIT_TASK_SUBMIT));
+
+ By by = getBy(String.format(ACTION_BUTTON_FORMATTER, newDescription, RESOLVE_BTN_TITLE));
+ waitModel().until(element(by).isPresent());
+
+ }
+
+ /**
+ * x
+ * Creates new category
+ *
+ * @param category Category description
+ */
+ protected void newCategory(String category) {
+ type(getBy(NEW_CATEGORY_DESCRIPTION), category);
+ clickAndWaitAjax(getBy(NEW_CATEGORY_SUBMIT));
+ By by = getBy(String.format(ACTION_BUTTON_FORMATTER, category, DELETE_BTN_CAT_TITLE));
+ waitModel().until(element(by).isPresent());
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/tasks/tasks-ftest/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/tasks/tasks-ftest/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/tasks/tasks-ftest/src/test/resources/ftest.properties
===================================================================
--- branches/enterprise/WFK-2_1/examples/tasks/tasks-ftest/src/test/resources/ftest.properties (rev 0)
+++ branches/enterprise/WFK-2_1/examples/tasks/tasks-ftest/src/test/resources/ftest.properties 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,86 @@
+ #
+ # 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.
+ #
+HOME_PAGE /home.seam
+MAIN_PAGE /main.seam
+PAGE_TITLE JBoss Suites: Seam Framework
+LOGIN_USERNAME_FIELD id=login:username
+LOGIN_PASSWORD_FIELD id=login:password
+LOGIN_SUBMIT id=login:login
+LOGOUT id=logout
+PASSWORD_UPDATED_MESSAGE Password updated
+PASSWORD_REENTER_MESSAGE Re-enter new password
+PASSWORD_VALUE_REQUIRED_MESSAGE xpath=//*[@id='setpassword:Message' or @id='setpassword:PasswordDecorate:Message']
+PASSWORD_LENGTH_MESSAGE size must be between
+PASSWORD_PASSWORD id=setpassword:PasswordDecorate:password
+PASSWORD_VERIFY id=setpassword:VerifyDecorate:verify
+PASSWORD_SUBMIT id=setpassword:change
+SETTINGS id=settings
+SEARCH_STRING_FIELD id=main:searchString
+SEARCH_SUBMIT id=main:findHotels
+NO_HOTELS_FOUND id=NoHotelsFoundMessage
+SEARCH_RESULT_TABLE xpath=//table[@id = 'hotels']/tbody
+SEARCH_RESULT_TABLE_FIRST_ROW_LINK id=hotels:0:viewHotel
+BOOKING_BOOK id=hotel:bookHotel
+BOOKING_CANCEL id=hotel:cancel
+HOTEL_BED_FIELD id=booking:bedsDecorate:beds
+HOTEL_BED_FIELD_SELECT_CRITERIA value=
+HOTEL_CHECKIN_DATE_FIELD id=booking:checkinDateDecorate:checkinDateInputDate
+HOTEL_CHECKIN_DATE_MESSAGE id=booking:Messages
+HOTEL_CHECKOUT_DATE_FIELD id=booking:checkoutDateDecorate:checkoutDateInputDate
+HOTEL_CHECKOUT_DATE_MESSAGE id=booking:Messages
+HOTEL_SMOKING_1 id=booking:smokingDecorate:smoking:0
+HOTEL_SMOKING_2 id=booking:smokingDecorate:smoking:1
+HOTEL_CREDIT_CARD id=booking:creditCardDecorate:creditCard
+HOTEL_CREDIT_CARD_NAME id=booking:creditCardNameDecorate:creditCardName
+HOTEL_PROCEED id=booking:proceed
+HOTEL_CANCEL id=booking:cancel
+HOTEL_CONFIRM id=confirm:confirm
+HOTEL_MESSAGE xpath=//ul[@id='main:messages']/li
+REGISTRATION id=login:register
+REGISTRATION_USERNAME id=register:usernameDecorate:username
+REGISTRATION_USERNAME_MESSAGE id=register:usernameDecorate:message
+REGISTRATION_NAME id=register:nameDecorate:name
+REGISTRATION_NAME_MESSAGE id=register:nameDecorate:message
+REGISTRATION_PASSWORD id=register:passwordDecorate:password
+REGISTRATION_PASSWORD_MESSAGE id=register:passwordDecorate:message
+REGISTRATION_VERIFY id=register:verifyDecorate:verify
+REGISTRATION_VERIFY_MESSAGE id=register:verifyDecorate:message
+REGISTRATION_SUBMIT id=register:register
+REGISTRATION_REENTER_MESSAGE verify
+REGISTRATION_LENGTH_MESSAGE size must be between
+REGISTRATION_SUCCESSFUL_MESSAGE Successfully registered as {0}
+REGISTRATION_USER_EXISTS_MESSAGE Username {0} already exists
+NOT_LOGGED_IN_MESSAGE Please log in first
+CONVERSATION_TIMEOUT_MESSAGE The conversation ended, timed out or was processing another request
+BOOKING_TABLE_ITEM xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text()) \= "{0}"][normalize-space(td[1]/text()) \= "{1}"]
+BOOKING_TABLE_ITEM_LINK xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text()) \= "{0}"][normalize-space(td[1]/text()) \= "{1}"]/td[7]/a
+BOOKING_CANCELLED_MESSAGE Booking cancelled for confirmation number {0}
+BOOKING_CONFIRMATION_MESSAGE Thank you, {0}, your confimation number for {1} is \\d+
+BOOKING_INVALID_DATE_MESSAGE1 Check out date must be later than check in date
+BOOKING_INVALID_DATE_MESSAGE2 Check in date must be a future date
+WORKSPACE_BOOKING_TEXT Book hotel: {0}
+WORKSPACE_VIEW_TEXT View hotel: {0}
+WORKSPACE_TABLE_LINK_BY_ID id=ConversationListForm:ConversationListDataTable:{0}:EntryDescriptionLink
+WORKSPACE_TABLE_ROW_COUNT xpath=//table[@id\='ConversationListForm\:ConversationListDataTable']/tbody/tr
+SPINNER id=main:Spinner
+# ajax not present in spring example - false required
+USE_AJAX_SEARCH FALSE
Modified: branches/enterprise/WFK-2_1/examples/ui/README.html
===================================================================
--- branches/enterprise/WFK-2_1/examples/ui/README.html 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/ui/README.html 2013-09-13 14:11:17 UTC (rev 15588)
@@ -1,6 +1,6 @@
<h1>Seam UI Example</h1>
-<p>This is a simple example demonstrating Seam UI.</p>
+<p>This is a simple example demonstrating Seam UI. </p>
<h2>Running the example</h2>
@@ -9,27 +9,25 @@
<ol>
<li><p>In the example root directory run:</p>
-<pre><code> mvn clean install
+<pre><code>mvn clean install
</code></pre></li>
<li><p>Set JBOSS_HOME environment property.</p></li>
<li><p>In the ui-ear directory run:</p>
-<pre><code> mvn jboss-as:deploy
+<pre><code>mvn jboss-as:deploy
</code></pre></li>
<li><p>Open this URL in a web browser: http://localhost:8080/seam-ui</p></li>
</ol>
-
<h2>Testing the example</h2>
-<p>This example is covered by integration tests. All tests use the following technologies:</p>
+<p>This example is covered by integration and functional tests. All tests use the following technologies:</p>
<ul>
<li><strong>Arquillian</strong> - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,</li>
<li><strong>ShrinkWrap</strong> - to create the test archive (WAR).</li>
</ul>
-
<h3>Integration tests</h3>
<p>Integration tests cover core application logic and reside in the EJB module. In addition to Arquillian and ShrinkWrap, the integration tests also use:</p>
@@ -39,9 +37,8 @@
<li><strong>ShrinkWrap Resolver</strong> - to resolve dependencies of the project for packaging in the test archive.</li>
</ul>
+<p>The tests are executed in Maven's test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-<p>The tests are executed in Maven’s test phase. By default they are skipped and can be executed on JBoss AS with:</p>
-
<pre><code>mvn clean test -Darquillian=jbossas-managed-7
</code></pre>
@@ -52,6 +49,41 @@
<pre><code>mvn clean test -Darquillian=jbossas-remote-7
</code></pre>
+<h3>Functional tests</h3>
+
+<p>Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:</p>
+
+<ul>
+<li><strong>Arquillian Graphene Extension</strong> - an advanced Ajax-capable type-safe Selenium-based browser testing tool,</li>
+<li><strong>Arquillian Drone Extension</strong> - to automatically run and stop browser instances.</li>
+</ul>
+
+<p><em>Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server.</em></p>
+
+<p>Run the functional test on JBoss AS instance with</p>
+
+<pre><code>mvn -f ui-ftest/pom.xml clean test
+</code></pre>
+
+<p>The <code>JBOSS_HOME</code> environment variable must be set and point to a JBoss AS instance directory.</p>
+
+<p>Several variables can be configured:</p>
+
+<ul>
+<li><p>path to an alternative archive for testing</p>
+
+<pre><code>-DtestDeployment=/path/to/archive.ear
+</code></pre></li>
+<li><p>the browser to use for testing</p>
+
+<pre><code>-DbrowserCapabilities=htmlUnit
+</code></pre></li>
+<li><p>test on a running server</p>
+
+<pre><code>-Dremote
+</code></pre></li>
+</ul>
+
<h2>Testing in JBDS</h2>
<h3>Integration tests</h3>
@@ -60,11 +92,20 @@
<li>Open JBDS and start a configured instance of JBoss AS</li>
<li>Import the example project and its submodules</li>
<li>In the <em>Project Explorer</em>, select the EJB module project, then
-
<ol>
<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and check <code>integration-tests</code> and <code>arq-jbossas-7-remote</code></li>
<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-</li>
+
+<h3>Functional tests</h3>
+
+<ol>
+<li>Open JBDS and start a configured instance of JBoss AS</li>
+<li>Import the <code>ftest</code> project of the example</li>
+<li>In the <em>Project Explorer</em>, select the ftest project, then
+<ol>
+<li>Type <code>Ctrl+Alt+P</code> (<em>Select Maven Profiles</em>) and activate <code>arq-jbossas-7-remote</code> profile and deactivate <code>arq-jbossas-7-managed</code> profile</li>
+<li>Right-click the module and select <em>Run As</em> - <em>JUnit Test</em></li>
+</ol></li>
</ol>
-
Modified: branches/enterprise/WFK-2_1/examples/ui/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/ui/README.md 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/examples/ui/README.md 2013-09-13 14:11:17 UTC (rev 15588)
@@ -24,7 +24,7 @@
Testing the example
-------------------
-This example is covered by integration tests. All tests use the following technologies:
+This example is covered by integration and functional tests. All tests use the following technologies:
* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
* __ShrinkWrap__ - to create the test archive (WAR).
@@ -47,6 +47,35 @@
mvn clean test -Darquillian=jbossas-remote-7
+### Functional tests
+
+Functional tests are located in a separate project and are not executed during the build of the example. They test the built archive in an application server through browser-testing. They use:
+
+* __Arquillian Graphene Extension__ - an advanced Ajax-capable type-safe Selenium-based browser testing tool,
+* __Arquillian Drone Extension__ - to automatically run and stop browser instances.
+
+_Note: It is necessary to first build and package the example, because the functional test references the built archive for automatic deployment to the server._
+
+Run the functional test on JBoss AS instance with
+
+ mvn -f ui-ftest/pom.xml clean test
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+Several variables can be configured:
+
+* path to an alternative archive for testing
+
+ -DtestDeployment=/path/to/archive.ear
+
+* the browser to use for testing
+
+ -DbrowserCapabilities=htmlUnit
+
+* test on a running server
+
+ -Dremote
+
Testing in JBDS
---------------
### Integration tests
@@ -57,3 +86,10 @@
1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and check `integration-tests` and `arq-jbossas-7-remote`
2. Right-click the module and select _Run As_ - _JUnit Test_
+### Functional tests
+
+1. Open JBDS and start a configured instance of JBoss AS
+2. Import the `ftest` project of the example
+3. In the _Project Explorer_, select the ftest project, then
+ 1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and activate `arq-jbossas-7-remote` profile and deactivate `arq-jbossas-7-managed` profile
+ 2. Right-click the module and select _Run As_ - _JUnit Test_
Added: branches/enterprise/WFK-2_1/examples/ui/ui-ftest/pom.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/ui/ui-ftest/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/java/org/jboss/seam/example/ui/test/graphene/UIFunctionalTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/java/org/jboss/seam/example/ui/test/graphene/UIFunctionalTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/java/org/jboss/seam/example/ui/test/graphene/UIFunctionalTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,194 @@
+/*
+ * 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.example.ui.test.graphene;
+
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import static org.jboss.arquillian.graphene.Graphene.waitModel;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.junit.InSequence;
+import static org.junit.Assert.*;
+import org.junit.Assume;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.openqa.selenium.By;
+
+/**
+ * This class tests functionality of UI example
+ *
+ * @author Martin Gencur
+ *
+ */
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class UIFunctionalTest extends UIFunctionalTestBase {
+
+ /**
+ * Place holder - just verifies that example deploys
+ */
+ @Test
+ @InSequence(1)
+ public void homePageLoadTest() {
+ assertEquals("Unexpected page title.", HOME_PAGE_TITLE, browser.getTitle());
+ }
+
+ @Test
+ @InSequence(2)
+ public void selectItemsTest() {
+ // HTMLUnit has issues with By.xpath("//input[contains(@value,'Peter Muir')]");
+ Assume.assumeTrue(isRealBrowser());
+
+ String title = "Mr.";
+ String name = "Martin Gencur";
+ String continent = "Europe";
+ String age = "24";
+ String pet = "Dog (Needs lots of exercise)";
+ String colour1 = "Green", colour2 = "Yellow";
+ String book = "Pride and Prejudice by Jane Austin (British)";
+ String film = "Blade Runner directed by Ridley Scott";
+ clickAndWaitHttp(SELECT_ITEMS_LINK);
+ selectByText(SELECT_ITEMS_TITLE, title);
+ type(SELECT_ITEMS_NAME, name);
+ selectByText(SELECT_ITEMS_CONTINENT, continent);
+ check(SELECT_ITEMS_USER);
+ check(SELECT_ITEMS_ADMIN);
+ check(SELECT_ITEMS_MANAGER);
+ check(SELECT_ITEMS_SUPERADMIN);
+ selectByText(SELECT_ITEMS_AGE, age);
+ selectByText(SELECT_ITEMS_PET, pet);
+ selectByText(SELECT_ITEMS_COLOURS, colour1);
+ selectByText(SELECT_ITEMS_COLOURS, colour2);
+ selectByText(SELECT_ITEMS_BOOK, book);
+ selectByText(SELECT_ITEMS_FILM, film);
+ clickAndWaitHttp(SELECT_ITEMS_APPLY);
+ check(SELECT_ITEMS_COUNTRY);
+ clickAndWaitHttp(SELECT_ITEMS_APPLY);
+ assertTrue("Page should contain \"Successfully updated\"", isTextInSource("Successfully updated"));
+ }
+
+ @Test
+ @InSequence(3)
+ public void fragmentTest() {
+ clickAndWaitHttp(FRAGMENT_LINK);
+ assertTrue("Page should contain \"fragment is rendered\"", isTextInSource("This fragment is rendered whilst"));
+ }
+
+ @Test
+ @InSequence(4)
+ public void formattedTextTest() {
+ clickAndWaitHttp(FORMATTED_TEXT_LINK);
+ assertTrue("Page should contain information about Pete Muir working all the time on Seam", isTextOnPage("works on Seam, of course"));
+ }
+
+ @Test
+ @InSequence(5)
+ public void buttonAndLinkTest() {
+ clickAndWaitHttp(BUTTON_AND_SLINK_LINK);
+ assertTrue("Page should contain \"A fragment to jump to\"", isTextInSource("A fragment to jump to"));
+ click(JUMP_LINK);
+ waitModel().until().element(JUMP_BUTTON).is().present();
+ click(JUMP_BUTTON);
+ waitModel().until().element(LINK_LINK).is().present();
+ clickAndWaitHttp(LINK_LINK);
+ clickAndWaitHttp(DO_ACTION_LINK);
+ assertTrue("Page should contain \"A simple action was performed\"", isTextInSource("A simple action was performed"));
+ clickAndWaitHttp(DO_ACTION_BUTTON);
+ assertTrue("Page should contain \"A simple action was performed\"", isTextInSource("A simple action was performed"));
+ assertTrue("Page should contain disabled link", isElementPresent(DISABLED_DO_ACTION_LINK));
+ assertTrue("Page should contain disabled button", isElementPresent(DISABLED_DO_ACTION_BUTTON));
+ clickAndWaitHttp(BEGIN_CONVERSATION_LINK);
+ clickAndWaitHttp(END_CONVERSATION_BUTTON);
+ assertFalse("Page shouldn't contain \"A simple action was performed\"", isTextInSource("A simple action was performed"));
+ clickAndWaitHttp(ADD_PARAMETER_LINK);
+ clickAndWaitHttp(ADD_PARAMETER_BUTTON);
+ assertTrue("Page should contain \"Foo = bar\"", isTextInSource("Foo = bar"));
+ }
+
+ @Test
+ @InSequence(6)
+ public void cacheTest() {
+ clickAndWaitHttp(CACHE_LINK);
+ assertTrue("Page should contain some cached text", isTextInSource("Some cached text"));
+ }
+
+ @Test
+ @InSequence(7)
+ public void validateEqualityTest() {
+ String name1 = "martin";
+ String name2 = "peter";
+ String age1 = "20";
+ String age2 = "30";
+ clickAndWaitHttp(VALIDATE_EQUALITY_LINK);
+
+ type(NAME_INPUT, name1);
+ type(NAME_VERIFICATION_INPUT, name1);
+ clickAndWaitHttp(CHECK_NAME_BUTTON);
+ assertTrue("Page should contain \"OK!\"" + " but contains:" + browser.findElement(By.tagName("body")).getText(), isTextInSource("OK!"));
+
+ type(NAME_INPUT, name1);
+ type(NAME_VERIFICATION_INPUT, name2);
+ clickAndWaitHttp(CHECK_NAME_BUTTON);
+ assertTrue("Page should contain \"Must be the same as name!\"", isTextInSource("Must be the same as name!"));
+
+ type(MINIMUM_AGE_INPUT, age1);
+ type(MAXIMUM_AGE_INPUT, age2);
+ clickAndWaitHttp(CHECK_AGES_BUTTON);
+ assertTrue("Page should contain \"OK!\"", isTextInSource("OK!"));
+ type(MINIMUM_AGE_INPUT, age1);
+ type(MAXIMUM_AGE_INPUT, age1);
+ clickAndWaitHttp(CHECK_AGES_BUTTON);
+ assertTrue("Page should contain \"Must be larger than minimum!\"", isTextInSource("Must be larger than minimum!"));
+ type(MINIMUM_AGE_INPUT, age2);
+ type(MAXIMUM_AGE_INPUT, age1);
+ clickAndWaitHttp(CHECK_AGES_BUTTON);
+ assertTrue("Page should contain \"Must be larger than minimum!\"", isTextInSource("Must be larger than minimum!"));
+ }
+
+ @Test
+ @InSequence(8)
+ public void validateEquality2Test() {
+ String date1 = "2009-08-21";
+ String date2 = "2009-08-25";
+ clickAndWaitHttp(VALIDATE_EQUALITY2_LINK);
+
+ type(DATE_INPUT, date1);
+ type(DATE_VERIFICATION_INPUT, date1);
+ clickAndWaitHttp(CHECK_DATE_BUTTON);
+ assertTrue("Page should contain \"OK!\"", isTextInSource("OK!"));
+
+ type(DATE_INPUT, date1);
+ type(DATE_VERIFICATION_INPUT, date2);
+ clickAndWaitHttp(CHECK_DATE_BUTTON);
+ assertTrue("Page should contain \"Value does not equal that in 'date'\"", isTextInSource("Value does not equal"));
+ //assertTrue("Page should contain information about Pete Muir working all the time on Seam", isTextOnPage("works on Seam, of course"));
+ }
+
+ @Test
+ @InSequence(9)
+ public void resourceDownloadTest() {
+ String textToFind1 = "abc";
+ String textToFind2 = "123";
+ clickAndWaitHttp(RESOURCE_DOWNLOAD_LINK);
+
+ assertTrue("File download failed: Restful with s:download \"Text\"", isDownloadWorking("resources.seam?id=1", textToFind1));
+ assertTrue("File download failed: Restful with s:download \"Numbers\"", isDownloadWorking("resources.seam?id=2", textToFind2));
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/java/org/jboss/seam/example/ui/test/graphene/UIFunctionalTestBase.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/java/org/jboss/seam/example/ui/test/graphene/UIFunctionalTestBase.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/java/org/jboss/seam/example/ui/test/graphene/UIFunctionalTestBase.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,117 @@
+/*
+ * 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.example.ui.test.graphene;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.MalformedURLException;
+import java.net.URL;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.seam.example.common.test.DeploymentResolver;
+import org.jboss.seam.example.common.test.SeamGrapheneTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.Before;
+import org.openqa.selenium.By;
+
+/**
+ * Base class for UI functional tests
+ *
+ * @author Martin Gencur
+ *
+ */
+public class UIFunctionalTestBase extends SeamGrapheneTest {
+
+ public static final String HOME_PAGE = "index.seam";
+ public static final String HOME_PAGE_TITLE = "UI Example:";
+ public static final By SELECT_ITEMS_LINK = By.xpath("//a[contains(@href,\"selectItems\")]");
+ public static final By FRAGMENT_LINK = By.xpath("//a[contains(@href,\"fragment\")]");
+ public static final By FORMATTED_TEXT_LINK = By.xpath("//a[contains(@href,\"formattedText\")]");
+ public static final By BUTTON_AND_SLINK_LINK = By.xpath("//a[contains(@href,\"linkAndButton\")]");
+ public static final By CACHE_LINK = By.xpath("//a[contains(@href,\"cache\")]");
+ public static final By VALIDATE_EQUALITY_LINK = By.xpath("//a[contains(@href,\"equalityValidator\")]");
+ public static final By VALIDATE_EQUALITY2_LINK = By.xpath("//a[contains(@href,\"equalityValidatorWConvert\")]");
+ public static final By RESOURCE_DOWNLOAD_LINK = By.xpath("//a[contains(@href,\"resource\")]");
+ public static final By SELECT_ITEMS_TITLE = By.xpath("//select[option[contains(@value,'MR')]]");
+ public static final By SELECT_ITEMS_NAME = By.xpath("//input[contains(@value,'Peter Muir')]");
+ public static final By SELECT_ITEMS_CONTINENT = By.xpath("//select[option[contains(text(),'Europe')]]");
+ public static final By SELECT_ITEMS_USER = By.xpath("//input[@type='checkbox'][@value='USER']");
+ public static final By SELECT_ITEMS_ADMIN = By.xpath("//input[@type='checkbox'][@value='ADMIN']");
+ public static final By SELECT_ITEMS_MANAGER = By.xpath("//input[@type='checkbox'][@value='MANAGER']");
+ public static final By SELECT_ITEMS_SUPERADMIN = By.xpath("//input[@type='checkbox'][@value='SUPERADMIN']");
+ public static final By SELECT_ITEMS_AGE = By.xpath("//select[option[contains(text(),'24')]]");
+ public static final By SELECT_ITEMS_PET = By.xpath("//select[option[contains(@value,'Dog')]]");
+ public static final By SELECT_ITEMS_COLOURS = By.xpath("//select[option[contains(text(),'Green')]]");
+ public static final By SELECT_ITEMS_BOOK = By.xpath("//select[option[contains(text(),'Pride and Prejudice by Jane Austin (British)')]]");
+ public static final By SELECT_ITEMS_FILM = By.xpath("//select[option[contains(text(),'Blade Runner directed by Ridley Scott')]]");
+ public static final By SELECT_ITEMS_APPLY = By.xpath("//input[@type='submit'][@value='Apply']");
+ public static final By SELECT_ITEMS_COUNTRY = By.xpath("//input[@type='radio'][@value='18']");
+ public static final By JUMP_LINK = By.xpath("//a[contains(text(),'Jump')]");
+ public static final By JUMP_BUTTON = By.xpath("//input[@type='button'][@value='Jump']");
+ public static final By LINK_LINK = By.xpath("//a[contains(text(),'Link')]");
+ public static final By DO_ACTION_LINK = By.xpath("//a[contains(text(),'Do action')]");
+ public static final By DO_ACTION_BUTTON = By.xpath("//input[@type='button'][@value='Do action']");
+// DISABLED_DO_ACTION_LINK=xpath=//a[contains(text(),'Do action')][not(@href)]
+// DISABLED_DO_ACTION_BUTTON=xpath=//input[@type='button'][@value='Do action'][@disabled='disabled']
+ public static final By DISABLED_DO_ACTION_LINK = By.xpath("//tr[contains(td[1]/text(), 'Disabled')]/td[2]/a[contains(text(),'Do action')][string-length(@href)=0] ");
+ public static final By DISABLED_DO_ACTION_BUTTON = By.xpath("//tr[contains(td[1]/text(), 'Disabled')]/td[3]/input[@value='Do action'][@type='button']");
+ public static final By BEGIN_CONVERSATION_LINK = By.xpath("//a[contains(text(),'Begin conversation')]");
+ public static final By END_CONVERSATION_BUTTON = By.xpath("//input[@type='button'][@value='End conversation']");
+ public static final By ADD_PARAMETER_LINK = By.xpath("//a[contains(text(),'Add a page parameter')]");
+ public static final By ADD_PARAMETER_BUTTON = By.xpath("//input[@type='button'][@value='Add a page parameter']");
+ public static final By NAME_INPUT = By.xpath("//input[@type='text'][contains(@name,'name')][not(contains(@name,'nameVerification'))]");
+ public static final By NAME_VERIFICATION_INPUT = By.xpath("//input[@type='text'][contains(@name,'nameVerification')]");
+ public static final By CHECK_NAME_BUTTON = By.xpath("//input[@type='submit'][@value='Check name']");
+ public static final By MINIMUM_AGE_INPUT = By.xpath("//input[@type='text'][contains(@name,'min')][not(contains(@name,'minVerification'))]");
+ public static final By MAXIMUM_AGE_INPUT = By.xpath("//input[@type='text'][contains(@name,'minVerification')]");
+ public static final By CHECK_AGES_BUTTON = By.xpath("//input[@type='submit'][@value='Check ages']");
+ public static final By DATE_INPUT = By.xpath("//input[contains(@name,'date')][not(contains(@name,'dateVerification'))]");
+ public static final By DATE_VERIFICATION_INPUT = By.xpath("//input[contains(@name,'dateVerification')]");
+ public static final By CHECK_DATE_BUTTON = By.xpath("//input[@type='submit'][@value='Check date']");
+
+ @Deployment(testable = false)
+ public static Archive<?> createDeployment() {
+ return DeploymentResolver.createDeployment();
+ }
+
+ @Before
+ @Override
+ public void beforeTest() throws MalformedURLException {
+ super.beforeTest();
+ open(contextPath + HOME_PAGE);
+ }
+
+ protected boolean isDownloadWorking(String pathToFile, String textToFind) {
+ try {
+ URL downloadUrl = new URL(contextPath + pathToFile);
+ BufferedReader r = new BufferedReader(new InputStreamReader(downloadUrl.openStream()));
+ String str;
+ StringBuilder sb = new StringBuilder();
+ while ((str = r.readLine()) != null) {
+ sb.append(str);
+ }
+ return sb.toString().contains(textToFind);
+ } catch (IOException e) {
+ return false;
+ }
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/java/org/jboss/seam/example/ui/test/graphene/UIHTMLUnitTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/java/org/jboss/seam/example/ui/test/graphene/UIHTMLUnitTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/java/org/jboss/seam/example/ui/test/graphene/UIHTMLUnitTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,79 @@
+/*
+ * 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.example.ui.test.graphene;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.graphene.Graphene;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.junit.InSequence;
+import static org.junit.Assert.*;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.openqa.selenium.By;
+import org.openqa.selenium.JavascriptExecutor;
+
+/**
+ * This class tests functionality of UI example
+ *
+ * @author Martin Gencur
+ *
+ */
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class UIHTMLUnitTest extends UIFunctionalTestBase {
+
+ public static final By FILE_UPLOAD_FILE = By.xpath("//input[@type='file']");
+ public static final By FILE_UPLOAD_UPDATE = By.xpath("//input[@type='submit'][@value='Update']");
+ public static final By FILE_UPLOAD_RESPONSE = By.xpath("//ul/li[contains(text(),'Successfully updated')]");
+ public static final By FILE_UPLOAD_LINK = By.xpath("//a[contains(@href,'fileUpload')]");
+ public static final String IMAGE_TO_UPLOAD = "photo.jpg";
+ public static final By IMAGE = By.xpath("//img");
+ public static final By GRAPHIC_IMAGE_LINK = By.xpath("//a[contains(@href,'graphicImage')]");
+
+ @Before
+ public void beforeTest() throws MalformedURLException {
+ Assume.assumeTrue(!isRealBrowser());// need htmlunit for the upload
+ browser.navigate().to(contextPath + HOME_PAGE);
+ }
+
+ @Test
+ @InSequence(1)
+ public void fileUploadTest() throws IOException {
+
+ Graphene.guardHttp(browser.findElement(FILE_UPLOAD_LINK)).click();
+ ((JavascriptExecutor) browser).executeScript("document.getElementById(arguments[0]).value = arguments[1]", browser.findElement(FILE_UPLOAD_FILE).getAttribute("id"), IMAGE_TO_UPLOAD);
+
+ Graphene.guardHttp(browser.findElement(FILE_UPLOAD_UPDATE)).click();
+ assertTrue("Page should contain \"Successfully updated\"", Graphene.element(FILE_UPLOAD_RESPONSE).isPresent().apply(browser));
+ }
+
+ @Test
+ @InSequence(2)
+ public void graphicImageTest() throws IOException {
+ Graphene.guardHttp(browser.findElement(GRAPHIC_IMAGE_LINK)).click();
+ assertTrue("Page should contain image of Pete Muir", Graphene.element(IMAGE).isPresent().apply(browser));
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/resources/ftest.properties
===================================================================
--- branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/resources/ftest.properties (rev 0)
+++ branches/enterprise/WFK-2_1/examples/ui/ui-ftest/src/test/resources/ftest.properties 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,86 @@
+ #
+ # 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.
+ #
+HOME_PAGE /home.seam
+MAIN_PAGE /main.seam
+PAGE_TITLE JBoss Suites: Seam Framework
+LOGIN_USERNAME_FIELD id=login:username
+LOGIN_PASSWORD_FIELD id=login:password
+LOGIN_SUBMIT id=login:login
+LOGOUT id=logout
+PASSWORD_UPDATED_MESSAGE Password updated
+PASSWORD_REENTER_MESSAGE Re-enter new password
+PASSWORD_VALUE_REQUIRED_MESSAGE xpath=//*[@id='setpassword:Message' or @id='setpassword:PasswordDecorate:Message']
+PASSWORD_LENGTH_MESSAGE size must be between
+PASSWORD_PASSWORD id=setpassword:PasswordDecorate:password
+PASSWORD_VERIFY id=setpassword:VerifyDecorate:verify
+PASSWORD_SUBMIT id=setpassword:change
+SETTINGS id=settings
+SEARCH_STRING_FIELD id=main:searchString
+SEARCH_SUBMIT id=main:findHotels
+NO_HOTELS_FOUND id=NoHotelsFoundMessage
+SEARCH_RESULT_TABLE xpath=//table[@id = 'hotels']/tbody
+SEARCH_RESULT_TABLE_FIRST_ROW_LINK id=hotels:0:viewHotel
+BOOKING_BOOK id=hotel:bookHotel
+BOOKING_CANCEL id=hotel:cancel
+HOTEL_BED_FIELD id=booking:bedsDecorate:beds
+HOTEL_BED_FIELD_SELECT_CRITERIA value=
+HOTEL_CHECKIN_DATE_FIELD id=booking:checkinDateDecorate:checkinDateInputDate
+HOTEL_CHECKIN_DATE_MESSAGE id=booking:Messages
+HOTEL_CHECKOUT_DATE_FIELD id=booking:checkoutDateDecorate:checkoutDateInputDate
+HOTEL_CHECKOUT_DATE_MESSAGE id=booking:Messages
+HOTEL_SMOKING_1 id=booking:smokingDecorate:smoking:0
+HOTEL_SMOKING_2 id=booking:smokingDecorate:smoking:1
+HOTEL_CREDIT_CARD id=booking:creditCardDecorate:creditCard
+HOTEL_CREDIT_CARD_NAME id=booking:creditCardNameDecorate:creditCardName
+HOTEL_PROCEED id=booking:proceed
+HOTEL_CANCEL id=booking:cancel
+HOTEL_CONFIRM id=confirm:confirm
+HOTEL_MESSAGE xpath=//ul[@id='main:messages']/li
+REGISTRATION id=login:register
+REGISTRATION_USERNAME id=register:usernameDecorate:username
+REGISTRATION_USERNAME_MESSAGE id=register:usernameDecorate:message
+REGISTRATION_NAME id=register:nameDecorate:name
+REGISTRATION_NAME_MESSAGE id=register:nameDecorate:message
+REGISTRATION_PASSWORD id=register:passwordDecorate:password
+REGISTRATION_PASSWORD_MESSAGE id=register:passwordDecorate:message
+REGISTRATION_VERIFY id=register:verifyDecorate:verify
+REGISTRATION_VERIFY_MESSAGE id=register:verifyDecorate:message
+REGISTRATION_SUBMIT id=register:register
+REGISTRATION_REENTER_MESSAGE verify
+REGISTRATION_LENGTH_MESSAGE size must be between
+REGISTRATION_SUCCESSFUL_MESSAGE Successfully registered as {0}
+REGISTRATION_USER_EXISTS_MESSAGE Username {0} already exists
+NOT_LOGGED_IN_MESSAGE Please log in first
+CONVERSATION_TIMEOUT_MESSAGE The conversation ended, timed out or was processing another request
+BOOKING_TABLE_ITEM xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text()) \= "{0}"][normalize-space(td[1]/text()) \= "{1}"]
+BOOKING_TABLE_ITEM_LINK xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text()) \= "{0}"][normalize-space(td[1]/text()) \= "{1}"]/td[7]/a
+BOOKING_CANCELLED_MESSAGE Booking cancelled for confirmation number {0}
+BOOKING_CONFIRMATION_MESSAGE Thank you, {0}, your confimation number for {1} is \\d+
+BOOKING_INVALID_DATE_MESSAGE1 Check out date must be later than check in date
+BOOKING_INVALID_DATE_MESSAGE2 Check in date must be a future date
+WORKSPACE_BOOKING_TEXT Book hotel: {0}
+WORKSPACE_VIEW_TEXT View hotel: {0}
+WORKSPACE_TABLE_LINK_BY_ID id=ConversationListForm:ConversationListDataTable:{0}:EntryDescriptionLink
+WORKSPACE_TABLE_ROW_COUNT xpath=//table[@id\='ConversationListForm\:ConversationListDataTable']/tbody/tr
+SPINNER id=main:Spinner
+# ajax not present in spring example - false required
+USE_AJAX_SEARCH FALSE
Modified: branches/enterprise/WFK-2_1/functional-tests/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/functional-tests/pom.xml 2013-09-06 12:32:37 UTC (rev 15587)
+++ branches/enterprise/WFK-2_1/functional-tests/pom.xml 2013-09-13 14:11:17 UTC (rev 15588)
@@ -1,52 +1,37 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>jboss-seam-parent</artifactId>
- <groupId>org.jboss.seam</groupId>
- <version>2.3.2.Final-redhat-1</version>
- <relativePath>../pom.xml</relativePath>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-parent</artifactId>
+ <version>2.3.2.Final-redhat-1</version>
+ <relativePath>../pom.xml</relativePath>
</parent>
-
- <modelVersion>4.0.0</modelVersion>
+
<artifactId>functional-tests</artifactId>
- <name>Seam Functional Tests</name>
+ <name>Seam Functional Tests Common Classes</name>
+
+ <properties>
+ <version.graphene>2.0.0.Alpha4</version.graphene>
+ </properties>
+
<dependencies>
<dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
</dependency>
+
<dependency>
- <groupId>org.seleniumhq.selenium</groupId>
- <artifactId>selenium-server</artifactId>
- <exclusions>
- <exclusion>
- <artifactId>servlet-api-2.5</artifactId>
- <groupId>org.mortbay.jetty</groupId>
- </exclusion>
- </exclusions>
+ <groupId>org.jboss.arquillian.junit</groupId>
+ <artifactId>arquillian-junit-container</artifactId>
</dependency>
+
<dependency>
- <groupId>org.seleniumhq.selenium</groupId>
- <artifactId>selenium-java</artifactId>
+ <groupId>org.jboss.arquillian.graphene</groupId>
+ <artifactId>graphene-webdriver</artifactId>
+ <version>${version.graphene}</version>
+ <type>pom</type>
</dependency>
+
</dependencies>
- <dependencyManagement>
- <dependencies>
- <!-- Don't want to use version 2.9 -->
- <dependency>
- <groupId>net.sourceforge.htmlunit</groupId>
- <artifactId>htmlunit</artifactId>
- <version>2.8</version>
- </dependency>
- <dependency>
- <groupId>xalan</groupId>
- <artifactId>serializer</artifactId>
- <version>2.7.1-redhat-3</version>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpmime</artifactId>
- <version>4.1.3-redhat-2</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
+
</project>
Added: branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/DeploymentResolver.java
===================================================================
--- branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/DeploymentResolver.java (rev 0)
+++ branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/DeploymentResolver.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,22 @@
+package org.jboss.seam.example.common.test;
+
+import java.io.File;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.importer.ZipImporter;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+
+public class DeploymentResolver {
+
+ public static Archive<?> createDeployment() {
+ String testDeployment = System.getProperty("testDeployment");
+ String deploymentName = testDeployment.substring(testDeployment.lastIndexOf("/") + 1);
+
+ Class<? extends Archive<?>> deploymentClass = deploymentName.endsWith(".war") ? WebArchive.class : EnterpriseArchive.class;
+
+ return ShrinkWrap.create(ZipImporter.class, deploymentName)
+ .importFrom(new File(testDeployment))
+ .as(deploymentClass);
+ }
+}
Added: branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/SeamGrapheneTest.java
===================================================================
--- branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/SeamGrapheneTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/SeamGrapheneTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,256 @@
+/*
+ * 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.example.common.test;
+
+import java.io.BufferedOutputStream;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.text.MessageFormat;
+import java.util.Properties;
+import org.jboss.arquillian.drone.api.annotation.Drone;
+import static org.jboss.arquillian.graphene.Graphene.*;
+import org.jboss.arquillian.test.api.ArquillianResource;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.rules.MethodRule;
+import org.junit.rules.TestWatchman;
+import org.junit.runners.model.FrameworkMethod;
+import org.openqa.selenium.By;
+import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.NotFoundException;
+import org.openqa.selenium.OutputType;
+import org.openqa.selenium.TakesScreenshot;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.ui.Select;
+
+/**
+ * Base class for all Graphene tests of Seam.
+ *
+ * @author jbalunas
+ * @author jharting
+ *
+ */
+public abstract class SeamGrapheneTest {
+
+ @Rule
+ public MethodRule watchman = new TestWatchman() {
+ @Override
+ public void failed(Throwable e, FrameworkMethod method) {
+ BufferedOutputStream bos = null;
+ BufferedWriter bw = null;
+ File testOutput = new File("target/test-output");
+ if (!testOutput.exists()) {
+ testOutput.mkdirs();
+ }
+ try {// HTMLUnit can't maximize a window or take a screenshot
+ browser.manage().window().maximize();
+ //WebDriver augmentedDriver = new Augmenter().augment(browser);
+ byte[] screenshot = ((TakesScreenshot) browser).getScreenshotAs(OutputType.BYTES);
+ //byte[] screenshot = ((TakesScreenshot) browser).getScreenshotAs(OutputType.BYTES);
+ bos = new BufferedOutputStream(new FileOutputStream(testOutput.getAbsolutePath() + "/" + method.getName() + ".png"));
+ bos.write(screenshot);
+ bos.close();
+
+ bw = new BufferedWriter(new FileWriter(testOutput.getAbsolutePath() + "/" + method.getName() + ".html"));
+ bw.write(browser.getPageSource());
+ bw.close();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ } finally {
+ try {
+ bos.close();
+ bw.close();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+ }
+ };
+
+ private static String PROPERTY_FILE = "/ftest.properties";
+ private static boolean propertiesLoaded = false;
+ private static boolean propertiesExist = false;
+ private static Properties properties = new Properties();
+
+ @Drone
+ public WebDriver browser;
+
+ @ArquillianResource
+ protected URL contextPath;
+
+ @Before
+ public void beforeTest() throws MalformedURLException {
+ open(contextPath.toString());
+ }
+
+ public static String getProperty(String key, Object... args) {
+ if (!propertiesLoaded) {
+ try {
+ InputStream is = SeamGrapheneTest.class.getResourceAsStream(PROPERTY_FILE);
+ if (is == null) {
+ propertiesLoaded = true;
+ propertiesExist = false;
+ } else {
+ properties.load(is);
+ propertiesLoaded = true;
+ propertiesExist = true;
+ }
+ } catch (IOException e) {
+ // ?
+ }
+ }
+ String propValue = propertiesExist ? properties.getProperty(key) : null;
+ if (propValue != null && args.length != 0) {
+ return MessageFormat.format(propValue, args);
+ }
+ return propValue;
+ }
+
+ public By getBy(String seleniumLocatorProperty, Object... args) {
+ String seleniumLocator = getProperty(seleniumLocatorProperty);
+ if (seleniumLocator == null) {
+ seleniumLocator = seleniumLocatorProperty;
+ }
+ String locator = seleniumLocator.substring(seleniumLocator.indexOf("=") + 1);
+ if (args.length != 0) {
+ locator = MessageFormat.format(locator, args);
+ }
+ if (seleniumLocator.startsWith("id")) {
+ return By.id(locator);
+ } else if (seleniumLocator.startsWith("xpath")) {
+ return By.xpath(locator);
+ } else if (seleniumLocator.startsWith("css")) {
+ return By.cssSelector(locator);
+ } else if (seleniumLocator.startsWith("link")) {
+ return By.linkText(locator);
+ } else {
+ return null;
+ }
+ }
+
+ public boolean isElementPresent(By by) {
+ try {
+ return browser.findElement(by).isDisplayed();
+ } catch (NotFoundException nfe) {
+ return false;
+ }
+ }
+
+ public String getText(By by) {
+ return browser.findElement(by).getText();
+ }
+
+ public void check(By by) {
+ WebElement checkbox = browser.findElement(by);
+ if (!checkbox.isSelected()) {
+ checkbox.click();
+ }
+ }
+
+ public void click(By by) {
+ browser.findElement(by).click();
+ }
+
+ public void clickAndWaitHttp(By by) {
+ guardHttp(browser.findElement(by)).click();
+ }
+
+ public void clickAndWaitAjax(By by) {
+ guardAjax(browser.findElement(by)).click();
+ }
+
+ public void type(By by, CharSequence text, boolean clear) {
+ WebElement elem = browser.findElement(by);
+ if (clear) {
+ elem.clear();
+ }
+ elem.sendKeys(text);
+ }
+
+ public void type(By by, CharSequence text) {
+ type(by, text, true);
+ }
+
+ public void setTextInputValue(By by, String value) {
+ ((JavascriptExecutor) browser).executeScript("document.getElementById(arguments[0]).value = arguments[1]", browser.findElement(by).getAttribute("id"), value);
+ }
+
+ public boolean isTextInSource(String text) {
+ //return (Boolean) Graphene.element(By.tagName("body")).text().contains(text).apply(browser);
+ return browser.getPageSource().contains(text);
+ }
+
+ public boolean isTextOnPage(String text) {
+ return (Boolean) browser.findElement(By.tagName("body")).getText().contains(text);
+ }
+
+ public void selectByValue(By by, Object value) {
+ new Select(browser.findElement(by)).selectByValue(String.valueOf(value));
+ }
+
+ public void selectByText(By by, Object value) {
+ new Select(browser.findElement(by)).selectByVisibleText(String.valueOf(value));
+ }
+
+ public void openWindow(String url, String name) {
+ ((JavascriptExecutor) browser).executeScript(MessageFormat.format("window.open(\"{0}\", \"{1}\")", url, name));
+ }
+
+ public void selectWindow(String windowNameOrHandle) {
+ selectWindow(windowNameOrHandle, true);
+ }
+
+ public void selectWindow(String windowNameOrHandle, boolean refresh) {
+ browser.switchTo().window(windowNameOrHandle);
+ if (refresh) {
+ browser.navigate().refresh();
+ }
+ }
+
+ public void open(String url) {
+ browser.navigate().to(url);
+ sleep(1000);// the Navigation.to doesn't seem to block as well as it should
+ }
+
+ public int getXpathCount(By by) {
+ return browser.findElements(by).size();
+ }
+
+ public void sleep(int millis) {
+ try {
+ Thread.sleep(millis);
+ } catch (InterruptedException ex) {
+ }
+ }
+
+ public boolean isRealBrowser() {
+ String webDriverClass = browser.getClass().toString().toLowerCase();
+ return !webDriverClass.contains("phantom") && !webDriverClass.contains("htmlunit");
+ }
+}
Added: branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/AjaxTest.java
===================================================================
--- branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/AjaxTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/AjaxTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,51 @@
+/*
+ * 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.example.common.test.booking.graphene;
+
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+/**
+ *
+ * @author jbalunas
+ * @author jharting
+ *
+ */
+
+@Ignore
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class AjaxTest extends BookingFunctionalTestBase {
+
+ @Test
+ public void ajaxSearchFloodTest() {
+ String[] hotels = new String[] { "Marriott Courtyard", "Conrad Miami",
+ "Marriot Downtown", "Ritz Carlton", "NonExistingHotel" };
+ for (int i = 0; i < 30; i++) {
+ for (String hotel : hotels) {
+ enterSearchQuery(hotel);
+ }
+ }
+ }
+}
Added: branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/BackButtonTest.java
===================================================================
--- branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/BackButtonTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/BackButtonTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,107 @@
+/*
+ * 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.example.common.test.booking.graphene;
+
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import static org.junit.Assert.*;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * This tests verifies that the example can cleanly handle backbuttoning in
+ * various situations
+ *
+ * @author jbalunas
+ * @author jharting
+ *
+ */
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class BackButtonTest extends BookingFunctionalTestBase {
+
+ String hotelName = "Mar";
+
+ @Before
+ public void assumeNotHTMLUnit() {
+ Assume.assumeTrue(isRealBrowser());// back button behaviour in htmlunit is not desirable
+ }
+
+ /**
+ * Tries whether backbuttoning after logout is cleanly handled.
+ */
+ @Test
+ public void backbuttoningAfterLogoutTest() {
+ // don't search at this point, avoid POST request to enable back buttoning in Firefox
+ logout();
+ browser.navigate().back();
+ clickAndWaitHttp(getBy("SETTINGS"));
+ // should redirect to home when handling ViewExpiredException and due to not being logged in
+ assertTrue(browser.getCurrentUrl().contains(getProperty("HOME_PAGE")));
+ assertEquals("Backbuttoning failed.", getProperty("PAGE_TITLE"),
+ browser.getTitle());
+ assertTrue("Login message not present", isTextOnPage(getProperty("NOT_LOGGED_IN_MESSAGE")));
+ assertFalse("User is logged in after logout and backbuttoning", isLoggedIn());
+ }
+
+ /**
+ * Tries whether backbuttoning after logout is cleanly handled. Using ajax
+ * functionality after logout.
+ */
+ @Test
+ public void backbuttoningAfterLogoutWithAjaxTest() {
+ // don't search at this point, avoid POST request to enable back buttoning in Firefox
+ logout();
+ browser.navigate().back();
+ click(getBy("SEARCH_SUBMIT"));
+ sleep(5000);
+ // should redirect to home when handling ViewExpiredException and due to not being logged in
+ assertTrue(browser.getCurrentUrl().contains(getProperty("HOME_PAGE")));
+ assertEquals("Backbuttoning failed.", getProperty("PAGE_TITLE"),
+ browser.getTitle());
+ assertTrue("Login message not present", isTextOnPage(getProperty("NOT_LOGGED_IN_MESSAGE")) || isTextOnPage("Session expired, please log in again"));
+ assertFalse("User is logged in after logout and backbuttoning", isLoggedIn());
+ }
+
+ /**
+ * Verifies that backbuttoning after ending conversation is handled cleanly.
+ */
+ @Test
+ public void backbuttoningAfterConversationEndTest() {
+ // start booking
+ enterSearchQuery(hotelName);
+ clickAndWaitHttp(getBy("SEARCH_RESULT_TABLE_FIRST_ROW_LINK"));
+ clickAndWaitHttp(getBy("BOOKING_BOOK"));
+
+ // cancel booking
+ clickAndWaitHttp(getBy("HOTEL_CANCEL"));
+
+ browser.navigate().back();
+ // conditional refresh for firefox, which doesn't reload page after backbuttoning, while HTMLUnit does
+ if (!isTextInSource(getProperty("CONVERSATION_TIMEOUT_MESSAGE"))) {
+ browser.navigate().refresh();
+ }
+ assertTrue("Conversation failure.", isTextInSource(getProperty("CONVERSATION_TIMEOUT_MESSAGE")));
+ }
+}
Added: branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/BookingFunctionalTestBase.java
===================================================================
--- branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/BookingFunctionalTestBase.java (rev 0)
+++ branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/BookingFunctionalTestBase.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,118 @@
+/*
+ * 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.example.common.test.booking.graphene;
+
+import com.google.common.base.Predicate;
+import org.jboss.arquillian.container.test.api.Deployment;
+import static org.jboss.arquillian.graphene.Graphene.*;
+import org.jboss.seam.example.common.test.DeploymentResolver;
+import org.jboss.seam.example.common.test.SeamGrapheneTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.After;
+import static org.junit.Assert.*;
+import org.junit.Before;
+
+/**
+ *
+ * @author jbalunas
+ * @author jharting
+ *
+ */
+public class BookingFunctionalTestBase extends SeamGrapheneTest {
+
+ private final String DEFAULT_USERNAME = "demo";
+ private final String DEFAULT_PASSWORD = "demo";
+
+ @Deployment(testable = false)
+ public static Archive<?> createDeployment() {
+ return DeploymentResolver.createDeployment();
+ }
+
+ @Before
+ public void setUp() {
+ assertTrue("Login failed.", login());
+ }
+
+ @After
+ public void tearDown() {
+ logout();
+ }
+
+ public boolean login() {
+ return login(DEFAULT_USERNAME, DEFAULT_PASSWORD);
+ }
+
+ public boolean login(String username, String password) {
+ if (isLoggedIn()) {
+ fail("User already logged in.");
+ }
+ open(contextPath + getProperty("HOME_PAGE"));
+ if (!browser.getTitle().equals(getProperty("PAGE_TITLE"))) {
+ return false;
+ }
+ type(getBy("LOGIN_USERNAME_FIELD"), username);
+ type(getBy("LOGIN_PASSWORD_FIELD"), password);
+ clickAndWaitHttp(getBy("LOGIN_SUBMIT"));
+ return isLoggedIn();
+ }
+
+ public void logout() {
+ if (isLoggedIn()) {
+ clickAndWaitHttp(getBy("LOGOUT"));
+ }
+ }
+
+ public boolean isLoggedIn() {
+ return isElementPresent(getBy("LOGOUT"));
+ }
+
+ public void enterSearchQuery(String query) {
+ if ("FALSE".equalsIgnoreCase(getProperty("USE_AJAX_SEARCH"))) {
+ enterSearchQueryWithoutAJAX(query);
+ } else {
+ if ("TRUE".equalsIgnoreCase(getProperty("USE_SEARCH_BUTTON"))) {
+ enterSearchQueryUsingAJAX(query, true);
+ } else {
+ enterSearchQueryUsingAJAX(query, false);
+ }
+ }
+ }
+
+ public void enterSearchQueryUsingAJAX(String query, boolean click) {
+ setTextInputValue(getBy("SEARCH_STRING_FIELD"), query.substring(0, query.length() - 1));
+ type(getBy("SEARCH_STRING_FIELD"), query.substring(query.length() - 1), false);
+ if (click) {
+ clickAndWaitAjax(getBy("SEARCH_SUBMIT"));
+ }
+ waitModel(browser).until().element(getBy("SPINNER")).is().not().visible();// ugly
+ waitModel(browser).until(new Predicate() {
+ public boolean apply(Object input) {
+ return isElementPresent(getBy("SEARCH_RESULT_TABLE")) || isElementPresent(getBy("NO_HOTELS_FOUND"));
+ }
+ });
+ }
+
+ public void enterSearchQueryWithoutAJAX(String query) {
+ type(getBy("SEARCH_STRING_FIELD"), query);
+ clickAndWaitHttp(getBy("SEARCH_SUBMIT"));
+ }
+}
Added: branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/ChangePasswordTest.java
===================================================================
--- branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/ChangePasswordTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/ChangePasswordTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -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.
+ */
+package org.jboss.seam.example.common.test.booking.graphene;
+
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import static org.junit.Assert.*;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * This class tests change password functionality.
+ *
+ * @author jbalunas
+ * @author jharting
+ *
+ */
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class ChangePasswordTest extends BookingFunctionalTestBase {
+
+ protected final static String LONG_TEXT = "testertestertest";
+ protected final static String SHORT_TEXT = "tt";
+ // overriding default values
+ protected final String USERNAME = "gavin";
+ protected final String PASSWORD = "foobar";
+
+ @Before
+ @Override
+ public void setUp() {
+ assertTrue("Login failed.", login(USERNAME, PASSWORD));
+ }
+
+ /**
+ * Verifies that changing password works well. If clean-up part of this
+ * method fails it may affect other methods.
+ */
+ @Test
+ public void changePasswordTest() {
+ changePassword("password");
+ assertTrue("Password change failed.", isTextInSource(getProperty("PASSWORD_UPDATED_MESSAGE")));
+ logout();
+ assertTrue("Login failed.", login(USERNAME, "password"));
+ // cleanup - set default password
+ changePassword(PASSWORD);
+ assertTrue("Password change failed.", isTextInSource(getProperty("PASSWORD_UPDATED_MESSAGE")));
+ logout();
+ assertTrue("Login failed.", login(USERNAME, PASSWORD));
+ }
+
+ @Test
+ public void usingDifferentPasswordsTest() {
+ changePassword("password", "password1");
+ assertTrue("Password verification failed", isTextInSource(getProperty("PASSWORD_REENTER_MESSAGE")));
+ }
+
+ @Test
+ public void usingEmptyPasswordsTest() {
+ changePassword("", "");
+ assertEquals("Password validation failed", 2, getXpathCount(getBy("PASSWORD_VALUE_REQUIRED_MESSAGE")));
+ }
+
+ @Test
+ public void usingLongPasswordTest() {
+ changePassword(LONG_TEXT, LONG_TEXT);
+ assertTrue("Password validation failed", isTextInSource(getProperty("PASSWORD_LENGTH_MESSAGE")));
+ }
+
+ @Test
+ public void usingShortPasswordTest() {
+ changePassword(SHORT_TEXT, SHORT_TEXT);
+ assertTrue("Password validation failed", isTextInSource(getProperty("PASSWORD_LENGTH_MESSAGE")));
+ }
+
+ public void changePassword(String newPassword) {
+ changePassword(newPassword, newPassword);
+ }
+
+ public void changePassword(String newPassword, String verify) {
+ clickAndWaitHttp(getBy("SETTINGS"));
+ type(getBy("PASSWORD_PASSWORD"), newPassword);
+ type(getBy("PASSWORD_VERIFY"), verify);
+ clickAndWaitHttp(getBy("PASSWORD_SUBMIT"));
+ }
+}
Added: branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/ConversationTest.java
===================================================================
--- branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/ConversationTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/ConversationTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,107 @@
+/*
+ * 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.example.common.test.booking.graphene;
+
+import java.net.MalformedURLException;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import static org.junit.Assert.*;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+/**
+ *
+ * @author jbalunas
+ * @author jharting
+ *
+ */
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class ConversationTest extends BookingFunctionalTestBase {
+
+ private final String hotel1 = "Hotel Rouge";
+ private final String hotel2 = "Doubletree";
+
+ /**
+ * Opens two windows and tries switching over workspaces to make sure
+ * conversations work properly.
+ */
+
+ @Before
+ @Override
+ public void beforeTest() throws MalformedURLException {
+ Assume.assumeTrue(isRealBrowser());// need window handling
+ super.beforeTest();
+ }
+
+ @Test
+ public void testConversations() {
+
+ // Open two windows
+ openWindow(contextPath + getProperty("MAIN_PAGE"), "1");
+ openWindow(contextPath + getProperty("MAIN_PAGE"), "2");
+
+ // Start booking in window 1
+ selectWindow("1");
+ open(contextPath + getProperty("MAIN_PAGE"));
+
+ if (!isLoggedIn()) {
+ login();
+ }
+ enterSearchQuery(hotel1);
+ clickAndWaitHttp(getBy("SEARCH_RESULT_TABLE_FIRST_ROW_LINK"));
+ clickAndWaitHttp(getBy("BOOKING_BOOK"));
+
+ // Find hotel in window 2
+ selectWindow("2");
+ open(contextPath + getProperty("MAIN_PAGE"));
+ if (!isLoggedIn()) {
+ login();
+ }
+ enterSearchQuery(hotel2);
+ clickAndWaitHttp(getBy("SEARCH_RESULT_TABLE_FIRST_ROW_LINK"));
+
+ // Reload window 1 to check whether both workspaces are displayed
+ selectWindow("1");
+ assertEquals("#1 workspace not present in workspace table",
+ getProperty("WORKSPACE_BOOKING_TEXT", hotel1),
+ getText(getBy("WORKSPACE_TABLE_LINK_BY_ID", 0)));
+ assertEquals("#2 workspace not present in workspace table",
+ getProperty("WORKSPACE_VIEW_TEXT", hotel2),
+ getText(getBy("WORKSPACE_TABLE_LINK_BY_ID", 1)));
+
+ // Switch window 1 to second workspace
+ clickAndWaitHttp(getBy("WORKSPACE_TABLE_LINK_BY_ID", 1));
+
+ // Switch window 1 back to first workspace
+ clickAndWaitHttp(getBy("WORKSPACE_TABLE_LINK_BY_ID", 1));
+
+ // End conversation in window 2
+ selectWindow("2");
+ clickAndWaitHttp(getBy("BOOKING_CANCEL"));
+
+ // Second workspace should disappear
+ selectWindow("1");
+ assertEquals("Workspace failure.", 1, getXpathCount(getBy("WORKSPACE_TABLE_ROW_COUNT")));
+ }
+}
Added: branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/RegistrationTest.java
===================================================================
--- branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/RegistrationTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/RegistrationTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,119 @@
+/*
+ * 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.example.common.test.booking.graphene;
+
+import java.util.Date;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.junit.After;
+import static org.junit.Assert.*;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * This class tests registration
+ *
+ * @author jbalunas
+ * @author jharting
+ */
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class RegistrationTest extends BookingFunctionalTestBase {
+
+ private final String LONG_TEXT = "testertestertest";
+ private final String SHORT_TEXT = "tes";
+ // private final static int USER_COUNT = 3;
+ private String suffix;
+
+ public RegistrationTest() {
+ Date date = new Date();
+ // suffix is needed to allow tests to be run repeatedly
+ suffix = Long.toString(date.getTime() % 10000000);
+ }
+
+ @Before
+ @Override
+ public void setUp() {
+ // do not login
+ }
+
+ @After
+ @Override
+ public void tearDown() {
+ // do not logout
+ }
+
+ @Test
+ public void testVerify() {
+ register("tester", "tester", "password", "password1");
+ //assertTrue("Error message expected.", isElementPresent(getBy("REGISTRATION_VERIFY_MESSAGE")));
+ assertTrue("Password verification failed.", isTextInSource(getProperty("REGISTRATION_REENTER_MESSAGE")));
+ }
+
+ @Test
+ public void testLongText() {
+ register(LONG_TEXT, "tester", "password", "password");
+ assertTrue("Username validation failed.", isTextInSource(getProperty("REGISTRATION_LENGTH_MESSAGE")));
+ }
+
+ @Test
+ public void testShortText() {
+ register(SHORT_TEXT, "tester", "password", "password");
+ assertTrue("Username validation failed.", isTextInSource(getProperty("REGISTRATION_LENGTH_MESSAGE")));
+ }
+
+ @Test
+ public void testDuplicateUser() {
+ String username = "tester" + suffix;
+ register(username, "tester", "password", "password");
+ assertTrue("Navigation after succesful registration failed.", browser.getCurrentUrl().contains(getProperty("HOME_PAGE")));
+ //assertTrue("Registration failed.", isTextOnPage(getProperty("REGISTRATION_SUCCESSFUL_MESSAGE", username)));
+ register(username, "tester", "password", "password");
+ assertTrue("Registered 2 users with the same username.", isTextInSource(
+ getProperty("REGISTRATION_USER_EXISTS_MESSAGE", username)));
+ }
+
+ @Test
+ public void standardRegistrationTest() {
+ String username = "john" + suffix;
+ String name = "John Doe";
+ String password = "password";
+ register(username, name, password, password);
+ assertTrue("Navigation after succesful registration failed.", browser.getCurrentUrl().contains(getProperty("HOME_PAGE")));
+ //assertTrue("Registration failed.", isTextOnPage(getProperty("REGISTRATION_SUCCESSFUL_MESSAGE", username)));
+ // try logging in to verify registration
+ assertTrue("Login failed.", login(username, password));
+ logout();
+ }
+
+ private void register(String username, String name, String password, String verify) {
+ open(contextPath + getProperty("HOME_PAGE"));
+ assertEquals("Unable to load home page.", getProperty("PAGE_TITLE"), browser.getTitle());
+ clickAndWaitHttp(getBy("REGISTRATION"));
+ type(getBy("REGISTRATION_USERNAME"), username);
+ type(getBy("REGISTRATION_NAME"), name);
+ type(getBy("REGISTRATION_PASSWORD"), password);
+ type(getBy("REGISTRATION_VERIFY"), verify);
+ clickAndWaitHttp(getBy("REGISTRATION_SUBMIT"));
+ }
+}
Added: branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/SimpleBookingTest.java
===================================================================
--- branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/SimpleBookingTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/SimpleBookingTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,169 @@
+/*
+ * 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.example.common.test.booking.graphene;
+
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import static org.junit.Assert.*;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.openqa.selenium.JavascriptExecutor;
+
+/**
+ * This class tests booking functionality of the example.
+ *
+ * @author jbalunas
+ * @author jharting
+ *
+ */
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class SimpleBookingTest extends BookingFunctionalTestBase {
+
+ protected final String EXPECTED_NAME = "Demo User";
+ protected final String CREDIT_CARD = "0123456789012345";
+ protected final String CREDIT_CARD_NAME = "visa";
+
+ /**
+ * Tries searching for non existing hotel.
+ */
+ @Test
+ public void invalidSearchStringTest() {
+ enterSearchQuery("NonExistingHotel");
+ assertTrue("Search failed.", isElementPresent(getBy("NO_HOTELS_FOUND")));
+ }
+
+ /**
+ * Simply books hotel.
+ */
+ @Test
+ public void simpleBookingTest() {
+ String hotelName = "W Hotel";
+ int confirmationNumber;
+ confirmationNumber = bookHotel(hotelName);
+ assertTrue("Booking with confirmation number " + confirmationNumber + " not found.",
+ isElementPresent(getBy("BOOKING_TABLE_ITEM", confirmationNumber, hotelName)));
+ }
+
+ /**
+ * Tries booking hotel with incorrect dates.
+ */
+ @Test
+ public void invalidDatesTest() {
+ String hotelName = "W Hotel";
+ enterSearchQuery(hotelName);
+ clickAndWaitHttp(getBy("SEARCH_RESULT_TABLE_FIRST_ROW_LINK"));
+
+ // hotel page
+ clickAndWaitHttp(getBy("BOOKING_BOOK"));
+
+ // booking page
+ String checkOut = browser.findElement(getBy("HOTEL_CHECKOUT_DATE_FIELD")).getAttribute("value");
+ populateBookingFields();
+
+ // switch check in and check out date
+ setTextInputValue(getBy("HOTEL_CHECKIN_DATE_FIELD"), checkOut);
+ clickAndWaitHttp(getBy("HOTEL_PROCEED"));
+ assertTrue("Date verification #1 failed.", isTextInSource(getProperty("BOOKING_INVALID_DATE_MESSAGE1")));
+ assertTrue("Check-out date error message expected.", isElementPresent(getBy("HOTEL_CHECKOUT_DATE_MESSAGE")));
+ // set check in to past
+ setTextInputValue(getBy("HOTEL_CHECKIN_DATE_FIELD"), "01/01/1970");
+ clickAndWaitHttp(getBy("HOTEL_PROCEED"));
+ assertTrue("Date verification #2 failed.", isTextInSource(getProperty("BOOKING_INVALID_DATE_MESSAGE2")));
+ assertTrue("Checkin-date error message expected.", isElementPresent(getBy("HOTEL_CHECKIN_DATE_MESSAGE")));
+ }
+
+ /**
+ * This test verifies that user gets right confirmation number when
+ * canceling order. https://jira.jboss.org/jira/browse/JBSEAM-3288
+ */
+ @Test
+ public void testJBSEAM3288() {
+ String[] hotelNames = new String[]{"Doubletree", "Hotel Rouge", "Conrad Miami"};
+ int[] confirmationNumbers = new int[3];
+ // make 3 bookings
+ for (int i = 0; i < 3; i++) {
+ int confirmationNumber = bookHotel(hotelNames[i]);
+ confirmationNumbers[i] = confirmationNumber;
+ }
+ // assert that there bookings are listed in hotel booking list
+ for (int i = 0; i < 3; i++) {
+ assertTrue("Expected booking #" + i + " not present", isElementPresent(
+ getBy("BOOKING_TABLE_ITEM", confirmationNumbers[i], hotelNames[i])));
+ }
+ // cancel all the reservations
+ for (int i = 2; i >= 0; i--) {
+ clickAndWaitHttp(getBy("BOOKING_TABLE_ITEM_LINK", confirmationNumbers[i], hotelNames[i]));
+ assertTrue("Booking canceling failed", isTextInSource(
+ getProperty("BOOKING_CANCELLED_MESSAGE", confirmationNumbers[i])));
+ }
+
+ }
+
+ protected int bookHotel(String hotelName, int bed, int smoking, String creditCard, String creditCardName) {
+ if (!isLoggedIn()) {
+ fail();
+ }
+ if (!isElementPresent(getBy("SEARCH_SUBMIT"))) {
+ open(contextPath + getProperty("MAIN_PAGE"));
+ }
+ enterSearchQuery(hotelName);
+ clickAndWaitHttp(getBy("SEARCH_RESULT_TABLE_FIRST_ROW_LINK"));
+
+ // booking page
+ clickAndWaitHttp(getBy("BOOKING_BOOK"));
+
+ // hotel page
+ populateBookingFields(bed, smoking, creditCard, creditCardName);
+ clickAndWaitHttp(getBy("HOTEL_PROCEED"));
+
+ // confirm page
+ clickAndWaitHttp(getBy("HOTEL_CONFIRM"));
+
+ // main page
+ String message = getText(getBy("HOTEL_MESSAGE"));
+ assertTrue("Booking failed. Confirmation message does not match.", message.matches(
+ getProperty("BOOKING_CONFIRMATION_MESSAGE", EXPECTED_NAME, hotelName)));
+ String[] messageParts = message.split(" ");
+ int confirmationNumber = Integer.parseInt(messageParts[messageParts.length - 1]);
+ return confirmationNumber;
+ }
+
+ protected int bookHotel(String hotelName) {
+ return bookHotel(hotelName, 2, 0, CREDIT_CARD, CREDIT_CARD_NAME);
+ }
+
+ protected void populateBookingFields(int bed, int smoking, String creditCard, String creditCardName) {
+ selectByValue(getBy("HOTEL_BED_FIELD"), bed);
+ if (smoking == 1) {
+ click(getBy("HOTEL_SMOKING_1"));
+ } else {
+ click(getBy("HOTEL_SMOKING_2"));
+ }
+ type(getBy("HOTEL_CREDIT_CARD"), creditCard);
+ type(getBy("HOTEL_CREDIT_CARD_NAME"), creditCardName);
+ }
+
+ protected void populateBookingFields() {
+ populateBookingFields(2, 0, CREDIT_CARD, CREDIT_CARD_NAME);
+ }
+}
Added: branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/seampay/graphene/SeampayFunctionalTest.java
===================================================================
--- branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/seampay/graphene/SeampayFunctionalTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/functional-tests/src/main/java/org/jboss/seam/example/common/test/seampay/graphene/SeampayFunctionalTest.java 2013-09-13 14:11:17 UTC (rev 15588)
@@ -0,0 +1,126 @@
+/*
+ * 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.example.common.test.seampay.graphene;
+
+import java.math.BigDecimal;
+import java.text.NumberFormat;
+import java.text.ParseException;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.example.common.test.DeploymentResolver;
+import org.jboss.seam.example.common.test.SeamGrapheneTest;
+import org.jboss.shrinkwrap.api.Archive;
+import static org.junit.Assert.*;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.openqa.selenium.By;
+
+/**
+ *
+ * @author jharting
+ *
+ */
+@RunAsClient
+(a)RunWith(Arquillian.class)
+public class SeampayFunctionalTest extends SeamGrapheneTest {
+
+ @Deployment(testable = false)
+ public static Archive<?> createDeployment() {
+ return DeploymentResolver.createDeployment();
+ }
+
+ protected NumberFormat nf = NumberFormat.getNumberInstance();
+
+ @Before
+ @Override
+ public void beforeTest() {
+ open(contextPath + getProperty("MAIN_PAGE"));
+ }
+
+ /**
+ * Submits new payment and asserts that remaining account balance is
+ * correct.
+ *
+ * @throws ParseException
+ */
+ @Test
+ public void payOnceTest() throws ParseException {
+ int account = 0;
+ BigDecimal amount = new BigDecimal(10);
+ String to = "foo";
+
+ clickAndWaitHttp(getBy("ACCOUNT_TABLE_LINK", account));
+ BigDecimal expectedBalance = BigDecimal.valueOf(parseBalance(getText(getBy("ACCOUNT_TABLE_BALANCE", account))));
+ submitPayment(to, amount.toString(), getBy("PAYMENT_ONLY_ONCE_RADIO"));
+ assertTrue("Scheduled payment not confirmed.", isTextInSource(getProperty("PAYMENT_CONFIRMATION_MESSAGE", to)));
+ assertEquals("Invalid count of payments.", 1, getXpathCount(getBy("PAYMENTS_COUNT")));
+ clickAndWaitHttp(getBy("ACCOUNT_TABLE_LINK", account));
+ assertEquals("No money were subtracted from account", expectedBalance.subtract(amount), BigDecimal.valueOf(parseBalance(getText(getBy("ACCOUNT_TABLE_BALANCE", account)))));
+ }
+
+ /**
+ * Submits new payment with one minute interval and verifies the balance
+ * after 60 seconds
+ *
+ * @throws ParseException
+ * @throws InterruptedException
+ */
+ @Test
+ public void payEveryMinuteTest() throws ParseException, InterruptedException {
+ int account = 1;
+ BigDecimal amount = new BigDecimal(10);
+ String to = "foo";
+
+ clickAndWaitHttp(getBy("ACCOUNT_TABLE_LINK", account));
+ // create new payment
+ submitPayment(to, amount.toString(), getBy("PAYMENT_EVERY_MINUTE_RADIO"));
+ assertTrue("Scheduled payment not confirmed.", isTextInSource(getProperty("PAYMENT_CONFIRMATION_MESSAGE", to)));
+ assertEquals("Invalid count of payments.", 1, getXpathCount(getBy("PAYMENTS_COUNT")));
+ // wait
+ Thread.sleep(5000);
+ // get first balance
+ clickAndWaitHttp(getBy("ACCOUNT_TABLE_LINK", account));
+ BigDecimal firstBalance = BigDecimal.valueOf(parseBalance(getText(getBy("ACCOUNT_TABLE_BALANCE", account))));
+ // wait 60 seconds
+ Thread.sleep(60000);
+ // get second balance
+ clickAndWaitHttp(getBy("ACCOUNT_TABLE_LINK", account));
+ BigDecimal secondBalance = BigDecimal.valueOf(parseBalance(getText(getBy("ACCOUNT_TABLE_BALANCE", account))));
+ BigDecimal expectedSecondBalance = firstBalance.subtract(amount);
+ assertEquals("No money were subtracted from account after a minute", expectedSecondBalance, secondBalance);
+ }
+
+ protected void submitPayment(String to, String amount, By radio) {
+ type(getBy("PAYMENT_TO_FIELD"), to);
+ type(getBy("PAYMENT_AMOUNT_FIELD"), amount.toString());
+ click(radio);
+ clickAndWaitHttp(getBy("PAYMENT_SUBMIT"));
+ }
+
+ protected Double parseBalance(String text) throws ParseException {
+ // dirty but can hardly be parsed nicer
+ String number = text.replaceAll("\\$", new String()).replaceAll(" ", new String()).trim();
+ return nf.parse(number).doubleValue();
+ }
+}
11 years, 3 months
[seam2/jboss-seam] 988bf5: Updated READMEs
by GitHub
Branch: refs/heads/Seam_2_3
Home: https://github.com/seam2/jboss-seam
Commit: 988bf59d1300ebde3fca4dac22aebe76399e2a3a
https://github.com/seam2/jboss-seam/commit/988bf59d1300ebde3fca4dac22aebe...
Author: Ron Smeral <rsmeral(a)redhat.com>
Date: 2013-09-12 (Thu, 12 Sep 2013)
Changed paths:
M examples/README.md
M examples/blog/README.md
M examples/booking/README.md
M examples/contactlist/README.md
M examples/excel/README.md
M examples/groovybooking/README.md
M examples/hibernate/README.md
M examples/itext/README.md
M examples/jee6/README.md
M examples/jpa/README.md
M examples/mail/README.md
M examples/messages/README.md
M examples/nestedbooking/README.md
M examples/openid/README.md
M examples/quartz/README.md
M examples/registration/README.md
M examples/remoting/chatroom/README.md
M examples/remoting/helloworld/README.md
M examples/seambay/README.md
M examples/seamdiscs/README.md
M examples/seampay/README.md
M examples/seamspace/README.md
M examples/spring/README.md
M examples/tasks/README.md
M examples/ui/README.md
Log Message:
-----------
Updated READMEs
Commit: 1db4bd370db4b152fd20d2ad5e3de4afc7e84924
https://github.com/seam2/jboss-seam/commit/1db4bd370db4b152fd20d2ad5e3de4...
Author: Ron Smeral <rsmeral(a)redhat.com>
Date: 2013-09-12 (Thu, 12 Sep 2013)
Changed paths:
M examples/README.html
M examples/blog/README.html
M examples/booking/README.html
M examples/contactlist/README.html
M examples/excel/README.html
M examples/groovybooking/README.html
M examples/hibernate/README.html
M examples/itext/README.html
M examples/jee6/README.html
M examples/jpa/README.html
M examples/mail/README.html
M examples/messages/README.html
M examples/nestedbooking/README.html
M examples/openid/README.html
M examples/quartz/README.html
M examples/registration/README.html
M examples/remoting/chatroom/README.html
M examples/remoting/helloworld/README.html
M examples/restbay/README.html
M examples/seambay/README.html
M examples/seamdiscs/README.html
M examples/seampay/README.html
M examples/seamspace/README.html
M examples/spring/README.html
M examples/tasks/README.html
M examples/ui/README.html
Log Message:
-----------
READMEs converted to HTML
Commit: cf5773612f2da545c5d415db26a247ca078518ac
https://github.com/seam2/jboss-seam/commit/cf5773612f2da545c5d415db26a247...
Author: Ron Smeral <rsmeral(a)redhat.com>
Date: 2013-09-12 (Thu, 12 Sep 2013)
Changed paths:
M examples/ui/ui-ftest/pom.xml
Log Message:
-----------
typo
Compare: https://github.com/seam2/jboss-seam/compare/7259f7e86cb8...cf5773612f2d
11 years, 3 months
[seam2/jboss-seam] 9b2c7c: Tests: remove SWR from ftests, not used anymore
by GitHub
Branch: refs/heads/Seam_2_3
Home: https://github.com/seam2/jboss-seam
Commit: 9b2c7c427b7cc20d74853bf5eda8c884857b0f54
https://github.com/seam2/jboss-seam/commit/9b2c7c427b7cc20d74853bf5eda8c8...
Author: Ron Smeral <rsmeral(a)redhat.com>
Date: 2013-09-05 (Thu, 05 Sep 2013)
Changed paths:
M examples/blog/blog-ftest/pom.xml
M examples/booking/booking-ftest/pom.xml
M examples/contactlist/contactlist-ftest/pom.xml
M examples/excel/excel-ftest/pom.xml
M examples/groovybooking/groovybooking-ftest/pom.xml
M examples/hibernate/hibernate-ftest/pom.xml
M examples/itext/itext-ftest/pom.xml
M examples/jee6/jee6-ftest/pom.xml
M examples/jpa/jpa-ftest/pom.xml
M examples/mail/mail-ftest/pom.xml
M examples/messages/messages-ftest/pom.xml
M examples/nestedbooking/nestedbooking-ftest/pom.xml
M examples/openid/openid-ftest/pom.xml
M examples/quartz/quartz-ftest/pom.xml
M examples/registration/registration-ftest/pom.xml
M examples/remoting/chatroom/chatroom-ftest/pom.xml
M examples/remoting/helloworld/helloworld-ftest/pom.xml
M examples/seambay/seambay-ftest/pom.xml
M examples/seamdiscs/seamdiscs-ftest/pom.xml
M examples/seampay/seampay-ftest/pom.xml
M examples/seamspace/seamspace-ftest/pom.xml
M examples/spring/spring-ftest/pom.xml
M examples/tasks/tasks-ftest/pom.xml
M examples/ui/ui-ftest/pom.xml
Log Message:
-----------
Tests: remove SWR from ftests, not used anymore
Commit: 609243f8eb38562d56d13e91e55303fa86a7d953
https://github.com/seam2/jboss-seam/commit/609243f8eb38562d56d13e91e55303...
Author: Ron Smeral <rsmeral(a)redhat.com>
Date: 2013-09-06 (Fri, 06 Sep 2013)
Changed paths:
M examples/blog/pom.xml
M examples/booking/pom.xml
M examples/contactlist/pom.xml
M examples/excel/pom.xml
M examples/groovybooking/pom.xml
M examples/hibernate/pom.xml
M examples/itext/pom.xml
M examples/jee6/pom.xml
M examples/jpa/pom.xml
M examples/mail/pom.xml
M examples/messages/pom.xml
M examples/nestedbooking/pom.xml
M examples/openid/pom.xml
M examples/quartz/pom.xml
M examples/registration/pom.xml
M examples/seambay/pom.xml
M examples/seamdiscs/pom.xml
M examples/seampay/pom.xml
M examples/seamspace/pom.xml
M examples/spring/pom.xml
M examples/tasks/pom.xml
Log Message:
-----------
Tests: removed SWR from example POMs, it is managed in Seam BOM
Commit: 9c295da3ad72d2ec04e7f3e41083f5a8885e59a4
https://github.com/seam2/jboss-seam/commit/9c295da3ad72d2ec04e7f3e41083f5...
Author: Ron Smeral <rsmeral(a)redhat.com>
Date: 2013-09-06 (Fri, 06 Sep 2013)
Changed paths:
M examples/groovybooking/groovybooking-ftest/pom.xml
Log Message:
-----------
Forgotten version in groovybooking-ftest
Commit: 3306ab9709157f70c09d30250548201c5aadf1bd
https://github.com/seam2/jboss-seam/commit/3306ab9709157f70c09d3025054820...
Author: Ron Smeral <rsmeral(a)redhat.com>
Date: 2013-09-06 (Fri, 06 Sep 2013)
Changed paths:
M functional-tests/pom.xml
M functional-tests/src/main/java/org/jboss/seam/example/common/test/SeamGrapheneTest.java
M functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/BookingFunctionalTestBase.java
Log Message:
-----------
Clean up functional-tests module
Compare: https://github.com/seam2/jboss-seam/compare/a3bdc05ae0e9...3306ab970915
11 years, 3 months
Seam SVN: r15587 - branches/enterprise/WFK-2_1/bom.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2013-09-06 08:32:37 -0400 (Fri, 06 Sep 2013)
New Revision: 15587
Modified:
branches/enterprise/WFK-2_1/bom/pom.xml
Log:
updated JDF BOM version and wrong seam version property
Modified: branches/enterprise/WFK-2_1/bom/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/bom/pom.xml 2013-08-21 10:45:55 UTC (rev 15586)
+++ branches/enterprise/WFK-2_1/bom/pom.xml 2013-09-06 12:32:37 UTC (rev 15587)
@@ -32,7 +32,7 @@
<properties>
<!-- Version string properties -->
- <version.seam>2.3.1.Final-redhat-2</version.seam>
+ <version.seam>2.3.2.Final-redhat-1</version.seam>
<version.drools>5.3.0.BRMS</version.drools>
<version.resteasy>2.3.6.Final-redhat-1</version.resteasy>
<version.spring>3.1.4.RELEASE</version.spring>
@@ -41,7 +41,7 @@
<version.infinispan>5.2.6.Final-redhat-1</version.infinispan>
<version.junit>4.10</version.junit>
<version.testng>5.14.10</version.testng>
- <version.org.jboss.bom>1.0.4.Final-redhat-wfk-2</version.org.jboss.bom>
+ <version.org.jboss.bom>1.0.4.Final-redhat-wfk-3</version.org.jboss.bom>
<!-- ***************** -->
<!-- Repository Deployment URLs -->
<!-- ***************** -->
11 years, 3 months
[seam2/jboss-seam] 312758: Tests: DeploymentResolver now uses deployment from...
by GitHub
Branch: refs/heads/Seam_2_3
Home: https://github.com/seam2/jboss-seam
Commit: 312758d89029c57ea47c377fda549a0301fe536b
https://github.com/seam2/jboss-seam/commit/312758d89029c57ea47c377fda549a...
Author: Ron Smeral <rsmeral(a)redhat.com>
Date: 2013-09-03 (Tue, 03 Sep 2013)
Changed paths:
M examples/blog/blog-ftest/src/test/resources/ftest.properties
M examples/booking/booking-ftest/src/test/resources/ftest.properties
M examples/contactlist/contactlist-ftest/src/test/resources/ftest.properties
A examples/excel/excel-ftest/src/test/resources/ftest.properties
M examples/groovybooking/groovybooking-ftest/src/test/resources/ftest.properties
M examples/hibernate/hibernate-ftest/src/test/resources/ftest.properties
A examples/itext/itext-ftest/src/test/resources/ftest.properties
M examples/jee6/jee6-ftest/src/test/resources/ftest.properties
M examples/jpa/jpa-ftest/src/test/resources/ftest.properties
M examples/mail/mail-ftest/src/test/resources/ftest.properties
M examples/messages/messages-ftest/src/test/resources/ftest.properties
M examples/nestedbooking/nestedbooking-ftest/src/test/resources/ftest.properties
M examples/openid/openid-ftest/src/test/resources/ftest.properties
M examples/quartz/quartz-ftest/src/test/resources/ftest.properties
M examples/registration/registration-ftest/src/test/resources/ftest.properties
M examples/remoting/chatroom/chatroom-ftest/src/test/resources/ftest.properties
M examples/remoting/helloworld/helloworld-ftest/src/test/resources/ftest.properties
M examples/seambay/seambay-ftest/src/test/resources/ftest.properties
A examples/seamdiscs/seamdiscs-ftest/src/test/resources/ftest.properties
M examples/seampay/seampay-ftest/src/test/resources/ftest.properties
M examples/seamspace/seamspace-ftest/src/test/resources/ftest.properties
M examples/spring/spring-ftest/src/test/resources/ftest.properties
A examples/tasks/tasks-ftest/src/test/resources/ftest.properties
A examples/ui/ui-ftest/src/test/resources/ftest.properties
M functional-tests/src/main/java/org/jboss/seam/example/common/test/DeploymentResolver.java
Log Message:
-----------
Tests: DeploymentResolver now uses deployment from filesystem
Commit: 719a49b28857eee87c53fb55c9f26227d2ee2390
https://github.com/seam2/jboss-seam/commit/719a49b28857eee87c53fb55c9f262...
Author: Ron Smeral <rsmeral(a)redhat.com>
Date: 2013-09-03 (Tue, 03 Sep 2013)
Changed paths:
M functional-tests/src/main/java/org/jboss/seam/example/common/test/SeamGrapheneTest.java
Log Message:
-----------
Tests: Minor fixes in SeamGrapheneTest
Commit: 8c1e09680dc9e30121efd41afb9c5edd1b41d2ef
https://github.com/seam2/jboss-seam/commit/8c1e09680dc9e30121efd41afb9c5e...
Author: Ron Smeral <rsmeral(a)redhat.com>
Date: 2013-09-03 (Tue, 03 Sep 2013)
Changed paths:
M examples/registration/registration-ftest/src/test/java/org/jboss/seam/example/registration/test/graphene/RegistrationFunctionalTest.java
M examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/BidTest.java
A examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/ComplexBidTest.java
M examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/SeamBayFunctionalTestBase.java
M examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/WebServicesTest.java
M examples/seamdiscs/seamdiscs-ftest/src/test/java/org/jboss/seam/example/seamdiscs/test/graphene/SeamDiscsFunctionalTest.java
M examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/RoleTest.java
M examples/tasks/tasks-ftest/src/test/java/org/jboss/seam/example/tasks/test/graphene/TasksFunctionalTest.java
M examples/ui/ui-ftest/src/test/java/org/jboss/seam/example/ui/test/graphene/UIFunctionalTest.java
M functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/BackButtonTest.java
M functional-tests/src/main/java/org/jboss/seam/example/common/test/booking/graphene/BookingFunctionalTestBase.java
Log Message:
-----------
Tests: various small fixes
Commit: ca0cc27e85a95927a585ec11472337cfd7253087
https://github.com/seam2/jboss-seam/commit/ca0cc27e85a95927a585ec11472337...
Author: Ron Smeral <rsmeral(a)redhat.com>
Date: 2013-09-03 (Tue, 03 Sep 2013)
Changed paths:
M examples/excel/excel-ftest/pom.xml
M examples/jpa/jpa-ftest/pom.xml
M examples/remoting/chatroom/chatroom-ftest/pom.xml
M examples/remoting/helloworld/helloworld-ftest/pom.xml
M examples/spring/spring-ftest/pom.xml
Log Message:
-----------
Tests: errors in group/artifact IDs
Commit: 502fa33f11884010ce89b1bed1d525d2cc83a4fd
https://github.com/seam2/jboss-seam/commit/502fa33f11884010ce89b1bed1d525...
Author: Ron Smeral <rsmeral(a)redhat.com>
Date: 2013-09-04 (Wed, 04 Sep 2013)
Changed paths:
A examples/excel/excel-ftest/src/test/resources/arquillian.xml
A examples/itext/itext-ftest/src/test/resources/arquillian.xml
A examples/messages/messages-ftest/src/test/resources/arquillian.xml
A examples/openid/openid-ftest/src/test/resources/arquillian.xml
A examples/quartz/quartz-ftest/src/test/resources/arquillian.xml
A examples/registration/registration-ftest/src/test/resources/arquillian.xml
A examples/remoting/chatroom/chatroom-ftest/src/test/resources/arquillian.xml
A examples/remoting/helloworld/helloworld-ftest/src/test/resources/arquillian.xml
A examples/seambay/seambay-ftest/src/test/resources/arquillian.xml
A examples/seamdiscs/seamdiscs-ftest/src/test/resources/arquillian.xml
A examples/seampay/seampay-ftest/src/test/resources/arquillian.xml
A examples/seamspace/seamspace-ftest/src/test/resources/arquillian.xml
A examples/tasks/tasks-ftest/src/test/resources/arquillian.xml
A examples/ui/ui-ftest/src/test/resources/arquillian.xml
Log Message:
-----------
Tests: add arquillian.xml where missing
Commit: 29428705cd03f22ee7017ccd9b7f04838fd7fdf9
https://github.com/seam2/jboss-seam/commit/29428705cd03f22ee7017ccd9b7f04...
Author: Ron Smeral <rsmeral(a)redhat.com>
Date: 2013-09-04 (Wed, 04 Sep 2013)
Changed paths:
M examples/blog/blog-ftest/pom.xml
M examples/blog/blog-ftest/src/test/resources/arquillian.xml
M examples/blog/blog-ftest/src/test/resources/ftest.properties
M examples/booking/booking-ftest/pom.xml
M examples/booking/booking-ftest/src/test/resources/arquillian.xml
M examples/booking/booking-ftest/src/test/resources/ftest.properties
M examples/contactlist/contactlist-ftest/pom.xml
M examples/contactlist/contactlist-ftest/src/test/resources/arquillian.xml
M examples/contactlist/contactlist-ftest/src/test/resources/ftest.properties
M examples/excel/excel-ftest/pom.xml
M examples/excel/excel-ftest/src/test/resources/arquillian.xml
R examples/excel/excel-ftest/src/test/resources/ftest.properties
M examples/groovybooking/groovybooking-ftest/pom.xml
M examples/groovybooking/groovybooking-ftest/src/test/resources/arquillian.xml
M examples/groovybooking/groovybooking-ftest/src/test/resources/ftest.properties
M examples/hibernate/hibernate-ftest/pom.xml
M examples/hibernate/hibernate-ftest/src/test/resources/arquillian.xml
M examples/hibernate/hibernate-ftest/src/test/resources/ftest.properties
M examples/itext/itext-ftest/pom.xml
M examples/itext/itext-ftest/src/test/resources/arquillian.xml
R examples/itext/itext-ftest/src/test/resources/ftest.properties
M examples/jee6/jee6-ftest/pom.xml
M examples/jee6/jee6-ftest/src/test/resources/arquillian.xml
M examples/jee6/jee6-ftest/src/test/resources/ftest.properties
M examples/jpa/jpa-ftest/pom.xml
M examples/jpa/jpa-ftest/src/test/resources/arquillian.xml
M examples/jpa/jpa-ftest/src/test/resources/ftest.properties
M examples/mail/mail-ftest/pom.xml
M examples/mail/mail-ftest/src/test/resources/arquillian.xml
M examples/mail/mail-ftest/src/test/resources/ftest.properties
M examples/messages/messages-ftest/pom.xml
M examples/messages/messages-ftest/src/test/resources/arquillian.xml
M examples/messages/messages-ftest/src/test/resources/ftest.properties
M examples/nestedbooking/nestedbooking-ftest/pom.xml
M examples/nestedbooking/nestedbooking-ftest/src/test/resources/arquillian.xml
M examples/nestedbooking/nestedbooking-ftest/src/test/resources/ftest.properties
M examples/openid/openid-ftest/pom.xml
M examples/openid/openid-ftest/src/test/resources/arquillian.xml
M examples/openid/openid-ftest/src/test/resources/ftest.properties
M examples/pom.xml
M examples/quartz/quartz-ftest/pom.xml
M examples/quartz/quartz-ftest/src/test/resources/arquillian.xml
M examples/quartz/quartz-ftest/src/test/resources/ftest.properties
M examples/registration/registration-ftest/pom.xml
M examples/registration/registration-ftest/src/test/resources/arquillian.xml
M examples/registration/registration-ftest/src/test/resources/ftest.properties
M examples/remoting/chatroom/chatroom-ftest/pom.xml
M examples/remoting/chatroom/chatroom-ftest/src/test/resources/arquillian.xml
M examples/remoting/chatroom/chatroom-ftest/src/test/resources/ftest.properties
M examples/remoting/helloworld/helloworld-ftest/pom.xml
M examples/remoting/helloworld/helloworld-ftest/src/test/resources/arquillian.xml
M examples/remoting/helloworld/helloworld-ftest/src/test/resources/ftest.properties
M examples/seambay/seambay-ftest/pom.xml
M examples/seambay/seambay-ftest/src/test/resources/arquillian.xml
M examples/seambay/seambay-ftest/src/test/resources/ftest.properties
M examples/seamdiscs/seamdiscs-ftest/pom.xml
M examples/seamdiscs/seamdiscs-ftest/src/test/resources/arquillian.xml
R examples/seamdiscs/seamdiscs-ftest/src/test/resources/ftest.properties
M examples/seampay/seampay-ftest/pom.xml
M examples/seampay/seampay-ftest/src/test/resources/arquillian.xml
M examples/seampay/seampay-ftest/src/test/resources/ftest.properties
M examples/seamspace/seamspace-ftest/pom.xml
M examples/seamspace/seamspace-ftest/src/test/resources/arquillian.xml
M examples/seamspace/seamspace-ftest/src/test/resources/ftest.properties
M examples/spring/spring-ftest/pom.xml
M examples/spring/spring-ftest/src/test/resources/arquillian.xml
M examples/spring/spring-ftest/src/test/resources/ftest.properties
M examples/tasks/tasks-ftest/pom.xml
M examples/tasks/tasks-ftest/src/test/resources/arquillian.xml
M examples/tasks/tasks-ftest/src/test/resources/ftest.properties
M examples/ui/ui-ftest/pom.xml
M examples/ui/ui-ftest/src/test/resources/arquillian.xml
M examples/ui/ui-ftest/src/test/resources/ftest.properties
M functional-tests/src/main/java/org/jboss/seam/example/common/test/DeploymentResolver.java
Log Message:
-----------
Tests: modified ftest structure
* arquillian.xml simplified
* arquillian.xml needs to be filtered (by maven)
* testDeployment is now a system property
* browserCapabilities is a system property
* examples/pom.xml now has an ftest profile, activated with -Dftest
Commit: a3bdc05ae0e9436aceae3bebc844173c1a9111c8
https://github.com/seam2/jboss-seam/commit/a3bdc05ae0e9436aceae3bebc84417...
Author: Ron Smeral <rsmeral(a)redhat.com>
Date: 2013-09-04 (Wed, 04 Sep 2013)
Changed paths:
M examples/excel/excel-ftest/src/test/java/org/jboss/seam/example/excel/test/graphene/ExcelFunctionalTest.java
M examples/itext/itext-ftest/src/test/java/org/jboss/seam/example/itext/test/graphene/ItextFunctionalTest.java
M examples/messages/messages-ftest/src/test/java/org/jboss/seam/example/messages/test/graphene/MessagesFunctionalTest.java
M examples/openid/openid-ftest/src/test/java/org/jboss/seam/example/openid/test/graphene/OpenIdFunctionalTest.java
M examples/registration/registration-ftest/src/test/java/org/jboss/seam/example/registration/test/graphene/RegistrationFunctionalTest.java
M examples/remoting/chatroom/chatroom-ftest/src/test/java/org/jboss/seam/example/remoting/chatroom/test/graphene/ChatroomFunctionalTest.java
A examples/remoting/helloworld/helloworld-ftest/src/test/java/org/jboss/seam/example/remoting/helloworld/test/graphene/HelloworldFunctionalTest.java
R examples/remoting/helloworld/helloworld-ftest/src/test/java/org/jboss/seam/example/remoting/helloworld/test/graphene/HelloworldTest.java
M examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/ComplexBidTest.java
M examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/SeamBayFunctionalTestBase.java
M examples/seambay/seambay-ftest/src/test/java/org/jboss/seam/example/seambay/test/graphene/WebServicesTest.java
M examples/seamdiscs/seamdiscs-ftest/src/test/java/org/jboss/seam/example/seamdiscs/test/graphene/SeamDiscsFunctionalTestBase.java
M examples/seamspace/seamspace-ftest/src/test/java/org/jboss/seam/example/seamspace/test/graphene/SeamSpaceFunctionalTestBase.java
M examples/tasks/tasks-ftest/src/test/java/org/jboss/seam/example/tasks/test/graphene/TasksFunctionalTest.java
M examples/ui/ui-ftest/src/test/java/org/jboss/seam/example/ui/test/graphene/UIFunctionalTestBase.java
M functional-tests/src/main/java/org/jboss/seam/example/common/test/seampay/graphene/SeampayFunctionalTest.java
Log Message:
-----------
Tests: fix imports
Compare: https://github.com/seam2/jboss-seam/compare/8ad839d5a900...a3bdc05ae0e9
11 years, 3 months
[seam/persistence] ccf73e: Update PersistenceContextsImpl.java
by GitHub
Branch: refs/heads/master
Home: https://github.com/seam/persistence
Commit: ccf73eec01785dfd47459a311a91ce81cd3c1a19
https://github.com/seam/persistence/commit/ccf73eec01785dfd47459a311a91ce...
Author: hernandazevedo <hernand.azevedo(a)gmail.com>
Date: 2013-08-30 (Fri, 30 Aug 2013)
Changed paths:
M impl/src/main/java/org/jboss/seam/persistence/PersistenceContextsImpl.java
Log Message:
-----------
Update PersistenceContextsImpl.java
I´m facing some problems using seam persistence(3.0.0.Final) in clustered tomcat6.
When using session replication throught DeltaManager, the following exception occurs:
org.apache.catalina.ha.session.DeltaManager requestCompleted
SEVERE: Unable to serialize delta request for sessionid [4F3785FD97924B5DD4D948B562F057E2.node2]
java.io.NotSerializableException: org.jboss.seam.persistence.PersistenceContextsImpl$PersistenceContextDefintition
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
I´ve modified the inner class PersistenceContextDefintition removing static and implementing Serializable to solve my problem.
Commit: 89a2d28640ad880af6282e2d50eb8a8e90f37a21
https://github.com/seam/persistence/commit/89a2d28640ad880af6282e2d50eb8a...
Author: Lincoln Baxter, III <lincolnbaxter(a)gmail.com>
Date: 2013-09-02 (Mon, 02 Sep 2013)
Changed paths:
M impl/src/main/java/org/jboss/seam/persistence/PersistenceContextsImpl.java
Log Message:
-----------
Merge pull request #14 from hernandazevedo/patch-1
Update PersistenceContextsImpl.java
Compare: https://github.com/seam/persistence/compare/144ea3912b53...89a2d28640ad
11 years, 3 months