Author: alexsmirnov
Date: 2009-10-29 20:11:27 -0400 (Thu, 29 Oct 2009)
New Revision: 15783
Added:
root/examples-sandbox/trunk/testapps/ajax/
root/examples-sandbox/trunk/testapps/ajax/.svnignore
root/examples-sandbox/trunk/testapps/ajax/pom.xml
root/examples-sandbox/trunk/testapps/ajax/src/
root/examples-sandbox/trunk/testapps/ajax/src/main/
root/examples-sandbox/trunk/testapps/ajax/src/main/java/
root/examples-sandbox/trunk/testapps/ajax/src/main/java/JSFUnitTest.java
root/examples-sandbox/trunk/testapps/ajax/src/main/resources/
root/examples-sandbox/trunk/testapps/ajax/src/main/webapp/
root/examples-sandbox/trunk/testapps/ajax/src/main/webapp/META-INF/
root/examples-sandbox/trunk/testapps/ajax/src/main/webapp/META-INF/MANIFEST.MF
root/examples-sandbox/trunk/testapps/ajax/src/main/webapp/WEB-INF/
root/examples-sandbox/trunk/testapps/ajax/src/main/webapp/WEB-INF/lib/
root/examples-sandbox/trunk/testapps/ajax/src/main/webapp/WEB-INF/web.xml
root/examples-sandbox/trunk/testapps/ajax/src/main/webapp/index.jsp
root/examples-sandbox/trunk/testapps/ajax/src/test/
root/examples-sandbox/trunk/testapps/ajax/src/test/java/
root/examples-sandbox/trunk/testapps/ajax/src/test/java/JSFUnitTest.java
root/examples-sandbox/trunk/testapps/pom.xml
Modified:
root/examples-sandbox/trunk/backwardCompatibility/pom.xml
root/examples-sandbox/trunk/backwardCompatibility/src/main/webapp/WEB-INF/web.xml
root/examples-sandbox/trunk/components/ajax/pom.xml
root/examples-sandbox/trunk/components/ajax/src/main/java/declarativeajax/Bean.java
root/examples-sandbox/trunk/components/ajax/src/main/webapp/home.xhtml
root/examples-sandbox/trunk/components/ajax/src/test/java/org/richfaces/test/ajax/UIDataTest.java
Log:
jsfunit testapp
Modified: root/examples-sandbox/trunk/backwardCompatibility/pom.xml
===================================================================
--- root/examples-sandbox/trunk/backwardCompatibility/pom.xml 2009-10-29 14:35:47 UTC (rev
15782)
+++ root/examples-sandbox/trunk/backwardCompatibility/pom.xml 2009-10-30 00:11:27 UTC (rev
15783)
@@ -1,20 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><!--
<parent>
<artifactId>examples-sandbox</artifactId>
<groupId>org.richfaces</groupId>
<version>4.0.0-SNAPSHOT</version>
</parent>
- <modelVersion>4.0.0</modelVersion>
+ --><modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.examples-sandbox</groupId>
<artifactId>backwardCompatibility</artifactId>
<packaging>war</packaging>
<name>seamIntegration Maven Webapp</name>
+ <version>4.0.0-SNAPSHOT</version>
<properties>
<seam.version>2.2.0.GA</seam.version>
- <richfaces.version>3.3.2.GA</richfaces.version>
+ <richfaces.version>3.3.2.SR1</richfaces.version>
</properties>
<build>
<finalName>backwardCompatibility</finalName>
@@ -116,7 +117,7 @@
<artifactId>jboss-seam-debug</artifactId>
<version>${seam.version}</version>
<scope>runtime</scope>
- </dependency>
+ </dependency><!--
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
@@ -130,5 +131,21 @@
<scope>provided</scope>
</dependency>
+ -->
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>1.2_13</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>1.2_13</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
Modified:
root/examples-sandbox/trunk/backwardCompatibility/src/main/webapp/WEB-INF/web.xml
===================================================================
---
root/examples-sandbox/trunk/backwardCompatibility/src/main/webapp/WEB-INF/web.xml 2009-10-29
14:35:47 UTC (rev 15782)
+++
root/examples-sandbox/trunk/backwardCompatibility/src/main/webapp/WEB-INF/web.xml 2009-10-30
00:11:27 UTC (rev 15783)
@@ -11,6 +11,10 @@
</context-param>
-->
<context-param>
+ <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
<param-name>org.ajax4jsf.SKIN</param-name>
<param-value>blueSky</param-value>
</context-param>
@@ -18,6 +22,9 @@
<param-name>facelets.VIEW_MAPPINGS</param-name>
<param-value>*.xhtml</param-value>
</context-param>
+ <listener>
+
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
+ </listener>
<!-- Seam -->
<listener>
Modified: root/examples-sandbox/trunk/components/ajax/pom.xml
===================================================================
--- root/examples-sandbox/trunk/components/ajax/pom.xml 2009-10-29 14:35:47 UTC (rev
15782)
+++ root/examples-sandbox/trunk/components/ajax/pom.xml 2009-10-30 00:11:27 UTC (rev
15783)
@@ -66,12 +66,6 @@
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.0.1-SNAPSHOT</version>
- <exclusions>
- <exclusion>
- <groupId>org.jvnet.wagon-svn</groupId>
- <artifactId>wagon-svn</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
Modified:
root/examples-sandbox/trunk/components/ajax/src/main/java/declarativeajax/Bean.java
===================================================================
---
root/examples-sandbox/trunk/components/ajax/src/main/java/declarativeajax/Bean.java 2009-10-29
14:35:47 UTC (rev 15782)
+++
root/examples-sandbox/trunk/components/ajax/src/main/java/declarativeajax/Bean.java 2009-10-30
00:11:27 UTC (rev 15783)
@@ -36,44 +36,33 @@
package declarativeajax;
-import javax.faces.component.UIComponent;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Logger;
+
import javax.faces.component.UIForm;
import javax.faces.component.UIInput;
import javax.faces.component.UIOutput;
-import javax.faces.component.UIPanel;
-import javax.faces.component.UISelectMany;
-import javax.faces.component.html.HtmlInputText;
import javax.faces.component.html.HtmlSelectOneMenu;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;
-import javax.faces.model.ManagedBean;
-import javax.faces.model.SessionScoped;
-import java.util.Arrays;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
/**
* <p>This bean has the methods that are used to illustrate
* the <code>JSF 2.0 declarative ajax</code>. * <p/>
*
*/
-@ManagedBean(name="bean")
-@SessionScoped
+(a)javax.faces.bean.ManagedBean(name="bean")
+(a)javax.faces.bean.SessionScoped
public class Bean {
- private static final Logger LOGGER = Logger.getLogger("declarativeajax");
+// private static final Logger LOGGER =
Logger.getLogger("declarativeajax");
//
// Relationship Instance Variables
@@ -81,21 +70,21 @@
private Map<String,String> stateMap = null;
- private List stateOptions = null;
+ private List<SelectItem> stateOptions = null;
//
// Constructors
//
public Bean() {
- stateMap = new HashMap<String,String>();
+ stateMap = new HashMap<String,String>(5);
stateMap.put("CA", "California");
stateMap.put("CT", "Connecticut");
stateMap.put("MA", "Massachusetts");
stateMap.put("NJ", "New Jersey");
stateMap.put("NY", "New York");
- stateOptions = new ArrayList();
+ stateOptions = new ArrayList<SelectItem>(5);
stateOptions.add(new SelectItem("CA","CA","CA"));
stateOptions.add(new SelectItem("CT","CT","CT"));
stateOptions.add(new SelectItem("MA","MA","MA"));
@@ -104,13 +93,13 @@
}
- public Collection getStateOptions() {
+ public Collection<SelectItem> getStateOptions() {
return stateOptions;
}
- public void setStateOptions(Collection newOptions) {
- stateOptions = new ArrayList(newOptions);
+ public void setStateOptions(Collection<SelectItem> newOptions) {
+ stateOptions = new ArrayList<SelectItem>(newOptions);
}
public void beanAction(ActionEvent event) {
Modified: root/examples-sandbox/trunk/components/ajax/src/main/webapp/home.xhtml
===================================================================
--- root/examples-sandbox/trunk/components/ajax/src/main/webapp/home.xhtml 2009-10-29
14:35:47 UTC (rev 15782)
+++ root/examples-sandbox/trunk/components/ajax/src/main/webapp/home.xhtml 2009-10-30
00:11:27 UTC (rev 15783)
@@ -35,121 +35,131 @@
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:ui="http://java.sun.com/jsf/facelets">
-<f:view contentType="text/html"/>
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+<f:view contentType="text/html" />
<h:head>
- <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
- <title>Ajax Request</title>
+ <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
+ <title>Ajax Request</title>
</h:head>
<h:body>
-<!-- Ajaxify Individual Controls -->
+ <!-- Ajaxify Individual Controls -->
- <h:form id="form1" >
- <h:panelGrid styleClass="title-panel">
- <h:outputText value="D e c l a r a t i v e A j a x "
styleClass="title-panel-text"/>
- <h:outputText value="Powered By JavaServer Faces 2.0 "
styleClass="title-panel-subtext"/>
- </h:panelGrid>
- <h:panelGrid border="1">
- <h:panelGrid columns="3" >
- <h:outputText value=""/>
- <h:outputText value="Panel1 : Ajaxify Individual
Controls"/>
- <h:outputText value=""/>
- </h:panelGrid>
- <h:panelGrid columns="3">
- <h:outputText value="Name: "/>
- <h:inputText id="name" required="true"
label="Name" valueChangeListener="#{bean.displayText}">
- <f:ajax />
- </h:inputText>
- <h:outputText id="nameout"/>
- <h:outputText value="Address: "/>
- <h:inputText id="address" required="true"
label="Address" valueChangeListener="#{bean.displayText}">
- <f:ajax />
- </h:inputText>
- <h:outputText id="addressout"/>
- <h:outputText value="City: "/>
- <h:inputText id="city" required="true"
label="City" valueChangeListener="#{bean.displayText}">
- <f:ajax />
- </h:inputText>
- <h:outputText id="cityout"/>
- <h:outputText value="State: "/>
- <h:selectOneMenu id="state"
valueChangeListener="#{bean.displayState}">
- <f:selectItems value="#{bean.stateOptions}" />
- <f:ajax render="form1:stateout"/>
- </h:selectOneMenu>
- <h:outputText id="stateout" />
- <h:outputText value="Zip: "/>
- <h:inputText id="zip" required="true"
label="Zip" valueChangeListener="#{bean.displayText}">
- <f:ajax />
- </h:inputText>
- <h:outputText id="zipout"/>
- <h:panelGrid>
- <h:commandButton value="Submit">
- <f:ajax />
- </h:commandButton>
- </h:panelGrid>
- </h:panelGrid>
- <h:panelGrid id="msgPanel">
- <h:message for="form1:name"/>
- <h:message for="form1:address"/>
- <h:message for="form1:city"/>
- <h:message for="form1:state"/>
- <h:message for="form1:zip"/>
- </h:panelGrid>
- </h:panelGrid>
+ <h:form id="form1">
+ <h:panelGrid styleClass="title-panel">
+ <h:outputText value="D e c l a r a t i v e A j a x "
+ styleClass="title-panel-text" />
+ <h:outputText value="Powered By JavaServer Faces 2.0 "
+ styleClass="title-panel-subtext" />
+ </h:panelGrid>
+ <h:panelGrid border="1">
+ <h:panelGrid columns="3">
+ <h:outputText value="" />
+ <h:outputText value="Panel1 : Ajaxify Individual Controls" />
+ <h:outputText value="" />
+ </h:panelGrid>
+ <h:panelGrid columns="3">
+ <h:outputText value="Name: " />
+ <h:inputText id="name" required="true" label="Name"
+ valueChangeListener="#{bean.displayText}">
+ <f:ajax />
+ </h:inputText>
+ <h:outputText id="nameout" />
+ <h:outputText value="Address: " />
+ <h:inputText id="address" required="true"
label="Address"
+ valueChangeListener="#{bean.displayText}">
+ <f:ajax />
+ </h:inputText>
+ <h:outputText id="addressout" />
+ <h:outputText value="City: " />
+ <h:inputText id="city" required="true" label="City"
+ valueChangeListener="#{bean.displayText}">
+ <f:ajax />
+ </h:inputText>
+ <h:outputText id="cityout" />
+ <h:outputText value="State: " />
+ <h:selectOneMenu id="state"
+ valueChangeListener="#{bean.displayState}">
+ <f:selectItems value="#{bean.stateOptions}" />
+ <f:ajax render="form1:stateout" />
+ </h:selectOneMenu>
+ <h:outputText id="stateout" />
+ <h:outputText value="Zip: " />
+ <h:inputText id="zip" required="true" label="Zip"
+ valueChangeListener="#{bean.displayText}">
+ <f:ajax />
+ </h:inputText>
+ <h:outputText id="zipout" />
+ <h:panelGrid>
+ <h:commandButton value="Submit">
+ <f:ajax />
+ </h:commandButton>
+ </h:panelGrid>
+ </h:panelGrid>
+ <h:panelGrid id="msgPanel">
+ <h:message for="form1:name" />
+ <h:message for="form1:address" />
+ <h:message for="form1:city" />
+ <h:message for="form1:state" />
+ <h:message for="form1:zip" />
+ </h:panelGrid>
+ </h:panelGrid>
-<!-- Ajaxify Panel -->
+ <!-- Ajaxify Panel -->
- <h:panelGrid border="1">
- <f:ajax/>
- <h:panelGrid columns="3" >
- <h:outputText value=""/>
- <h:outputText value="Panel2 : Ajaxify Panel"/>
- <h:outputText value=""/>
- </h:panelGrid>
- <h:panelGrid columns="3">
- <h:outputText value="Favorite programming language?"/>
- <h:selectOneRadio layout="lineDirection"
valueChangeListener="#{bean.displayRadio}">
- <f:selectItem itemValue="Java"
itemLabel="Java"/>
- <f:selectItem itemValue="C#" itemLabel="C#"/>
- <f:selectItem itemValue="C++"
itemLabel="C++"/>
- <f:selectItem itemValue="C" itemLabel="C"/>
- </h:selectOneRadio>
- <h:outputText id="softwareLang" />
- </h:panelGrid>
- <h:panelGrid columns="3">
- <f:ajax/>
- <h:outputText value="Some months have 30 days. Some have 31 days.
How many months have 28 days?"/>
- <h:selectOneListbox
valueChangeListener="#{bean.displayList}">
- <f:selectItem itemValue="10" itemLabel="10"
/>
- <f:selectItem itemValue="8" itemLabel="8" />
- <f:selectItem itemValue="all" itemLabel="All of
them" />
- </h:selectOneListbox>
- <h:outputText id="out1"/>
- </h:panelGrid>
- </h:panelGrid>
-
- <h:panelGrid border="1">
- <h:panelGrid columns="3" >
- <h:outputText value=""/>
- <h:outputText value="Panel2 : Manipulate Other
Components"/>
- <h:outputText value=""/>
- </h:panelGrid>
- <h:panelGrid columns="1">
- <h:commandButton value="Reset Text Fields"
actionListener="#{bean.beanAction}">
- <f:ajax execute="form1:name form1:address form1:city
form1:zip"
- render="form1:name form1:address form1:city form1:zip
form1:msgPanel"/>
- </h:commandButton>
- </h:panelGrid>
- </h:panelGrid>
+ <h:panelGrid border="1">
+ <h:panelGrid columns="3">
+ <h:outputText value="" />
+ <h:outputText value="Panel2 : Ajaxify Panel" />
+ <h:outputText value="" />
+ </h:panelGrid>
+ <h:panelGrid columns="3">
+ <h:outputText value="Favorite programming language?" />
+ <h:selectOneRadio layout="lineDirection"
+ valueChangeListener="#{bean.displayRadio}">
+ <f:selectItem itemValue="Java" itemLabel="Java" />
+ <f:selectItem itemValue="C#" itemLabel="C#" />
+ <f:selectItem itemValue="C++" itemLabel="C++" />
+ <f:selectItem itemValue="C" itemLabel="C" />
+ <f:ajax />
+ </h:selectOneRadio>
+ <h:outputText id="softwareLang" />
+ </h:panelGrid>
+ <h:panelGrid columns="3">
+ <h:outputText
+ value="Some months have 30 days. Some have 31 days. How many months have 28
days?" />
+ <h:selectOneListbox valueChangeListener="#{bean.displayList}">
+ <f:ajax />
+ <f:selectItem itemValue="10" itemLabel="10" />
+ <f:selectItem itemValue="8" itemLabel="8" />
+ <f:selectItem itemValue="all" itemLabel="All of them" />
+ </h:selectOneListbox>
+ <h:outputText id="out1" />
+ </h:panelGrid>
+ </h:panelGrid>
- <h:outputStylesheet name="stylesheet.css" />
- </h:form>
+ <h:panelGrid border="1">
+ <h:panelGrid columns="3">
+ <h:outputText value="" />
+ <h:outputText value="Panel2 : Manipulate Other Components" />
+ <h:outputText value="" />
+ </h:panelGrid>
+ <h:panelGrid columns="1">
+ <h:commandButton value="Reset Text Fields"
+ actionListener="#{bean.beanAction}">
+ <f:ajax execute="form1:name form1:address form1:city form1:zip"
+ render="form1:name form1:address form1:city form1:zip form1:msgPanel"
/>
+ </h:commandButton>
+ </h:panelGrid>
+ </h:panelGrid>
+ <h:outputStylesheet name="stylesheet.css" />
+ </h:form>
+
</h:body>
</html>
Modified:
root/examples-sandbox/trunk/components/ajax/src/test/java/org/richfaces/test/ajax/UIDataTest.java
===================================================================
---
root/examples-sandbox/trunk/components/ajax/src/test/java/org/richfaces/test/ajax/UIDataTest.java 2009-10-29
14:35:47 UTC (rev 15782)
+++
root/examples-sandbox/trunk/components/ajax/src/test/java/org/richfaces/test/ajax/UIDataTest.java 2009-10-30
00:11:27 UTC (rev 15783)
@@ -27,6 +27,7 @@
import javax.faces.render.ResponseStateManager;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.richfaces.test.AbstractFacesTest;
import org.richfaces.test.DataBean;
@@ -144,7 +145,7 @@
.getName());
}
- @Test
+/* @Ignore
public void testCycleRequest() throws Exception {
setupFacesRequest();
facesContext.setViewRoot(createView());
@@ -166,5 +167,5 @@
assertEquals("bar", dataBean.getData().get(6).getItems().get(5)
.getName());
}
-
+*/
}
Property changes on: root/examples-sandbox/trunk/testapps/ajax
___________________________________________________________________
Name: svn:ignore
+ target
.externalToolBuilders
.project
.classpath
.settings
Added: root/examples-sandbox/trunk/testapps/ajax/.svnignore
===================================================================
--- root/examples-sandbox/trunk/testapps/ajax/.svnignore (rev 0)
+++ root/examples-sandbox/trunk/testapps/ajax/.svnignore 2009-10-30 00:11:27 UTC (rev
15783)
@@ -0,0 +1,5 @@
+target
+.externalToolBuilders
+.project
+.classpath
+.settings
Added: root/examples-sandbox/trunk/testapps/ajax/pom.xml
===================================================================
--- root/examples-sandbox/trunk/testapps/ajax/pom.xml (rev 0)
+++ root/examples-sandbox/trunk/testapps/ajax/pom.xml 2009-10-30 00:11:27 UTC (rev 15783)
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd"
+
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>testapps</artifactId>
+ <groupId>org.richfaces.examples-sandbox</groupId>
+ <version>4.0.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.richfaces.examples-sandbox.testapps</groupId>
+ <artifactId>ajax</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <packaging>war</packaging>
+ <name>tables Maven Webapp</name>
+ <url>http://maven.apache.org</url>
+ <build>
+ <finalName>ajax</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+
+ <!-- We only want test to run during integration-test phase -->
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+
+ <executions>
+ <execution>
+ <id>surefire-it</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ <systemProperties>
+ <property>
+ <name>cactus.contextURL</name>
+ <value>http://localhost:8080/${artifactId}</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <configuration>
+ <wait>false</wait>
+ <configuration>
+ <deployables>
+ <deployable>
+ <location>${project.build.directory}/${artifactId}.war</location>
+ <type>war</type>
+ </deployable>
+ </deployables>
+ </configuration>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-container</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>stop-container</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.tests</groupId>
+ <artifactId>ajax</artifactId>
+ <type>war</type>
+ <version>4.0.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.jsfunit</groupId>
+ <artifactId>jboss-jsfunit-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>el-impl</groupId>
+ <artifactId>el-impl</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+</project>
Added: root/examples-sandbox/trunk/testapps/ajax/src/main/java/JSFUnitTest.java
===================================================================
--- root/examples-sandbox/trunk/testapps/ajax/src/main/java/JSFUnitTest.java
(rev 0)
+++ root/examples-sandbox/trunk/testapps/ajax/src/main/java/JSFUnitTest.java 2009-10-30
00:11:27 UTC (rev 15783)
@@ -0,0 +1,41 @@
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+
+import org.jboss.jsfunit.jsfsession.JSFClientSession;
+import org.jboss.jsfunit.jsfsession.JSFServerSession;
+import org.jboss.jsfunit.jsfsession.JSFSession;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+
+public class JSFUnitTest extends org.apache.cactus.ServletTestCase
+{
+ public static Test suite()
+ {
+ return new TestSuite( JSFUnitTest.class );
+ }
+
+ public void testInitialPage() throws IOException
+ {
+ // Send an HTTP request for the initial page
+ JSFSession jsfSession = new JSFSession("/home.jsf");
+
+ // A JSFClientSession emulates the browser and lets you test HTML
+ JSFClientSession client = jsfSession.getJSFClientSession();
+
+ // A JSFServerSession gives you access to JSF state
+ JSFServerSession server = jsfSession.getJSFServerSession();
+
+ // Test navigation to initial viewID
+ assertEquals("/home.xhtml", server.getCurrentViewID());
+
+ // Assert that the prompt component is in the component tree and rendered
+ UIComponent prompt = server.findComponent("msgPanel");
+ assertTrue(prompt.isRendered());
+
+ // Test a managed bean
+ assertNotNull(server.getManagedBeanValue("#{bean}"));
+ }
+}
Added: root/examples-sandbox/trunk/testapps/ajax/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- root/examples-sandbox/trunk/testapps/ajax/src/main/webapp/META-INF/MANIFEST.MF
(rev 0)
+++
root/examples-sandbox/trunk/testapps/ajax/src/main/webapp/META-INF/MANIFEST.MF 2009-10-30
00:11:27 UTC (rev 15783)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added: root/examples-sandbox/trunk/testapps/ajax/src/main/webapp/WEB-INF/web.xml
===================================================================
--- root/examples-sandbox/trunk/testapps/ajax/src/main/webapp/WEB-INF/web.xml
(rev 0)
+++ root/examples-sandbox/trunk/testapps/ajax/src/main/webapp/WEB-INF/web.xml 2009-10-30
00:11:27 UTC (rev 15783)
@@ -0,0 +1,129 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<!--
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+
+ The contents of this file are subject to the terms of either the GNU
+ General Public License Version 2 only ("GPL") or the Common Development
+ and Distribution License("CDDL") (collectively, the "License").
You
+ may not use this file except in compliance with the License. You can obtain
+ a copy of the License at
https://glassfish.dev.java.net/public/CDDL+GPL.html
+ or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
+ language governing permissions and limitations under the License.
+
+ When distributing the software, include this License Header Notice in each
+ file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
+ Sun designates this particular file as subject to the "Classpath" exception
+ as provided by Sun in the GPL Version 2 section of the License file that
+ accompanied this code. If applicable, add the following below the License
+ Header, with the fields enclosed by brackets [] replaced by your own
+ identifying information: "Portions Copyrighted [year]
+ [name of copyright owner]"
+
+ Contributor(s):
+
+ If you wish your version of this file to be governed by only the CDDL or
+ only the GPL Version 2, indicate your decision by adding "[Contributor]
+ elects to include this software in this distribution under the [CDDL or GPL
+ Version 2] license." If you don't indicate a single choice of license, a
+ recipient has the option to distribute your version of this file under
+ either the CDDL, the GPL Version 2 or to extend the choice of license to
+ its licensees as provided above. However, if you add GPL Version 2 code
+ and therefore, elected the GPL Version 2 license, then the option applies
+ only if the new code is made subject to such option by the copyright
+ holder.
+-->
+
+<web-app version="2.5"
+
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+ <display-name></display-name>
+ <description></description>
+
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Set this flag to true if you want the JavaServer Faces
+ Reference Implementation to validate the XML in your
+ faces-config.xml resources against the DTD. Default
+ value is false.
+ </description>
+ <param-name>com.sun.faces.validateXml</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <!-- Faces Servlet -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+
+ <!-- Faces Servlet Mapping -->
+ <!--
+
+ This mapping identifies a jsp page as having JSF content. If a
+ request comes to the server for foo.faces, the container will
+ send the request to the FacesServlet, which will expect a
+ corresponding foo.jsp page to exist containing the content.
+
+ -->
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+<filter>
+ <filter-name>JSFUnitFilter</filter-name>
+ <filter-class>org.jboss.jsfunit.framework.JSFUnitFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>JSFUnitFilter</filter-name>
+ <servlet-name>ServletTestRunner</servlet-name>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>JSFUnitFilter</filter-name>
+ <servlet-name>ServletRedirector</servlet-name>
+ </filter-mapping>
+
+ <servlet>
+ <servlet-name>ServletRedirector</servlet-name>
+
<servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
+ </servlet>
+
+ <servlet>
+ <servlet-name>ServletTestRunner</servlet-name>
+
<servlet-class>org.apache.cactus.server.runner.ServletTestRunner</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>ServletRedirector</servlet-name>
+ <url-pattern>/ServletRedirector</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>ServletTestRunner</servlet-name>
+ <url-pattern>/ServletTestRunner</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Added: root/examples-sandbox/trunk/testapps/ajax/src/main/webapp/index.jsp
===================================================================
--- root/examples-sandbox/trunk/testapps/ajax/src/main/webapp/index.jsp
(rev 0)
+++ root/examples-sandbox/trunk/testapps/ajax/src/main/webapp/index.jsp 2009-10-30
00:11:27 UTC (rev 15783)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<h2>Hello World!</h2>
+</body>
+</html>
Added: root/examples-sandbox/trunk/testapps/ajax/src/test/java/JSFUnitTest.java
===================================================================
--- root/examples-sandbox/trunk/testapps/ajax/src/test/java/JSFUnitTest.java
(rev 0)
+++ root/examples-sandbox/trunk/testapps/ajax/src/test/java/JSFUnitTest.java 2009-10-30
00:11:27 UTC (rev 15783)
@@ -0,0 +1,41 @@
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+
+import org.jboss.jsfunit.jsfsession.JSFClientSession;
+import org.jboss.jsfunit.jsfsession.JSFServerSession;
+import org.jboss.jsfunit.jsfsession.JSFSession;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+
+public class JSFUnitTest extends org.apache.cactus.ServletTestCase
+{
+ public static Test suite()
+ {
+ return new TestSuite( JSFUnitTest.class );
+ }
+
+ public void testInitialPage() throws IOException
+ {
+ // Send an HTTP request for the initial page
+ JSFSession jsfSession = new JSFSession("/home.jsf");
+
+ // A JSFClientSession emulates the browser and lets you test HTML
+ JSFClientSession client = jsfSession.getJSFClientSession();
+
+ // A JSFServerSession gives you access to JSF state
+ JSFServerSession server = jsfSession.getJSFServerSession();
+
+ // Test navigation to initial viewID
+ assertEquals("/home.xhtml", server.getCurrentViewID());
+
+ // Assert that the prompt component is in the component tree and rendered
+ UIComponent prompt = server.findComponent("msgPanel");
+ assertTrue(prompt.isRendered());
+
+ // Test a managed bean
+ assertNotNull(server.getManagedBeanValue("#{bean}"));
+ }
+}
Added: root/examples-sandbox/trunk/testapps/pom.xml
===================================================================
--- root/examples-sandbox/trunk/testapps/pom.xml (rev 0)
+++ root/examples-sandbox/trunk/testapps/pom.xml 2009-10-30 00:11:27 UTC (rev 15783)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.richfaces</groupId>
+ <artifactId>examples-sandbox</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.examples-sandbox</groupId>
+ <artifactId>testapps</artifactId>
+ <packaging>pom</packaging>
+ <modules>
+ <module>ajax</module>
+ </modules>
+ <dependencyManagement>
+ <dependencies>
+<dependency>
+ <groupId>org.jboss.jsfunit</groupId>
+ <artifactId>jboss-jsfunit-core</artifactId>
+ <version>1.2.0.GA-SNAPSHOT</version>
+ <scope>compile</scope>
+</dependency>
+ </dependencies>
+ </dependencyManagement>
+</project>
\ No newline at end of file