Author: alexsmirnov
Date: 2008-11-13 23:09:52 -0500 (Thu, 13 Nov 2008)
New Revision: 11161
Added:
trunk/test-applications/ajaxTest/
trunk/test-applications/ajaxTest/pom.xml
trunk/test-applications/ajaxTest/src/
trunk/test-applications/ajaxTest/src/main/
trunk/test-applications/ajaxTest/src/main/java/
trunk/test-applications/ajaxTest/src/main/java/Bean.java
trunk/test-applications/ajaxTest/src/main/resources/
trunk/test-applications/ajaxTest/src/test/
trunk/test-applications/ajaxTest/src/test/java/
trunk/test-applications/ajaxTest/src/test/java/org/
trunk/test-applications/ajaxTest/src/test/java/org/richfaces/
trunk/test-applications/ajaxTest/src/test/java/org/richfaces/RepeaterTest.java
trunk/test-applications/ajaxTest/src/test/resources/
trunk/test-applications/ajaxTest/src/test/resources/faces-config.xml
trunk/test-applications/ajaxTest/src/test/resources/org/
trunk/test-applications/ajaxTest/src/test/resources/org/richfaces/
trunk/test-applications/ajaxTest/src/test/resources/org/richfaces/logging.properties
trunk/test-applications/ajaxTest/src/test/resources/repeater.xhtml
Log:
Import test project.
Added: trunk/test-applications/ajaxTest/pom.xml
===================================================================
--- trunk/test-applications/ajaxTest/pom.xml (rev 0)
+++ trunk/test-applications/ajaxTest/pom.xml 2008-11-14 04:09:52 UTC (rev 11161)
@@ -0,0 +1,39 @@
+<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">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces</groupId>
+ <artifactId>ajaxTest</artifactId>
+ <name>ajax test</name>
+ <version>0.0.1-SNAPSHOT</version>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ <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>3.3.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.facelets</groupId>
+ <artifactId>jsf-facelets</artifactId>
+ <version>1.1.14</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>core</artifactId>
+ <version>3.3.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Property changes on: trunk/test-applications/ajaxTest/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: trunk/test-applications/ajaxTest/src/main/java/Bean.java
===================================================================
--- trunk/test-applications/ajaxTest/src/main/java/Bean.java (rev
0)
+++ trunk/test-applications/ajaxTest/src/main/java/Bean.java 2008-11-14 04:09:52 UTC (rev
11161)
@@ -0,0 +1,15 @@
+
+
+import java.io.Serializable;
+
+public class Bean implements Serializable {
+
+ private String text;
+
+ public Bean() {}
+
+ public String getText() { return text;}
+
+ public void setText(String name) { this.text = name; }
+
+}
Property changes on: trunk/test-applications/ajaxTest/src/main/java/Bean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: trunk/test-applications/ajaxTest/src/test/java/org/richfaces/RepeaterTest.java
===================================================================
--- trunk/test-applications/ajaxTest/src/test/java/org/richfaces/RepeaterTest.java
(rev 0)
+++
trunk/test-applications/ajaxTest/src/test/java/org/richfaces/RepeaterTest.java 2008-11-14
04:09:52 UTC (rev 11161)
@@ -0,0 +1,57 @@
+/**
+ *
+ */
+package org.richfaces;
+
+import static org.junit.Assert.*;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.richfaces.test.AbstractFacesTest;
+import org.richfaces.test.LocalWebClient;
+import org.w3c.dom.Element;
+
+import com.gargoylesoftware.htmlunit.BrowserVersion;
+import com.gargoylesoftware.htmlunit.NicelyResynchronizingAjaxController;
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlForm;
+import com.gargoylesoftware.htmlunit.html.HtmlInput;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class RepeaterTest extends AbstractFacesTest {
+
+ @Override
+ protected void setupWebContent() {
+ facesServer
+ .addResource("/WEB-INF/faces-config.xml", "faces-config.xml");
+ facesServer.addResource("/repeater.xhtml", "repeater.xhtml");
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+
+ @Test
+ public void testHelloFacelets() throws Exception {
+ WebClient webClient = new LocalWebClient(facesServer,BrowserVersion.FIREFOX_3);
+ webClient.setThrowExceptionOnScriptError(true);
+ webClient.setAjaxController(new NicelyResynchronizingAjaxController());
+ HtmlPage page = webClient.getPage("http://localhost/repeater.jsf");
+ page.getEnclosingWindow().getThreadManager().joinAll(10000);
+// System.out.println(page.asXml());
+ HtmlForm htmlForm = page.getFormByName("ajaxForm");
+ HtmlInput htmlInput = htmlForm.getInputByName("ajaxForm:text");
+ assertNotNull(htmlForm);
+ htmlInput.setValueAttribute("foo");
+ htmlInput.click();
+// System.out.println(page.asXml());
+ Element element = page.getElementById("ajaxForm:out");
+ assertEquals("foo", element.getTextContent().trim());
+ }
+
+}
Property changes on:
trunk/test-applications/ajaxTest/src/test/java/org/richfaces/RepeaterTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: trunk/test-applications/ajaxTest/src/test/resources/faces-config.xml
===================================================================
--- trunk/test-applications/ajaxTest/src/test/resources/faces-config.xml
(rev 0)
+++ trunk/test-applications/ajaxTest/src/test/resources/faces-config.xml 2008-11-14
04:09:52 UTC (rev 11161)
@@ -0,0 +1,20 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<faces-config version="1.2"
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">
+
+ <application>
+ <!--
+ <message-bundle>messages</message-bundle>
+ -->
+ <locale-config>
+ <default-locale>en</default-locale>
+ </locale-config>
+ <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
+ </application>
+ <managed-bean>
+ <managed-bean-name>bean</managed-bean-name>
+ <managed-bean-class>Bean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+</faces-config>
Property changes on: trunk/test-applications/ajaxTest/src/test/resources/faces-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added:
trunk/test-applications/ajaxTest/src/test/resources/org/richfaces/logging.properties
===================================================================
--- trunk/test-applications/ajaxTest/src/test/resources/org/richfaces/logging.properties
(rev 0)
+++
trunk/test-applications/ajaxTest/src/test/resources/org/richfaces/logging.properties 2008-11-14
04:09:52 UTC (rev 11161)
@@ -0,0 +1,15 @@
+handlers java.util.logging.ConsoleHandler
+
+############################################################
+# Handler specific properties.
+# Describes specific configuration info for Handlers.
+############################################################
+
+java.util.logging.ConsoleHandler.level ALL
+java.util.logging.ConsoleHandler.formatter java.util.logging.SimpleFormatter
+
+org.ajax4jsf.level=INFO
+javax.enterprise.resource.webcontainer.jsf.level=INFO
+com.gargoylesoftware.htmlunit.level=INFO
+org.richfaces.level=INFO
+
\ No newline at end of file
Property changes on:
trunk/test-applications/ajaxTest/src/test/resources/org/richfaces/logging.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/test-applications/ajaxTest/src/test/resources/repeater.xhtml
===================================================================
--- trunk/test-applications/ajaxTest/src/test/resources/repeater.xhtml
(rev 0)
+++ trunk/test-applications/ajaxTest/src/test/resources/repeater.xhtml 2008-11-14 04:09:52
UTC (rev 11161)
@@ -0,0 +1,15 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html">
+ <head><title>Simple repeater in seam</title></head>
+ <body>
+ <h:form id="ajaxForm">
+ <h:inputText id="text" value="#{bean.text}">
+ <a4j:support reRender="out"
event="onclick"></a4j:support>
+ </h:inputText>
+ <h:outputText id="out"
value="#{bean.text}"></h:outputText>
+ </h:form>
+ </body>
+</html>
Property changes on: trunk/test-applications/ajaxTest/src/test/resources/repeater.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain