You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2009/12/05 00:27:41 UTC
svn commit: r887449 - in /myfaces/orchestra/trunk/examples: ./
src/main/webapp/ src/main/webapp/WEB-INF/ src/main/webapp/multiBean/
src/main/webapp/simple/ src/test/ src/test/java/ src/test/java/org/
src/test/java/org/apache/ src/test/java/org/apache/m...
Author: lu4242
Date: Fri Dec 4 23:27:40 2009
New Revision: 887449
URL: http://svn.apache.org/viewvc?rev=887449&view=rev
Log:
ORCHESTRA-45 Support for JSF 2.0 (make testing easier)
Added:
myfaces/orchestra/trunk/examples/src/test/
myfaces/orchestra/trunk/examples/src/test/java/
myfaces/orchestra/trunk/examples/src/test/java/org/
myfaces/orchestra/trunk/examples/src/test/java/org/apache/
myfaces/orchestra/trunk/examples/src/test/java/org/apache/myfaces/
myfaces/orchestra/trunk/examples/src/test/java/org/apache/myfaces/orchestra/
myfaces/orchestra/trunk/examples/src/test/java/org/apache/myfaces/orchestra/test/
myfaces/orchestra/trunk/examples/src/test/java/org/apache/myfaces/orchestra/test/ITConstants.java
myfaces/orchestra/trunk/examples/src/test/java/org/apache/myfaces/orchestra/test/it/
myfaces/orchestra/trunk/examples/src/test/java/org/apache/myfaces/orchestra/test/it/HotelReservationBookTest.java
myfaces/orchestra/trunk/examples/src/test/java/org/apache/myfaces/orchestra/test/it/MultiBeanTest.java
myfaces/orchestra/trunk/examples/src/test/java/org/apache/myfaces/orchestra/test/it/WebappTest.java
Modified:
myfaces/orchestra/trunk/examples/ (props changed)
myfaces/orchestra/trunk/examples/pom.xml
myfaces/orchestra/trunk/examples/src/main/webapp/WEB-INF/faces-config.xml
myfaces/orchestra/trunk/examples/src/main/webapp/header.jspf
myfaces/orchestra/trunk/examples/src/main/webapp/multiBean/start.jsp
myfaces/orchestra/trunk/examples/src/main/webapp/simple/reservation.jsp
myfaces/orchestra/trunk/examples/src/main/webapp/simple/reservationBook.jsp
myfaces/orchestra/trunk/examples/src/main/webapp/start.jsp
Propchange: myfaces/orchestra/trunk/examples/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Dec 4 23:27:40 2009
@@ -1,6 +1,7 @@
-target
-maven-eclipse.xml
-.*
*.iml
*.ipr
*.iws
+.*
+derby.log
+maven-eclipse.xml
+target
Modified: myfaces/orchestra/trunk/examples/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/pom.xml?rev=887449&r1=887448&r2=887449&view=diff
==============================================================================
--- myfaces/orchestra/trunk/examples/pom.xml (original)
+++ myfaces/orchestra/trunk/examples/pom.xml Fri Dec 4 23:27:40 2009
@@ -80,14 +80,20 @@
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
- <version>1.1.6</version>
+ <version>${myfaces11.version}</version>
</dependency>
<dependency>
<!-- needed just to run jetty -->
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-impl</artifactId>
- <version>1.1.6</version>
+ <version>${myfaces11.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.tomahawk</groupId>
+ <artifactId>tomahawk-sandbox</artifactId>
+ <version>1.1.9-SNAPSHOT</version>
</dependency>
<dependency>
@@ -136,7 +142,7 @@
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
- <version>1.2.4</version>
+ <version>${myfaces12.version}</version>
<scope>compile</scope>
</dependency>
@@ -144,14 +150,14 @@
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-impl</artifactId>
- <version>1.2.4</version>
+ <version>${myfaces12.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.myfaces.orchestra</groupId>
<artifactId>myfaces-orchestra-flow</artifactId>
- <version>0.0.1-SNAPSHOT</version>
+ <version>${orchestra.flow.version}</version>
</dependency>
</dependencies>
@@ -161,10 +167,46 @@
</properties>
</profile>
+ <profile>
+ <id>myfaces-2.0</id>
+ <activation>
+ <property>
+ <name>jsf</name>
+ <value>20</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-api</artifactId>
+ <version>${myfaces20.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <!-- needed just to run jetty -->
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-impl</artifactId>
+ <version>${myfaces20.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.orchestra</groupId>
+ <artifactId>myfaces-orchestra-flow</artifactId>
+ <version>${orchestra.flow.version}</version>
+ </dependency>
+ </dependencies>
+
+ <properties>
+ <jsf_implementation>MyFaces 2.0</jsf_implementation>
+ </properties>
+ </profile>
+
<!-- To use the examples using Sun Mojarra 1.2 (JSF RI): -Djsf=ri12 -->
<profile>
- <id>jsfri</id>
+ <id>jsfri12</id>
<activation>
<property>
<name>jsf</name>
@@ -175,21 +217,21 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>1.2_09</version>
+ <version>${ri12.version}</version>
</dependency>
<!-- needed just to run jetty -->
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
- <version>1.2_09</version>
+ <version>${ri12.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.myfaces.orchestra</groupId>
<artifactId>myfaces-orchestra-flow</artifactId>
- <version>0.0.1-SNAPSHOT</version>
+ <version>${orchestra.flow.version}</version>
</dependency>
<dependency>
@@ -205,7 +247,7 @@
<repository>
<id>java.net</id>
<name>java.net Maven 1 Repository</name>
- <url>https://maven-repository.dev.java.net/nonav/repository</url>
+ <url>http://download.java.net/maven/1</url>
<layout>legacy</layout>
</repository>
</repositories>
@@ -214,6 +256,58 @@
<jsf_implementation>JSF-RI 1.2</jsf_implementation>
</properties>
</profile>
+
+ <!-- To use the examples using Sun Mojarra 2.0 (JSF RI): -Djsf=ri20 -->
+ <profile>
+ <id>jsfri20</id>
+ <activation>
+ <property>
+ <name>jsf</name>
+ <value>ri20</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>${ri20.version}</version>
+ </dependency>
+
+ <!-- needed just to run jetty -->
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>${ri20.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.orchestra</groupId>
+ <artifactId>myfaces-orchestra-flow</artifactId>
+ <version>${orchestra.flow.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-el_1.0_spec</artifactId>
+ <version>1.0-M1</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <!-- sun stuff is only availiable from maven1 repositories, so add that -->
+ <repositories>
+ <repository>
+ <id>java.net.2</id>
+ <name>java.net Maven 2 Repository</name>
+ <url>http://download.java.net/maven/2</url>
+ </repository>
+ </repositories>
+
+ <properties>
+ <jsf_implementation>JSF-RI 2.0</jsf_implementation>
+ </properties>
+ </profile>
<profile>
<id>orchestra-1.1</id>
@@ -227,7 +321,7 @@
<!-- 1.3 or later needed for flow 0.0.1 -->
<groupId>org.apache.myfaces.orchestra</groupId>
<artifactId>myfaces-orchestra-core</artifactId>
- <version>1.4-SNAPSHOT</version>
+ <version>${orchestra.core.version}</version>
</dependency>
</dependencies>
</profile>
@@ -245,10 +339,206 @@
<!-- 1.3 or later needed for flow 0.0.1 -->
<groupId>org.apache.myfaces.orchestra</groupId>
<artifactId>myfaces-orchestra-core12</artifactId>
- <version>1.4-SNAPSHOT</version>
+ <version>${orchestra.core.version}</version>
+ </dependency>
+ </dependencies>
+ </profile>
+
+ <profile>
+ <id>orchestra-2.0</id>
+ <activation>
+ <property>
+ <name>orchestra</name>
+ <value>20</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <!-- 1.3 or later needed for flow 0.0.1 -->
+ <groupId>org.apache.myfaces.orchestra</groupId>
+ <artifactId>myfaces-orchestra-core20</artifactId>
+ <version>${orchestra.core.version}</version>
</dependency>
</dependencies>
</profile>
+
+ <!-- Profiles for run automated integration tests -->
+
+ <profile>
+ <id>no-webapp-integration-test</id>
+ <activation>
+ <property>
+ <name>!it</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.21</version>
+ <configuration>
+ <connectors>
+ <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <port>9090</port>
+ <maxIdleTime>60000</maxIdleTime>
+ </connector>
+ </connectors>
+ <scanIntervalSeconds>10</scanIntervalSeconds>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>webapp-integration-test</id>
+ <activation>
+ <property>
+ <name>it</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <!-- Include only integration tests so that they are executed during the
+ integration-test phase. Again this this is because of a limitation in
+ Maven 2.0.x which only supports compiling a single test source tree. The
+ recommendation is to create a separate module for functional tests as is done
+ in the cargo-archetype-webapp-functional-test-module -->
+ <excludes>
+ <exclude>none</exclude>
+ </excludes>
+ <includes>
+ <include>**/it/**</include>
+ </includes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <version>${cargo.version}</version>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>jetty6x</id>
+ <activation>
+ <property>
+ <name>it</name>
+ <value>jetty6x</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <!-- Unfortunately if we use this profile we can't control
+ which jetty version we use and the version cargo use has
+ a problem with EL libraries. Instead we call directly jetty.
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <version>${cargo.version}</version>
+ <configuration>
+ <container>
+ <containerId>jetty6x</containerId>
+ <type>embedded</type>
+ </container>
+ </configuration>
+ </plugin> -->
+ <plugin>
+ <!--This plugin allows to run the example using mvn jetty:run -->
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>${maven.jetty.plugin.version}</version>
+ <configuration>
+ <scanIntervalSeconds>10</scanIntervalSeconds>
+ <stopPort>9966</stopPort>
+ <stopKey>foo</stopKey>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-jetty</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <!-- run-exploded allow run annotation
+ code correctly.
+ <goal>run</goal> -->
+ <goal>run-exploded</goal>
+ </goals>
+ <configuration>
+ <daemon>true</daemon>
+ </configuration>
+ </execution>
+ <execution>
+ <id>stop-jetty</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>tomcat6x</id>
+ <activation>
+ <property>
+ <name>it</name>
+ <value>tomcat6x</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <version>${cargo.version}</version>
+ <configuration>
+ <wait>false</wait>
+ <container>
+ <containerId>tomcat6x</containerId>
+ <zipUrlInstaller>
+ <url>
+ http://www.apache.org/dist/tomcat/tomcat-6/v6.0.20/bin/apache-tomcat-6.0.20.zip
+ </url>
+ </zipUrlInstaller>
+ </container>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>stop</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
<dependencies>
@@ -265,10 +555,14 @@
<groupId>org.apache.myfaces.orchestra</groupId>
<artifactId>myfaces-orchestra-sandbox</artifactId>
<version>1.0-SNAPSHOT</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.myfaces.tomahawk</groupId>
+ <artifactId>tomahawk-sandbox</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
-
-
<dependency>
<groupId>org.apache.myfaces.tomahawk</groupId>
<artifactId>tomahawk</artifactId>
@@ -276,12 +570,6 @@
</dependency>
<dependency>
- <groupId>org.apache.myfaces.tomahawk</groupId>
- <artifactId>tomahawk-sandbox</artifactId>
- <version>1.1.9-SNAPSHOT</version>
- </dependency>
-
- <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>2.5.3</version>
@@ -346,6 +634,28 @@
<version>1.1.11</version>
<scope>runtime</scope>
</dependency>
+
+ <!-- Test Dependences -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sourceforge.htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ <version>${htmlunit.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sourceforge.htmlunit</groupId>
+ <artifactId>htmlunit-core-js</artifactId>
+ <version>${htmlunit.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
@@ -368,6 +678,26 @@
</plugin>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <!-- Exclude all integration tests so that they are not executed during the test phase.
+ This is because of a limitation in Maven 2.0.x which only supports compiling a
+ single test source tree. The recommendation is to create a separate module for
+ functional tests as is done in the cargo-archetype-webapp-functional-test-module -->
+ <excludes>
+ <exclude>**/it/**</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.21</version>
+ </plugin>
+
+ <plugin>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
@@ -379,21 +709,6 @@
</executions>
</plugin>
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.21</version>
- <configuration>
- <connectors>
- <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
- <port>9090</port>
- <maxIdleTime>60000</maxIdleTime>
- </connector>
- </connectors>
- <scanIntervalSeconds>10</scanIntervalSeconds>
- </configuration>
- </plugin>
-
<!--
<plugin>
<groupId>org.codehaus.mojo</groupId>
@@ -444,4 +759,17 @@
</plugins>
</reporting>
+
+ <properties>
+ <orchestra.core.version>1.4-SNAPSHOT</orchestra.core.version>
+ <orchestra.flow.version>0.0.1-SNAPSHOT</orchestra.flow.version>
+ <ri12.version>1.2_09</ri12.version>
+ <ri20.version>2.0.2-b10</ri20.version>
+ <myfaces11.version>1.1.6</myfaces11.version>
+ <myfaces12.version>1.2.8</myfaces12.version>
+ <myfaces20.version>2.0.0-SNAPSHOT</myfaces20.version>
+ <maven.jetty.plugin.version>6.1.16</maven.jetty.plugin.version>
+ <cargo.version>1.0</cargo.version>
+ <htmlunit.version>2.5</htmlunit.version>
+ </properties>
</project>
Modified: myfaces/orchestra/trunk/examples/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/webapp/WEB-INF/faces-config.xml?rev=887449&r1=887448&r2=887449&view=diff
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/webapp/WEB-INF/faces-config.xml (original)
+++ myfaces/orchestra/trunk/examples/src/main/webapp/WEB-INF/faces-config.xml Fri Dec 4 23:27:40 2009
@@ -20,9 +20,15 @@
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
- <application>
- <variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
- <navigation-handler>org.apache.myfaces.custom.redirectTracker.RedirectTrackerNavigationHandler</navigation-handler>
+ <application>
+ <variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
+ <navigation-handler>org.apache.myfaces.custom.redirectTracker.RedirectTrackerNavigationHandler</navigation-handler>
+ <locale-config>
+ <default-locale>en</default-locale>
+ <supported-locale>en</supported-locale>
+ <supported-locale>en_US</supported-locale>
+ <supported-locale>de</supported-locale>
+ </locale-config>
</application>
<!--
Modified: myfaces/orchestra/trunk/examples/src/main/webapp/header.jspf
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/webapp/header.jspf?rev=887449&r1=887448&r2=887449&view=diff
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/webapp/header.jspf (original)
+++ myfaces/orchestra/trunk/examples/src/main/webapp/header.jspf Fri Dec 4 23:27:40 2009
@@ -35,7 +35,6 @@
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %>
-<%@ taglib uri="http://myfaces.apache.org/sandbox" prefix="s" %>
<%@ taglib uri="http://myfaces.apache.org/orchestra" prefix="o" %>
<f:verbatim>
Modified: myfaces/orchestra/trunk/examples/src/main/webapp/multiBean/start.jsp
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/webapp/multiBean/start.jsp?rev=887449&r1=887448&r2=887449&view=diff
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/webapp/multiBean/start.jsp (original)
+++ myfaces/orchestra/trunk/examples/src/main/webapp/multiBean/start.jsp Fri Dec 4 23:27:40 2009
@@ -21,7 +21,6 @@
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %>
-<%@ taglib uri="http://myfaces.apache.org/sandbox" prefix="s" %>
<f:view>
<%@include file="../header.jspf"%>
@@ -48,43 +47,55 @@
</p>
</div>
- <h:form>
+ <h:form id="main">
<t:htmlTag value="h3">
<h:outputText value="MultiBean Example" />
</t:htmlTag>
- <h:panelGrid columns="3">
+ <h:panelGrid columns="5">
<h:outputText value="Name"/>
- <h:outputText value="| Conversation" />
- <h:outputText value="| Instance"/>
+ <h:outputText value="|"/>
+ <h:outputText value="Conversation" />
+ <h:outputText value="|"/>
+ <h:outputText value="Instance"/>
<h:outputText/>
+ <h:outputText/>
<h:outputText/>
+ <h:outputText/>
<h:outputText/>
- <h:outputText value="#{multibean1.beanName}"/>
- <h:outputText value=" | #{multibean1.conversationName}" />
- <h:outputText value=" | #{multibean1.instanceId}"/>
-
- <h:outputText value="#{multibean2.beanName}"/>
- <h:outputText value=" | #{multibean2.conversationName}" />
- <h:outputText value=" | #{multibean2.instanceId}"/>
-
- <h:outputText value="#{multibean3.beanName}"/>
- <h:outputText value=" | #{multibean3.conversationName}" />
- <h:outputText value=" | #{multibean3.instanceId}"/>
-
- <h:outputText value="#{multibean4.beanName}"/>
- <h:outputText value=" | #{multibean4.conversationName}" />
- <h:outputText value=" | #{multibean4.instanceId}"/>
+ <h:outputText id="multibean1_beanName" value="#{multibean1.beanName}"/>
+ <h:outputText value="|"/>
+ <h:outputText id="multibean1_conversationName" value="#{multibean1.conversationName}" />
+ <h:outputText value="|"/>
+ <h:outputText id="multibean1_instanceId" value="#{multibean1.instanceId}"/>
+
+ <h:outputText id="multibean2_beanName" value="#{multibean2.beanName}"/>
+ <h:outputText value="|"/>
+ <h:outputText id="multibean2_conversationName" value="#{multibean2.conversationName}" />
+ <h:outputText value="|"/>
+ <h:outputText id="multibean2_instanceId" value="#{multibean2.instanceId}"/>
+
+ <h:outputText id="multibean3_beanName" value="#{multibean3.beanName}"/>
+ <h:outputText value="|"/>
+ <h:outputText id="multibean3_conversationName" value="#{multibean3.conversationName}" />
+ <h:outputText value="|"/>
+ <h:outputText id="multibean3_instanceId" value="#{multibean3.instanceId}"/>
+
+ <h:outputText id="multibean4_beanName" value="#{multibean4.beanName}"/>
+ <h:outputText value="|"/>
+ <h:outputText id="multibean4_conversationName" value="#{multibean4.conversationName}" />
+ <h:outputText value="|"/>
+ <h:outputText id="multibean4_instanceId" value="#{multibean4.instanceId}"/>
</h:panelGrid>
<h:panelGrid columns="2">
- <h:inputText value="#{multibeanController.conversationName}"/>
- <h:commandButton value="Clear Conversation" action="#{multibeanController.clearConversation}" />
+ <h:inputText id="conversationName" value="#{multibeanController.conversationName}"/>
+ <h:commandButton id="clear" value="Clear Conversation" action="#{multibeanController.clearConversation}" />
</h:panelGrid>
- <h:commandButton value="Refresh" action="" />
+ <h:commandButton id="refresh" value="Refresh" action="refresh" />
</h:form>
<%@include file="../footer.jspf"%>
Modified: myfaces/orchestra/trunk/examples/src/main/webapp/simple/reservation.jsp
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/webapp/simple/reservation.jsp?rev=887449&r1=887448&r2=887449&view=diff
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/webapp/simple/reservation.jsp (original)
+++ myfaces/orchestra/trunk/examples/src/main/webapp/simple/reservation.jsp Fri Dec 4 23:27:40 2009
@@ -21,7 +21,6 @@
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
-<%@ taglib uri="http://myfaces.apache.org/sandbox" prefix="s"%>
<f:view>
<%@ include file="/header.jspf"%>
@@ -56,7 +55,7 @@
<h3>Reservation Information</h3>
<h:panelGrid columns="2">
<h:outputText value="Backing Bean instance:"/>
- <h:outputText value="#{reservationView.instanceId}"/>
+ <h:outputText id="instanceId" value="#{reservationView.instanceId}"/>
</h:panelGrid>
<h:panelGrid columns="2">
@@ -72,7 +71,7 @@
<f:validateLongRange minimum="1" maximum="5"/>
</h:inputText>
<h:outputText value="reservation state:"/>
- <h:outputText rendered="#{!reservationView.viewMode}" value="#{reservationView.reservationState}"/>
+ <h:outputText id="status" rendered="#{!reservationView.viewMode}" value="#{reservationView.reservationState}"/>
</h:panelGrid>
<h:commandButton id="check" action="#{reservationView.checkAvailability}" value="Check Availability" rendered="#{!reservationView.viewMode}"/>
Modified: myfaces/orchestra/trunk/examples/src/main/webapp/simple/reservationBook.jsp
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/webapp/simple/reservationBook.jsp?rev=887449&r1=887448&r2=887449&view=diff
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/webapp/simple/reservationBook.jsp (original)
+++ myfaces/orchestra/trunk/examples/src/main/webapp/simple/reservationBook.jsp Fri Dec 4 23:27:40 2009
@@ -21,7 +21,6 @@
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
-<%@ taglib uri="http://myfaces.apache.org/sandbox" prefix="s"%>
<f:view>
<%@ include file="/header.jspf"%>
Modified: myfaces/orchestra/trunk/examples/src/main/webapp/start.jsp
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/webapp/start.jsp?rev=887449&r1=887448&r2=887449&view=diff
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/webapp/start.jsp (original)
+++ myfaces/orchestra/trunk/examples/src/main/webapp/start.jsp Fri Dec 4 23:27:40 2009
@@ -21,7 +21,6 @@
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
-<%@ taglib uri="http://myfaces.apache.org/sandbox" prefix="s"%>
<f:view>
<%@ include file="/header.jspf"%>
Added: myfaces/orchestra/trunk/examples/src/test/java/org/apache/myfaces/orchestra/test/ITConstants.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/test/java/org/apache/myfaces/orchestra/test/ITConstants.java?rev=887449&view=auto
==============================================================================
--- myfaces/orchestra/trunk/examples/src/test/java/org/apache/myfaces/orchestra/test/ITConstants.java (added)
+++ myfaces/orchestra/trunk/examples/src/test/java/org/apache/myfaces/orchestra/test/ITConstants.java Fri Dec 4 23:27:40 2009
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+package org.apache.myfaces.orchestra.test;
+
+public interface ITConstants
+{
+ public static final String APP_URL = "http://localhost:8080/myfaces-orchestra-examples-project";
+}
Added: myfaces/orchestra/trunk/examples/src/test/java/org/apache/myfaces/orchestra/test/it/HotelReservationBookTest.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/test/java/org/apache/myfaces/orchestra/test/it/HotelReservationBookTest.java?rev=887449&view=auto
==============================================================================
--- myfaces/orchestra/trunk/examples/src/test/java/org/apache/myfaces/orchestra/test/it/HotelReservationBookTest.java (added)
+++ myfaces/orchestra/trunk/examples/src/test/java/org/apache/myfaces/orchestra/test/it/HotelReservationBookTest.java Fri Dec 4 23:27:40 2009
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+package org.apache.myfaces.orchestra.test.it;
+
+import junit.framework.TestCase;
+
+import org.apache.myfaces.orchestra.test.ITConstants;
+
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlForm;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
+import com.gargoylesoftware.htmlunit.html.HtmlTextInput;
+
+/**
+ * Simple webapp test integration test demo
+ */
+public class HotelReservationBookTest extends TestCase
+{
+
+ public void testSimpleReservation() throws Exception
+ {
+ WebClient webClient = new WebClient();
+
+ HtmlPage reservationBook = (HtmlPage) webClient.getPage(ITConstants.APP_URL+"/simple/reservationBook.faces");
+ HtmlForm form = reservationBook.getFormByName("main");
+ HtmlSubmitInput button1 = (HtmlSubmitInput) form.getInputByName("main:new");
+ HtmlPage reservation = (HtmlPage) button1.click();
+
+ assertEquals("Save",reservation.getElementById("main:save").getAttribute("value"));
+
+ HtmlForm form1 = reservation.getFormByName("main");
+ HtmlTextInput name = (HtmlTextInput) form1.getInputByName("main:name");
+ name.setValueAttribute("Jack Sparrow");
+ HtmlTextInput start = (HtmlTextInput) form1.getInputByName("main:start");
+ start.setValueAttribute("06-Oct-2009");
+ HtmlTextInput days = (HtmlTextInput) form1.getInputByName("main:days");
+ days.setValueAttribute("2");
+ HtmlSubmitInput button2 = (HtmlSubmitInput) form1.getInputByName("main:check");
+ HtmlElement instanceId1 = form1.getElementById("main:instanceId");
+
+
+ HtmlPage reservation2 = (HtmlPage) button2.click();
+ HtmlForm form2 = reservation2.getFormByName("main");
+ name = (HtmlTextInput) form2.getInputByName("main:name");
+ HtmlElement instanceId2 = form2.getElementById("main:instanceId");
+ HtmlElement status = form2.getElementById("main:status");
+ //Assert the value is on the field
+ assertEquals("Jack Sparrow", name.getValueAttribute());
+ assertEquals("Available", status.getTextContent());
+ assertEquals(instanceId1.getTextContent(), instanceId2.getTextContent());
+
+ HtmlSubmitInput button3 = (HtmlSubmitInput) form2.getInputByName("main:save");
+ HtmlPage reservation3 = (HtmlPage) button3.click();
+ HtmlForm form3 = reservation3.getFormByName("main");
+
+ assertTrue(form3.asText().contains("Jack Sparrow"));
+ }
+
+}
Added: myfaces/orchestra/trunk/examples/src/test/java/org/apache/myfaces/orchestra/test/it/MultiBeanTest.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/test/java/org/apache/myfaces/orchestra/test/it/MultiBeanTest.java?rev=887449&view=auto
==============================================================================
--- myfaces/orchestra/trunk/examples/src/test/java/org/apache/myfaces/orchestra/test/it/MultiBeanTest.java (added)
+++ myfaces/orchestra/trunk/examples/src/test/java/org/apache/myfaces/orchestra/test/it/MultiBeanTest.java Fri Dec 4 23:27:40 2009
@@ -0,0 +1,167 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+package org.apache.myfaces.orchestra.test.it;
+
+import junit.framework.TestCase;
+
+import org.apache.myfaces.orchestra.test.ITConstants;
+
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlForm;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
+import com.gargoylesoftware.htmlunit.html.HtmlTextInput;
+
+public class MultiBeanTest extends TestCase
+{
+ public void testRefreshReservation() throws Exception
+ {
+ WebClient webClient = new WebClient();
+
+ HtmlPage multiBean0 = (HtmlPage) webClient.getPage(ITConstants.APP_URL+"/multiBean/start.faces");
+ HtmlForm form0 = multiBean0.getFormByName("main");
+ HtmlSubmitInput button0 = (HtmlSubmitInput) form0.getInputByName("main:refresh");
+
+ HtmlPage multiBean1 = (HtmlPage) button0.click();
+
+ HtmlForm form1 = multiBean1.getFormByName("main");
+
+ HtmlElement multibean1_beanName1 = form1.getElementById("main:multibean1_beanName");
+ HtmlElement multibean1_conversationName1 = form1.getElementById("main:multibean1_conversationName");
+ HtmlElement multibean1_instanceId1 = form1.getElementById("main:multibean1_instanceId");
+
+ HtmlElement multibean2_beanName1 = form1.getElementById("main:multibean2_beanName");
+ HtmlElement multibean2_conversationName1 = form1.getElementById("main:multibean2_conversationName");
+ HtmlElement multibean2_instanceId1 = form1.getElementById("main:multibean2_instanceId");
+
+ HtmlElement multibean3_beanName1 = form1.getElementById("main:multibean3_beanName");
+ HtmlElement multibean3_conversationName1 = form1.getElementById("main:multibean3_conversationName");
+ HtmlElement multibean3_instanceId1 = form1.getElementById("main:multibean3_instanceId");
+
+ HtmlElement multibean4_beanName1 = form1.getElementById("main:multibean4_beanName");
+ HtmlElement multibean4_conversationName1 = form1.getElementById("main:multibean4_conversationName");
+ HtmlElement multibean4_instanceId1 = form1.getElementById("main:multibean4_instanceId");
+
+ HtmlSubmitInput button1 = (HtmlSubmitInput) form1.getInputByName("main:refresh");
+
+ HtmlPage multiBean2 = (HtmlPage) button1.click();
+
+ HtmlForm form2 = multiBean2.getFormByName("main");
+
+ HtmlElement multibean1_beanName2 = form2.getElementById("main:multibean1_beanName");
+ HtmlElement multibean1_conversationName2 = form2.getElementById("main:multibean1_conversationName");
+ HtmlElement multibean1_instanceId2 = form2.getElementById("main:multibean1_instanceId");
+
+ HtmlElement multibean2_beanName2 = form2.getElementById("main:multibean2_beanName");
+ HtmlElement multibean2_conversationName2 = form2.getElementById("main:multibean2_conversationName");
+ HtmlElement multibean2_instanceId2 = form2.getElementById("main:multibean2_instanceId");
+
+ HtmlElement multibean3_beanName2 = form2.getElementById("main:multibean3_beanName");
+ HtmlElement multibean3_conversationName2 = form2.getElementById("main:multibean3_conversationName");
+ HtmlElement multibean3_instanceId2 = form2.getElementById("main:multibean3_instanceId");
+
+ HtmlElement multibean4_beanName2 = form2.getElementById("main:multibean4_beanName");
+ HtmlElement multibean4_conversationName2 = form2.getElementById("main:multibean4_conversationName");
+ HtmlElement multibean4_instanceId2 = form2.getElementById("main:multibean4_instanceId");
+
+ assertEquals(multibean1_beanName1.getTextContent(), multibean1_beanName2.getTextContent());
+ assertEquals(multibean2_beanName1.getTextContent(), multibean2_beanName2.getTextContent());
+ assertEquals(multibean3_beanName1.getTextContent(), multibean3_beanName2.getTextContent());
+ assertEquals(multibean4_beanName1.getTextContent(), multibean4_beanName2.getTextContent());
+
+ assertEquals(multibean1_conversationName1.getTextContent(), multibean1_conversationName2.getTextContent());
+ assertEquals(multibean2_conversationName1.getTextContent(), multibean2_conversationName2.getTextContent());
+ assertEquals(multibean3_conversationName1.getTextContent(), multibean3_conversationName2.getTextContent());
+ assertEquals(multibean4_conversationName1.getTextContent(), multibean4_conversationName2.getTextContent());
+
+ assertEquals(multibean1_instanceId1.getTextContent(), multibean1_instanceId2.getTextContent());
+ assertEquals(multibean2_instanceId1.getTextContent(), multibean2_instanceId2.getTextContent());
+ assertEquals(multibean3_instanceId1.getTextContent(), multibean3_instanceId2.getTextContent());
+ assertEquals(multibean4_instanceId1.getTextContent(), multibean4_instanceId2.getTextContent());
+ }
+
+ public void testClearReservation() throws Exception
+ {
+ WebClient webClient = new WebClient();
+
+ HtmlPage multiBean0 = (HtmlPage) webClient.getPage(ITConstants.APP_URL+"/multiBean/start.faces");
+ HtmlForm form0 = multiBean0.getFormByName("main");
+ HtmlSubmitInput button0 = (HtmlSubmitInput) form0.getInputByName("main:refresh");
+
+ HtmlPage multiBean1 = (HtmlPage) button0.click();
+
+ HtmlForm form1 = multiBean1.getFormByName("main");
+
+ HtmlElement multibean1_beanName1 = form1.getElementById("main:multibean1_beanName");
+ HtmlElement multibean1_conversationName1 = form1.getElementById("main:multibean1_conversationName");
+ HtmlElement multibean1_instanceId1 = form1.getElementById("main:multibean1_instanceId");
+
+ HtmlElement multibean2_beanName1 = form1.getElementById("main:multibean2_beanName");
+ HtmlElement multibean2_conversationName1 = form1.getElementById("main:multibean2_conversationName");
+ HtmlElement multibean2_instanceId1 = form1.getElementById("main:multibean2_instanceId");
+
+ HtmlElement multibean3_beanName1 = form1.getElementById("main:multibean3_beanName");
+ HtmlElement multibean3_conversationName1 = form1.getElementById("main:multibean3_conversationName");
+ HtmlElement multibean3_instanceId1 = form1.getElementById("main:multibean3_instanceId");
+
+ HtmlElement multibean4_beanName1 = form1.getElementById("main:multibean4_beanName");
+ HtmlElement multibean4_conversationName1 = form1.getElementById("main:multibean4_conversationName");
+ HtmlElement multibean4_instanceId1 = form1.getElementById("main:multibean4_instanceId");
+
+ HtmlTextInput conversationName = (HtmlTextInput) form1.getInputByName("main:conversationName");
+ conversationName.setValueAttribute("multibean");
+ HtmlSubmitInput button1 = (HtmlSubmitInput) form1.getInputByName("main:clear");
+
+ HtmlPage multiBean2 = (HtmlPage) button1.click();
+
+ HtmlForm form2 = multiBean2.getFormByName("main");
+
+ HtmlElement multibean1_beanName2 = form2.getElementById("main:multibean1_beanName");
+ HtmlElement multibean1_conversationName2 = form2.getElementById("main:multibean1_conversationName");
+ HtmlElement multibean1_instanceId2 = form2.getElementById("main:multibean1_instanceId");
+
+ HtmlElement multibean2_beanName2 = form2.getElementById("main:multibean2_beanName");
+ HtmlElement multibean2_conversationName2 = form2.getElementById("main:multibean2_conversationName");
+ HtmlElement multibean2_instanceId2 = form2.getElementById("main:multibean2_instanceId");
+
+ HtmlElement multibean3_beanName2 = form2.getElementById("main:multibean3_beanName");
+ HtmlElement multibean3_conversationName2 = form2.getElementById("main:multibean3_conversationName");
+ HtmlElement multibean3_instanceId2 = form2.getElementById("main:multibean3_instanceId");
+
+ HtmlElement multibean4_beanName2 = form2.getElementById("main:multibean4_beanName");
+ HtmlElement multibean4_conversationName2 = form2.getElementById("main:multibean4_conversationName");
+ HtmlElement multibean4_instanceId2 = form2.getElementById("main:multibean4_instanceId");
+
+ assertEquals(multibean1_beanName1.getTextContent(), multibean1_beanName2.getTextContent());
+ assertEquals(multibean2_beanName1.getTextContent(), multibean2_beanName2.getTextContent());
+ assertEquals(multibean3_beanName1.getTextContent(), multibean3_beanName2.getTextContent());
+ assertEquals(multibean4_beanName1.getTextContent(), multibean4_beanName2.getTextContent());
+
+ assertEquals(multibean1_conversationName1.getTextContent(), multibean1_conversationName2.getTextContent());
+ assertEquals(multibean2_conversationName1.getTextContent(), multibean2_conversationName2.getTextContent());
+ assertEquals(multibean3_conversationName1.getTextContent(), multibean3_conversationName2.getTextContent());
+ assertEquals(multibean4_conversationName1.getTextContent(), multibean4_conversationName2.getTextContent());
+
+ assertNotSame(multibean1_instanceId1.getTextContent(), multibean1_instanceId2.getTextContent());
+ assertNotSame(multibean2_instanceId1.getTextContent(), multibean2_instanceId2.getTextContent());
+ assertNotSame(multibean3_instanceId1.getTextContent(), multibean3_instanceId2.getTextContent());
+ assertEquals(multibean4_instanceId1.getTextContent(), multibean4_instanceId2.getTextContent());
+ }
+}
Added: myfaces/orchestra/trunk/examples/src/test/java/org/apache/myfaces/orchestra/test/it/WebappTest.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/test/java/org/apache/myfaces/orchestra/test/it/WebappTest.java?rev=887449&view=auto
==============================================================================
--- myfaces/orchestra/trunk/examples/src/test/java/org/apache/myfaces/orchestra/test/it/WebappTest.java (added)
+++ myfaces/orchestra/trunk/examples/src/test/java/org/apache/myfaces/orchestra/test/it/WebappTest.java Fri Dec 4 23:27:40 2009
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+package org.apache.myfaces.orchestra.test.it;
+
+import junit.framework.TestCase;
+
+import java.net.URL;
+import java.net.HttpURLConnection;
+
+import org.apache.myfaces.orchestra.test.ITConstants;
+
+import com.sun.org.apache.bcel.internal.Constants;
+
+/**
+ * Simple webapp test integration test demo
+ */
+public class WebappTest extends TestCase
+{
+ public void testCallIndexPage() throws Exception
+ {
+ URL url = new URL(ITConstants.APP_URL);
+ HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+ connection.connect();
+ assertEquals(200, connection.getResponseCode());
+ }
+}