Author: alexsmirnov
Date: 2008-11-12 19:58:34 -0500 (Wed, 12 Nov 2008)
New Revision: 11126
Added:
branches/jsf2.0/framework/jsf-test/src/test/resources/com/
branches/jsf2.0/framework/jsf-test/src/test/resources/com/sun/
branches/jsf2.0/framework/jsf-test/src/test/resources/com/sun/el/
branches/jsf2.0/framework/jsf-test/src/test/resources/com/sun/el/Messages.properties
branches/jsf2.0/framework/jsf-test/src/test/resources/org/richfaces/test/faces-config.xml
branches/jsf2.0/tests/
branches/jsf2.0/tests/ajax/
branches/jsf2.0/tests/ajax/pom.xml
branches/jsf2.0/tests/ajax/src/
branches/jsf2.0/tests/ajax/src/main/
branches/jsf2.0/tests/ajax/src/main/java/
branches/jsf2.0/tests/ajax/src/main/java/declarativeajax/
branches/jsf2.0/tests/ajax/src/main/java/declarativeajax/Bean.java
branches/jsf2.0/tests/ajax/src/main/resources/
branches/jsf2.0/tests/ajax/src/main/webapp/
branches/jsf2.0/tests/ajax/src/main/webapp/META-INF/
branches/jsf2.0/tests/ajax/src/main/webapp/META-INF/MANIFEST.MF
branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/
branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/faces-config.xml
branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/lib/
branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/web.xml
branches/jsf2.0/tests/ajax/src/main/webapp/home.xhtml
branches/jsf2.0/tests/ajax/src/main/webapp/index.jsp
branches/jsf2.0/tests/ajax/src/main/webapp/resources/
branches/jsf2.0/tests/ajax/src/main/webapp/resources/anim-star-bkgrnd.gif
branches/jsf2.0/tests/ajax/src/main/webapp/resources/stylesheet.css
branches/jsf2.0/tests/ajax/src/test/
branches/jsf2.0/tests/ajax/src/test/java/
branches/jsf2.0/tests/ajax/src/test/java/org/
branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/
branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/
branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/SimpleAjaxTest.java
branches/jsf2.0/tests/ajax/src/test/resources/
branches/jsf2.0/tests/pom.xml
Modified:
branches/jsf2.0/framework/jsf-test/pom.xml
branches/jsf2.0/framework/jsf-test/src/test/java/org/richfaces/test/FacesServerTest.java
branches/jsf2.0/pom.xml
Log:
create JSF 2.0 ajax test
Modified: branches/jsf2.0/framework/jsf-test/pom.xml
===================================================================
--- branches/jsf2.0/framework/jsf-test/pom.xml 2008-11-12 20:27:42 UTC (rev 11125)
+++ branches/jsf2.0/framework/jsf-test/pom.xml 2008-11-13 00:58:34 UTC (rev 11126)
@@ -16,7 +16,6 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.5</version>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
@@ -25,6 +24,11 @@
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>2.0.0-b05</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
<artifactId>mojarra-jsf-impl</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
@@ -68,5 +72,35 @@
<artifactId>nekohtml</artifactId>
<version>1.9.9</version>
</dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>jstl</groupId>
+ <artifactId>jstl</artifactId>
+ <version>1.2</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ <version>2.7.0</version>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
Modified:
branches/jsf2.0/framework/jsf-test/src/test/java/org/richfaces/test/FacesServerTest.java
===================================================================
---
branches/jsf2.0/framework/jsf-test/src/test/java/org/richfaces/test/FacesServerTest.java 2008-11-12
20:27:42 UTC (rev 11125)
+++
branches/jsf2.0/framework/jsf-test/src/test/java/org/richfaces/test/FacesServerTest.java 2008-11-13
00:58:34 UTC (rev 11126)
@@ -49,6 +49,7 @@
@Override
protected void setupWebContent() {
+ facesServer.addResource("/WEB-INF/faces-config.xml",
"org/richfaces/test/faces-config.xml");
facesServer.addResource("/hello.xhtml",
"org/richfaces/test/hello.xhtml");
facesServer.addResource("/response.xhtml",
"org/richfaces/test/response.xhtml");
facesServer.addResource("/wave.med.gif",
"org/richfaces/test/wave.med.gif");
Added:
branches/jsf2.0/framework/jsf-test/src/test/resources/com/sun/el/Messages.properties
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/test/resources/com/sun/el/Messages.properties
(rev 0)
+++
branches/jsf2.0/framework/jsf-test/src/test/resources/com/sun/el/Messages.properties 2008-11-13
00:58:34 UTC (rev 11126)
@@ -0,0 +1 @@
+error.unreachable.base: Unreachable Base
\ No newline at end of file
Property changes on:
branches/jsf2.0/framework/jsf-test/src/test/resources/com/sun/el/Messages.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/jsf2.0/framework/jsf-test/src/test/resources/org/richfaces/test/faces-config.xml
===================================================================
---
branches/jsf2.0/framework/jsf-test/src/test/resources/org/richfaces/test/faces-config.xml
(rev 0)
+++
branches/jsf2.0/framework/jsf-test/src/test/resources/org/richfaces/test/faces-config.xml 2008-11-13
00:58:34 UTC (rev 11126)
@@ -0,0 +1,69 @@
+<?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.
+-->
+
+<faces-config
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-facesconfig_2_0.xsd"
+ version="2.0">
+
+ <!-- our NumberBean we created before -->
+ <managed-bean>
+ <managed-bean-name>HelloBean</managed-bean-name>
+
<managed-bean-class>org.richfaces.test.HelloBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+ <!-- going from guess.xhtml to response.xhtml -->
+ <navigation-rule>
+ <from-view-id>/hello.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+ <to-view-id>/response.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+ <!-- going from response.xhtml to guess.xhtml -->
+ <navigation-rule>
+ <from-view-id>/response.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+ <to-view-id>/hello.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+</faces-config>
Property changes on:
branches/jsf2.0/framework/jsf-test/src/test/resources/org/richfaces/test/faces-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: branches/jsf2.0/pom.xml
===================================================================
--- branches/jsf2.0/pom.xml 2008-11-12 20:27:42 UTC (rev 11125)
+++ branches/jsf2.0/pom.xml 2008-11-13 00:58:34 UTC (rev 11126)
@@ -54,6 +54,7 @@
<module>cdk</module>
<module>framework</module>
<module>ui</module>
+ <module>tests</module>
</modules>
<repositories>
<repository>
Added: branches/jsf2.0/tests/ajax/pom.xml
===================================================================
--- branches/jsf2.0/tests/ajax/pom.xml (rev 0)
+++ branches/jsf2.0/tests/ajax/pom.xml 2008-11-13 00:58:34 UTC (rev 11126)
@@ -0,0 +1,63 @@
+<?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>
+ <artifactId>tests</artifactId>
+ <groupId>org.richfaces</groupId>
+ <version>4.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.tests</groupId>
+ <artifactId>ajax</artifactId>
+ <packaging>war</packaging>
+ <name>ajax Maven Webapp</name>
+ <version>4.0.0-SNAPSHOT</version>
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/main/webapp</directory>
+ </testResource>
+ </testResources>
+ <finalName>ajax</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <executions>
+ <execution>
+ <id>firefox</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>browser</name>
+ <value>firefox3</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ <execution>
+ <id>ie</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>browser</name>
+ <value>ie7</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ </dependencies>
+</project>
\ No newline at end of file
Property changes on: branches/jsf2.0/tests/ajax/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jsf2.0/tests/ajax/src/main/java/declarativeajax/Bean.java
===================================================================
--- branches/jsf2.0/tests/ajax/src/main/java/declarativeajax/Bean.java
(rev 0)
+++ branches/jsf2.0/tests/ajax/src/main/java/declarativeajax/Bean.java 2008-11-13 00:58:34
UTC (rev 11126)
@@ -0,0 +1,195 @@
+/*
+ * 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.
+ */
+
+package declarativeajax;
+
+import javax.faces.component.UIComponent;
+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
+public class Bean {
+
+ private static final Logger LOGGER = Logger.getLogger("declarativeajax");
+
+ //
+ // Relationship Instance Variables
+ //
+
+ private Map<String,String> stateMap = null;
+
+ private List stateOptions = null;
+
+ //
+ // Constructors
+ //
+
+ public Bean() {
+ stateMap = new HashMap<String,String>();
+ 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.add(new SelectItem("CA","CA","CA"));
+ stateOptions.add(new SelectItem("CT","CT","CT"));
+ stateOptions.add(new SelectItem("MA","MA","MA"));
+ stateOptions.add(new SelectItem("NJ","NJ","NJ"));
+ stateOptions.add(new SelectItem("NY","NY","NY"));
+
+ }
+
+ public Collection getStateOptions() {
+ return stateOptions;
+ }
+
+
+ public void setStateOptions(Collection newOptions) {
+ stateOptions = new ArrayList(newOptions);
+ }
+
+ public void beanAction(ActionEvent event) {
+ FacesContext context = FacesContext.getCurrentInstance();
+ UIForm form = (UIForm)context.getViewRoot().findComponent("form1");
+ UIInput name = (UIInput)form.findComponent("name");
+ name.setValue("");
+ UIInput address = (UIInput)form.findComponent("address");
+ address.setValue("");
+ UIInput city = (UIInput)form.findComponent("city");
+ city.setValue("");
+ UIInput zip = (UIInput)form.findComponent("zip");
+ zip.setValue("");
+ }
+
+ public void displayState(ValueChangeEvent event) {
+ String state = (String)((HtmlSelectOneMenu)event.getComponent()).getValue();
+ FacesContext context = FacesContext.getCurrentInstance();
+ UIForm form = (UIForm)context.getViewRoot().findComponent("form1");
+ UIOutput output = (UIOutput)form.findComponent("stateout");
+ output.setValue((String)stateMap.get(state));
+ }
+
+ public void displayText(ValueChangeEvent event) {
+ String text = (String)((UIInput)event.getComponent()).getValue();
+ String label =
(String)((UIInput)event.getComponent()).getAttributes().get("label");
+ FacesContext context = FacesContext.getCurrentInstance();
+ UIForm form = (UIForm)context.getViewRoot().findComponent("form1");
+ UIOutput output = null;
+ if ((label!=null)&&label.equals("Name")) {
+ output = (UIOutput)form.findComponent("nameout");
+ output.setValue("You entered: "+text);
+ } else if ((label!=null)&&label.equals("Address")) {
+ output = (UIOutput)form.findComponent("addressout");
+ output.setValue("You entered: "+text);
+ } else if ((label!=null)&&label.equals("City")) {
+ output = (UIOutput)form.findComponent("cityout");
+ output.setValue("You entered: "+text);
+ } else if ((label!=null)&&label.equals("Zip")) {
+ output = (UIOutput)form.findComponent("zipout");
+ output.setValue("You entered: "+text);
+ }
+ }
+
+ public void displayRadio(ValueChangeEvent event) {
+ String text = (String)((UIInput)event.getComponent()).getValue();
+ FacesContext context = FacesContext.getCurrentInstance();
+ UIForm form = (UIForm)context.getViewRoot().findComponent("form1");
+ UIOutput output = null;
+ if (text.equals("Java")) {
+ output = (UIOutput)form.findComponent("softwareLang");
+ output.setValue("Great choice!");
+ } else if (text.equals("C#")) {
+ output = (UIOutput)form.findComponent("softwareLang");
+ output.setValue("Pretty similar to Java..");
+ } else if (text.equals("C++")) {
+ output = (UIOutput)form.findComponent("softwareLang");
+ output.setValue("Great lower level OO language..");
+ } else if (text.equals("C")) {
+ output = (UIOutput)form.findComponent("softwareLang");
+ output.setValue("When you need a nice device driver...");
+ }
+ }
+
+ public void displayList(ValueChangeEvent event) {
+ String text = (String)((UIInput)event.getComponent()).getValue();
+ FacesContext context = FacesContext.getCurrentInstance();
+ UIForm form = (UIForm)context.getViewRoot().findComponent("form1");
+ UIOutput output = null;
+ if (text.equals("10")) {
+ output = (UIOutput)form.findComponent("out1");
+ output.setValue("Really?");
+ } else if (text.equals("8")) {
+ output = (UIOutput)form.findComponent("out1");
+ output.setValue("Are you sure?");
+ } else if (text.equals("all")) {
+ output = (UIOutput)form.findComponent("out1");
+ output.setValue("Correct!");
+ }
+ }
+
+}
Property changes on: branches/jsf2.0/tests/ajax/src/main/java/declarativeajax/Bean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jsf2.0/tests/ajax/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- branches/jsf2.0/tests/ajax/src/main/webapp/META-INF/MANIFEST.MF
(rev 0)
+++ branches/jsf2.0/tests/ajax/src/main/webapp/META-INF/MANIFEST.MF 2008-11-13 00:58:34
UTC (rev 11126)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: branches/jsf2.0/tests/ajax/src/main/webapp/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/faces-config.xml
(rev 0)
+++ branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/faces-config.xml 2008-11-13
00:58:34 UTC (rev 11126)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<faces-config
+
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-facesconfig_1_2.xsd"
+ version="1.2">
+
+</faces-config>
Property changes on: branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/faces-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/web.xml
===================================================================
--- branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/web.xml
(rev 0)
+++ branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/web.xml 2008-11-13 00:58:34 UTC
(rev 11126)
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<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" >
+</web-app>
Property changes on: branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/web.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jsf2.0/tests/ajax/src/main/webapp/home.xhtml
===================================================================
--- branches/jsf2.0/tests/ajax/src/main/webapp/home.xhtml (rev 0)
+++ branches/jsf2.0/tests/ajax/src/main/webapp/home.xhtml 2008-11-13 00:58:34 UTC (rev
11126)
@@ -0,0 +1,155 @@
+<!--
+ 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.
+-->
+<!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"/>
+
+<h:head>
+ <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
+ <title>Ajax Request</title>
+</h:head>
+
+<h:body>
+
+<!-- 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>
+
+<!-- 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:outputStylesheet name="stylesheet.css" />
+ </h:form>
+
+</h:body>
+
+</html>
Property changes on: branches/jsf2.0/tests/ajax/src/main/webapp/home.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jsf2.0/tests/ajax/src/main/webapp/index.jsp
===================================================================
--- branches/jsf2.0/tests/ajax/src/main/webapp/index.jsp (rev 0)
+++ branches/jsf2.0/tests/ajax/src/main/webapp/index.jsp 2008-11-13 00:58:34 UTC (rev
11126)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<h2>Hello World!</h2>
+</body>
+</html>
Property changes on: branches/jsf2.0/tests/ajax/src/main/webapp/index.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jsf2.0/tests/ajax/src/main/webapp/resources/anim-star-bkgrnd.gif
===================================================================
(Binary files differ)
Property changes on:
branches/jsf2.0/tests/ajax/src/main/webapp/resources/anim-star-bkgrnd.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/jsf2.0/tests/ajax/src/main/webapp/resources/stylesheet.css
===================================================================
--- branches/jsf2.0/tests/ajax/src/main/webapp/resources/stylesheet.css
(rev 0)
+++ branches/jsf2.0/tests/ajax/src/main/webapp/resources/stylesheet.css 2008-11-13
00:58:34 UTC (rev 11126)
@@ -0,0 +1,243 @@
+/*
+ * 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.
+ */
+
+.title-panel {
+ background-image: url(anim-star-bkgrnd.gif.jsf);
+ height: 80px;
+ width: 1380;
+}
+
+.title-panel-text {
+ color: white;
+ font-family: 'Georgia','Times New Roman','times',serif;
+ font-size: 24px;
+ font-weight: bold;
+}
+
+.title-panel-subtext {
+ color: white;
+ font-family: 'Georgia','Times New Roman','times',serif;
+ font-size: 14px;
+ font-style: italic
+}
+
+body {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 12px;
+}
+
+td {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 12px;
+}
+
+th {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 12px;
+}
+
+.bodystyle {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 12px;
+}
+
+.small {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 9px;
+}
+
+.medium {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 12px;
+}
+
+.maintitle {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 14px;
+ color: #330066;
+}
+
+.subtitle {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 12px;
+ color: #93B629;
+}
+
+.subtitlebig {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 16px;
+ color: #93B629;
+ padding-top: 10;
+ padding-bottom: 10;
+}
+
+.big {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 16px;
+}
+
+.xbig {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 24px;
+}
+
+.expanded {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 12px;
+ line-height: 24px;
+ letter-spacing: 2px;
+}
+
+.justified {
+ font-family: Arial, Helvetica, sans-serif;
+ text-align: justify;
+}
+
+.footer {
+ font-family: "Times New Roman", Times, serif;
+ font-size: 9px;
+ color: #999999;
+}
+
+.box1 {
+ padding: 3px;
+ border-width: medium;
+ border-style: solid;
+ border-color: #CCCCCC #666666 #666666 #CCCCCC;
+}
+
+.box2 {
+ font-style: italic;
+ word-spacing: 2pt;
+ padding: 3px;
+ border: 1px solid;
+}
+
+.align-left {
+ text-align: left;
+}
+
+.control-panel-border {
+ border: 5px outset red;
+}
+
+.x-button-border {
+ border: 3px outset blue;
+}
+
+.o-button-border {
+ border: 3px outset red;
+}
+
+.win-button-border {
+ border: 3px outset yellow;
+}
+
+.execute {
+ background-color: #bfefff;
+}
+
+.render {
+ border: 3px outset red;
+}
+
+.initial-render {
+ border: 3px outset green;
+}
+
+.execute-render {
+ border: 3px outset red;
+ background-color: #bfefff;
+}
+
+.keytitle {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 16px;
+ color: #330066;
+}
+
+.options-prompt {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 16px;
+ color: blue;
+}
+.options {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 16px;
+ color: red;
+}
+
+
+.panel-border {
+ border: 2px outset blue;
+ background-color: #c1cdcd;
+}
+
+.panel-background {
+ background-color: #7171A5;
+ border: 5px outset #71A5A5;
+ border-collapse: collapse;
+ font-family: sans-serif;
+ font-size: 14pt;
+ padding: 10px;
+}
+
+.package-selected {
+ background-color: #93B629;
+}
+
+.package-unselected {
+ background-color: #C0C0C0;
+}
+
+.option-unselected {
+ background-color: #FFFFFF;
+}
+
+.top-table {
+ padding: 0;
+ border: 0;
+ width: 660px;
+}
+
+.storeFrontCar {
+ padding: 0;
+ border: 0;
+}
+
+.validationMessage {
+ color: red;
+}
Property changes on: branches/jsf2.0/tests/ajax/src/main/webapp/resources/stylesheet.css
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/SimpleAjaxTest.java
===================================================================
--- branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/SimpleAjaxTest.java
(rev 0)
+++
branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/SimpleAjaxTest.java 2008-11-13
00:58:34 UTC (rev 11126)
@@ -0,0 +1,50 @@
+/**
+ *
+ */
+package org.richfaces.test;
+
+import static org.junit.Assert.*;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class SimpleAjaxTest extends AbstractFacesTest {
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @Before
+ public void setUp() throws Exception {
+ }
+
+ @Override
+ protected void setupWebContent() {
+ facesServer.addResource("/WEB-INF/faces-config.xml",
"/WEB-INF/faces-config.xml");
+ facesServer.addResource("/index.jsp", "/index.jsp");
+ facesServer.addResource("/home.xhtml", "/home.xhtml");
+ facesServer.addResource("/resources/stylesheet.css",
"/resources/stylesheet.css");
+ facesServer.addResource("/resources/anim-star-bkgrnd.gif",
"/resources/anim-star-bkgrnd.gif");
+ }
+ /**
+ * @throws java.lang.Exception
+ */
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ @Test
+ public void testRequest() throws Exception {
+ WebClient webClient = new LocalWebClient(facesServer);
+ HtmlPage page = webClient.getPage("http://localhost/hello.jsf");
+ System.out.println(page.asXml());
+
+ }
+}
Property changes on:
branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/SimpleAjaxTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jsf2.0/tests/pom.xml
===================================================================
--- branches/jsf2.0/tests/pom.xml (rev 0)
+++ branches/jsf2.0/tests/pom.xml 2008-11-13 00:58:34 UTC (rev 11126)
@@ -0,0 +1,74 @@
+<?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>
+ <artifactId>root</artifactId>
+ <groupId>org.richfaces</groupId>
+ <version>4.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces</groupId>
+ <artifactId>tests</artifactId>
+ <packaging>pom</packaging>
+ <name>RichFaces test projects</name>
+ <
url>http://labs.jboss.com/jbossrichfaces/tests</url>
+ <properties>
+ <!-- -->
+ </properties>
+ <!-- Profile to run jetty, so the tomcat jars are included in the bundle. They are
not included by default -->
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-source</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <index>true</index>
+ <manifest>
+ <addDefaultSpecificationEntries>
+ true
+ </addDefaultSpecificationEntries>
+ <addDefaultImplementationEntries>
+ true
+ </addDefaultImplementationEntries>
+ </manifest>
+ <manifestEntries>
+ <mode>development</mode>
+ <Build-Number>${buildNumber}</Build-Number>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>jsf-test</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <modules>
+ <module>ajax</module>
+ </modules>
+</project>
\ No newline at end of file
Property changes on: branches/jsf2.0/tests/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain