JBoss Rich Faces SVN: r12562 - in trunk/test-applications/regressionArea: regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues and 12 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-02-04 11:31:38 -0500 (Wed, 04 Feb 2009)
New Revision: 12562
Added:
trunk/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf5849/
trunk/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf5849/Bean.java
trunk/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf5933/
trunk/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf5933/Bean.java
trunk/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf6035/
trunk/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf6035/Bean.java
trunk/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf5849/
trunk/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf5849/Test.java
trunk/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf5933/
trunk/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf5933/Test.java
trunk/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf6035/
trunk/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf6035/Test.java
trunk/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf5849.xhtml
trunk/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf5933.xhtml
trunk/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf6035.xhtml
Removed:
trunk/test-applications/regressionArea/Test.bat
trunk/test-applications/regressionArea/build.bat
Modified:
trunk/test-applications/regressionArea/readMe.txt
trunk/test-applications/regressionArea/regressionArea-ejb/src/main/resources/META-INF/MANIFEST.MF
trunk/test-applications/regressionArea/regressionArea-tests/
trunk/test-applications/regressionArea/regressionArea-tests/src/test/resources/testng.xml
trunk/test-applications/regressionArea/regressionArea-web/src/main/resources/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/RF-5849
https://jira.jboss.org/jira/browse/RF-5933
https://jira.jboss.org/jira/browse/RF-6035
Deleted: trunk/test-applications/regressionArea/Test.bat
===================================================================
--- trunk/test-applications/regressionArea/Test.bat 2009-02-04 16:22:31 UTC (rev 12561)
+++ trunk/test-applications/regressionArea/Test.bat 2009-02-04 16:31:38 UTC (rev 12562)
@@ -1,2 +0,0 @@
-cd /regressionArea-web
-mvn integration-test -P Test
\ No newline at end of file
Deleted: trunk/test-applications/regressionArea/build.bat
===================================================================
--- trunk/test-applications/regressionArea/build.bat 2009-02-04 16:22:31 UTC (rev 12561)
+++ trunk/test-applications/regressionArea/build.bat 2009-02-04 16:31:38 UTC (rev 12562)
@@ -1 +0,0 @@
-mvn clean install
\ No newline at end of file
Modified: trunk/test-applications/regressionArea/readMe.txt
===================================================================
--- trunk/test-applications/regressionArea/readMe.txt 2009-02-04 16:22:31 UTC (rev 12561)
+++ trunk/test-applications/regressionArea/readMe.txt 2009-02-04 16:31:38 UTC (rev 12562)
@@ -1,11 +1,5 @@
-1. Download JBOSS from \\Eltegra-pdc\INCOMING\amarkavtsov\. Unzip.
+1. Run mvn clean integration-test
-2. Open regressionArea/pom.xml file. Define there jboss home property.
-
-3. Launch 'build.bat' to build project.
-
-4. Launch 'Test.bat' to start selenium testing.
-
-----------------------------------------------------
Added: trunk/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf5849/Bean.java
===================================================================
--- trunk/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf5849/Bean.java (rev 0)
+++ trunk/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf5849/Bean.java 2009-02-04 16:31:38 UTC (rev 12562)
@@ -0,0 +1,45 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+package org.richfaces.regressionarea.issues.rf5849;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+/**
+ * This test case for: <a href="https://jira.jboss.org/jira/browse/RF-5849">RF-5849 -
+ * Ajax: timed out requests kill status</a>
+ *
+ * @author Nick Belaevski
+ * @since 3.3.1
+ */
+
+@Name("rf5849")
+(a)Scope(ScopeType.APPLICATION)
+public class Bean {
+
+ public void test() throws Exception {
+ System.out.println("rf5849.Bean.test()");
+ Thread.sleep(5000);
+ }
+}
Added: trunk/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf5933/Bean.java
===================================================================
--- trunk/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf5933/Bean.java (rev 0)
+++ trunk/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf5933/Bean.java 2009-02-04 16:31:38 UTC (rev 12562)
@@ -0,0 +1,45 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+package org.richfaces.regressionarea.issues.rf5933;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+/**
+ * This test case for: <a href="https://jira.jboss.org/jira/browse/RF-5933">RF-5933 -
+ * AJAX: oncomplete called for aborted timed out requests</a>
+ *
+ * @author Nick Belaevski
+ * @since 3.3.1
+ */
+
+@Name("rf5933")
+(a)Scope(ScopeType.APPLICATION)
+public class Bean {
+
+ public void test() throws Exception {
+ System.out.println("rf5993.Bean.test()");
+ Thread.sleep(5000);
+ }
+}
Added: trunk/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf6035/Bean.java
===================================================================
--- trunk/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf6035/Bean.java (rev 0)
+++ trunk/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf6035/Bean.java 2009-02-04 16:31:38 UTC (rev 12562)
@@ -0,0 +1,45 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+package org.richfaces.regressionarea.issues.rf6035;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+/**
+ * This test case for: <a href="https://jira.jboss.org/jira/browse/RF-6035">RF-6035 -
+ * Status: onstart and onstop aren't executed correctly</a>
+ *
+ * @author Nick Belaevski
+ * @since 3.3.1
+ */
+
+@Name("rf6035")
+(a)Scope(ScopeType.APPLICATION)
+public class Bean {
+
+ public void test() throws Exception {
+ System.out.println("rf6035.Bean.test()");
+ Thread.sleep(5000);
+ }
+}
Modified: trunk/test-applications/regressionArea/regressionArea-ejb/src/main/resources/META-INF/MANIFEST.MF
===================================================================
--- trunk/test-applications/regressionArea/regressionArea-ejb/src/main/resources/META-INF/MANIFEST.MF 2009-02-04 16:22:31 UTC (rev 12561)
+++ trunk/test-applications/regressionArea/regressionArea-ejb/src/main/resources/META-INF/MANIFEST.MF 2009-02-04 16:31:38 UTC (rev 12562)
@@ -1,10 +1,10 @@
Manifest-Version: 1.0
Class-Path: bsh-1.3.0.jar commons-beanutils-1.7.0.jar commons-collecti
- ons-3.2.jar commons-digester-1.8.jar commons-lang-2.3.jar commons-log
+ ons-3.2.jar commons-digester-2.0.jar commons-lang-2.3.jar commons-log
ging-1.0.4.jar dom4j-1.6.1-brew.jar el-api-1.0.jar jboss-el-1.0_02.CR
- 2.jar jboss-seam-2.1.0.SP1.jar jboss-seam-debug-2.1.0.SP1.jar jboss-s
- eam-jul-2.1.0.SP1.jar jboss-seam-remoting-2.1.0.SP1.jar jboss-seam-ui
- -2.1.0.SP1.jar jsf-api-1.2_10.jar jsf-facelets-1.1.15.B1.jar jsf-impl
- -1.2_10.jar log4j-1.2.14.jar richfaces-api-3.3.0-SNAPSHOT.jar richfac
- es-impl-3.3.0-SNAPSHOT.jar richfaces-ui-3.3.0-SNAPSHOT.jar
+ 2.jar jboss-seam-2.1.1.GA.jar jboss-seam-debug-2.1.1.GA.jar jboss-sea
+ m-jul-2.1.1.GA.jar jboss-seam-remoting-2.1.1.GA.jar jboss-seam-ui-2.1
+ .1.GA.jar jsf-api-1.2_11.jar jsf-facelets-1.1.15.B1.jar jsf-impl-1.2_
+ 11.jar log4j-1.2.14.jar richfaces-api-3.3.1-SNAPSHOT.jar richfaces-im
+ pl-3.3.1-SNAPSHOT.jar richfaces-ui-3.3.1-SNAPSHOT.jar
Property changes on: trunk/test-applications/regressionArea/regressionArea-tests
___________________________________________________________________
Name: svn:ignore
- target
+ target
test-output
.classpath
.project
.settings
bin
Added: trunk/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf5849/Test.java
===================================================================
--- trunk/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf5849/Test.java (rev 0)
+++ trunk/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf5849/Test.java 2009-02-04 16:31:38 UTC (rev 12562)
@@ -0,0 +1,64 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+package org.richfaces.testng.rf5849;
+
+import org.richfaces.SeleniumTestBase;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.1
+ */
+public class Test extends SeleniumTestBase {
+
+ private static final String STATUS = "status.";
+
+ private static final String STATUS_START = STATUS + "start";
+
+ private static final String STATUS_STOP = STATUS + "stop";
+
+ @org.testng.annotations.Test
+ public void testExecute() throws Exception {
+ renderPage();
+
+ AssertNotVisible(STATUS_START);
+ AssertVisible(STATUS_STOP);
+
+ clickById("execute");
+
+ AssertNotVisible(STATUS_STOP);
+ AssertVisible(STATUS_START);
+
+ waitForAjaxCompletion(10000);
+
+ AssertValueEquals("form:text", "3");
+
+ AssertNotVisible(STATUS_START);
+ AssertVisible(STATUS_STOP);
+ }
+
+
+ @Override
+ public String getTestUrl() {
+ return "pages/rf5849.xhtml";
+ }
+}
Added: trunk/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf5933/Test.java
===================================================================
--- trunk/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf5933/Test.java (rev 0)
+++ trunk/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf5933/Test.java 2009-02-04 16:31:38 UTC (rev 12562)
@@ -0,0 +1,56 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+package org.richfaces.testng.rf5933;
+
+import org.richfaces.SeleniumTestBase;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.1
+ */
+public class Test extends SeleniumTestBase {
+
+ private static final String STATUS = "status.";
+
+ private static final String STATUS_START = STATUS + "start";
+
+ private static final String STATUS_STOP = STATUS + "stop";
+
+ @org.testng.annotations.Test
+ public void testExecute() throws Exception {
+ renderPage();
+
+ AssertNotVisible(STATUS_START);
+ AssertVisible(STATUS_STOP);
+
+ clickById("execute");
+ waitForAjaxCompletion(8000);
+ AssertTextEquals("//*[@id = 'form:group']", "pass");
+ }
+
+
+ @Override
+ public String getTestUrl() {
+ return "pages/rf5933.xhtml";
+ }
+}
Added: trunk/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf6035/Test.java
===================================================================
--- trunk/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf6035/Test.java (rev 0)
+++ trunk/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf6035/Test.java 2009-02-04 16:31:38 UTC (rev 12562)
@@ -0,0 +1,49 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+package org.richfaces.testng.rf6035;
+
+import org.richfaces.SeleniumTestBase;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.1
+ */
+public class Test extends SeleniumTestBase {
+
+ @org.testng.annotations.Test
+ public void testExecute() throws Exception {
+ renderPage();
+
+ clickById("execute");
+
+ waitForAjaxCompletion(15000);
+ AssertTextEquals("//*[@id = 'form:starts']", "2");
+ AssertTextEquals("//*[@id = 'form:stops']", "2");
+ }
+
+
+ @Override
+ public String getTestUrl() {
+ return "pages/rf6035.xhtml";
+ }
+}
Modified: trunk/test-applications/regressionArea/regressionArea-tests/src/test/resources/testng.xml
===================================================================
--- trunk/test-applications/regressionArea/regressionArea-tests/src/test/resources/testng.xml 2009-02-04 16:22:31 UTC (rev 12561)
+++ trunk/test-applications/regressionArea/regressionArea-tests/src/test/resources/testng.xml 2009-02-04 16:31:38 UTC (rev 12562)
@@ -19,13 +19,18 @@
<parameter name="loadScriptStrategy" value="ALL"/>
<parameter name="filterPrefix" value="/faces/NEKO/"/>
<parameter name="browser" value="*firefox"/>
- <packages>
- <package name="org.richfaces.testng" />
- <package name="org.richfaces.testng.rf4507" />
- <package name="org.richfaces.testng.rf4709" />
- <package name="org.richfaces.testng.rf5264" />
- <package name="org.richfaces.testng.rf5851" />
- <package name="org.richfaces.testng.rf5948" />
- </packages>
- </test>
+
+ <packages>
+ <package name="org.richfaces.testng" />
+ <package name="org.richfaces.testng.rf4507" />
+ <package name="org.richfaces.testng.rf4709" />
+ <package name="org.richfaces.testng.rf5264" />
+ <package name="org.richfaces.testng.rf5849" />
+ <package name="org.richfaces.testng.rf5851" />
+ <package name="org.richfaces.testng.rf5948" />
+ <package name="org.richfaces.testng.rf5933" />
+ <package name="org.richfaces.testng.rf6035" />
+ </packages>
+
+ </test>
</suite>
Modified: trunk/test-applications/regressionArea/regressionArea-web/src/main/resources/META-INF/MANIFEST.MF
===================================================================
--- trunk/test-applications/regressionArea/regressionArea-web/src/main/resources/META-INF/MANIFEST.MF 2009-02-04 16:22:31 UTC (rev 12561)
+++ trunk/test-applications/regressionArea/regressionArea-web/src/main/resources/META-INF/MANIFEST.MF 2009-02-04 16:31:38 UTC (rev 12562)
@@ -1,6 +1,4 @@
Manifest-Version: 1.0
-Class-Path: avalon-framework-4.1.3.jar commons-beanutils-1.7.0.jar com
- mons-digester-1.8.jar commons-logging-1.1.jar jsf-facelets-1.1.14.jar
- log4j-1.2.14.jar logkit-1.0.1.jar richfaces-impl-3.3.0-SNAPSHOT.jar
- richfaces-ui-3.3.0-SNAPSHOT.jar servlet-api-2.4.jar
+Class-Path: commons-digester-2.0.jar jsf-facelets-1.1.14.jar richfaces
+ -impl-3.3.1-SNAPSHOT.jar richfaces-ui-3.3.1-SNAPSHOT.jar
Added: trunk/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf5849.xhtml
===================================================================
--- trunk/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf5849.xhtml (rev 0)
+++ trunk/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf5849.xhtml 2009-02-04 16:31:38 UTC (rev 12562)
@@ -0,0 +1,42 @@
+<!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:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+<ui:composition template="/layout/layout.xhtml">
+ <ui:define name="style">
+
+ </ui:define>
+ <ui:define name="template">
+ <h:form id="form">
+ <h:inputText id="text" />
+
+ <script type="text/javascript">
+ var counter = 0;
+ </script>
+
+ <a4j:status startText="...start..." stopText="stop" id="status" forceId="true"
+ onstart="#{rich:element('text')}.value = 'undefined'; counter++;"
+ onstop="#{rich:element('text')}.value = (counter + '')" />
+
+ <br />
+
+ <a4j:jsFunction timeout="10" action="#{rf5849.test}" status="status"
+ name="kill" eventsQueue="a" id="link0" />
+ <br />
+
+ <a4j:jsFunction timeout="10" action="#{rf5849.test}" status="status"
+ name="kill2" eventsQueue="a" id="link1" oncomplete="#{rich:element('text')}" />
+ <br />
+
+ <a4j:jsFunction name="normal" action="#{rf5849.test}" status="status"
+ eventsQueue="a" id="link2" />
+
+ <a id="execute" onclick="kill(); kill2(); normal(); return false;" href="#">execute</a>
+ </h:form>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Added: trunk/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf5933.xhtml
===================================================================
--- trunk/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf5933.xhtml (rev 0)
+++ trunk/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf5933.xhtml 2009-02-04 16:31:38 UTC (rev 12562)
@@ -0,0 +1,31 @@
+<!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:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+<ui:composition template="/layout/layout.xhtml">
+ <ui:define name="style">
+
+ </ui:define>
+ <ui:define name="template">
+ <h:form id="form">
+ <a4j:status startText="...start..." stopText="stop" id="status" forceId="true" /><br />
+
+ <h:panelGroup id="group"></h:panelGroup>
+
+ <script type="text/javascript">
+ function logResult(result) {
+ #{rich:element('group')}.appendChild(document.createTextNode(result ? "pass" : "fail"));
+ }
+ </script>
+
+ <a4j:jsFunction status="status" name="functionA" eventsQueue="a" similarityGroupingId="a" oncomplete="logResult(false)" timeout="100" action="#{rf5933.test}" />
+ <a4j:jsFunction status="status" name="functionB" eventsQueue="a" similarityGroupingId="a" ignoreDupResponses="true" oncomplete="logResult(true)" action="#{rf5933.test}" />
+ <a href="#" id="execute" onclick="functionA(); functionB();">Click here</a>
+ </h:form>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Added: trunk/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf6035.xhtml
===================================================================
--- trunk/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf6035.xhtml (rev 0)
+++ trunk/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf6035.xhtml 2009-02-04 16:31:38 UTC (rev 12562)
@@ -0,0 +1,35 @@
+<!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:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+<ui:composition template="/layout/layout.xhtml">
+ <ui:define name="style">
+
+ </ui:define>
+ <ui:define name="template">
+ <h:form id="form">
+ <script type="text/javascript">
+ var startsCount = 0;
+ var stopsCount = 0;
+ </script>
+
+ <a4j:status startText="...start..." stopText="stop"
+ onstart="#{rich:element('starts')}.innerHTML = (++startsCount + '')"
+ onstop="#{rich:element('stops')}.innerHTML = (++stopsCount + '')"
+ /><br />
+
+ Starts: <h:panelGroup id="starts" layout="block"></h:panelGroup>
+ Stops: <h:panelGroup id="stops" layout="block"></h:panelGroup>
+
+ <a4j:jsFunction name="functionA" action="#{rf6035.test}" />
+ <a4j:jsFunction name="functionB" action="#{rf6035.test}" />
+
+ <a href="#" onclick="functionA(); setTimeout(functionB, 500)" id="execute">click here</a>
+ </h:form>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
15 years, 11 months
JBoss Rich Faces SVN: r12561 - trunk/framework/impl/src/main/javascript/ajaxjsf.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-02-04 11:22:31 -0500 (Wed, 04 Feb 2009)
New Revision: 12561
Modified:
trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
Log:
https://jira.jboss.org/jira/browse/RF-5933
https://jira.jboss.org/jira/browse/RF-6035
Modified: trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
===================================================================
--- trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2009-02-04 15:08:24 UTC (rev 12560)
+++ trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2009-02-04 16:22:31 UTC (rev 12561)
@@ -142,8 +142,6 @@
this._timeoutID = window.setTimeout(function(){
LOG.warn("request stopped due to timeout");
- _this._oncomplete_aborted = _this._aborted;
-
if(!_this._aborted){
// A4J.AJAX.status(_this.containerId,_this.options.status,false);
if(typeof(A4J.AJAX.onAbort) == "function"){
@@ -170,6 +168,8 @@
},
abort: function(){
+ this._oncomplete_aborted = true;
+
if(!this._aborted){
if(typeof(A4J.AJAX.onAbort) == "function"){
A4J.AJAX.onAbort(this);
@@ -1285,30 +1285,39 @@
// on stop - inverse.
A4J.AJAX.status = function(regionID,targetID,start){
try {
- var elem;
targetID = targetID || regionID +":status";
A4J.AJAX._requestsCounts[targetID]=(A4J.AJAX._requestsCounts[targetID]||0)+(start?1:-1);
- if(A4J.AJAX._requestsCounts[targetID]>0){
- elem = document.getElementById(targetID+".stop");
- if(elem){elem.style.display="none";}
- elem = document.getElementById(targetID+".start");
- if(elem){
- elem.style.display="";
- if(typeof(elem.onstart) == 'function'){
- elem.onstart();
- }
+
+ var startElem = document.getElementById(targetID + ".start");
+ var stopElem = document.getElementById(targetID + ".stop");
+
+ if(A4J.AJAX._requestsCounts[targetID] > 0){
+ if (stopElem) {
+ stopElem.style.display = "none";
}
- }else{
- elem = document.getElementById(targetID+".start");
- if(elem){elem.style.display="none";}
- elem = document.getElementById(targetID+".stop");
- if(elem){
- elem.style.display="";
- if(typeof(elem.onstop) == 'function'){
- elem.onstop();
- }
+
+ if (startElem) {
+ startElem.style.display = "";
}
+ } else {
+ if (startElem) {
+ startElem.style.display = "none";
+ }
+
+ if (stopElem) {
+ stopElem.style.display = "";
+ }
}
+
+ if (start) {
+ if (startElem && (typeof(startElem.onstart) == 'function')) {
+ startElem.onstart();
+ }
+ } else {
+ if (stopElem && (typeof(stopElem.onstop) == 'function')) {
+ stopElem.onstop();
+ }
+ }
} catch(e){
LOG.error("Exception on status change: ");
}
15 years, 11 months
JBoss Rich Faces SVN: r12560 - Plan and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2009-02-04 10:08:24 -0500 (Wed, 04 Feb 2009)
New Revision: 12560
Modified:
trunk/test-applications/qa/Test Plan/Richfaces-Seam integration test plan.doc
Log:
Filter and filter-mapping configuration remove for pdf generation.
Modified: trunk/test-applications/qa/Test Plan/Richfaces-Seam integration test plan.doc
===================================================================
(Binary files differ)
15 years, 11 months
JBoss Rich Faces SVN: r12559 - in trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/Upload: amarkhel/Beach and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-02-04 07:41:52 -0500 (Wed, 04 Feb 2009)
New Revision: 12559
Modified:
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/Upload/admin/Nature/Rivers/
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/Upload/amarkhel/Beach/
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/Upload/amarkhel/Flowers/
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/Upload/amarkhel/Sport/
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/Upload/amarkhel/Travel/
Log:
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/Upload/admin/Nature/Rivers
___________________________________________________________________
Name: svn:ignore
+ *.db
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/Upload/amarkhel/Beach
___________________________________________________________________
Name: svn:ignore
+ *.db
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/Upload/amarkhel/Flowers
___________________________________________________________________
Name: svn:ignore
+ *.db
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/Upload/amarkhel/Sport
___________________________________________________________________
Name: svn:ignore
+ *.db
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/Upload/amarkhel/Travel
___________________________________________________________________
Name: svn:ignore
+ *.db
15 years, 11 months
JBoss Rich Faces SVN: r12558 - in trunk/test-applications/realworld: web/src/main/java/org/richfaces/realworld/fileupload and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-02-04 07:39:38 -0500 (Wed, 04 Feb 2009)
New Revision: 12558
Modified:
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ConversationState.java
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/pages.xml
Log:
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java 2009-02-04 12:12:42 UTC (rev 12557)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java 2009-02-04 12:39:38 UTC (rev 12558)
@@ -80,7 +80,7 @@
@Column(length = 1024)
private String description;
- @ManyToOne
+ @ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "ALBUM_USER_ID", referencedColumnName = "USER_ID")
private User owner;
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java 2009-02-04 12:12:42 UTC (rev 12557)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java 2009-02-04 12:39:38 UTC (rev 12558)
@@ -99,7 +99,7 @@
if (null == data) {
return;
}
- File imageResource = fileManager.getImage(fileManager.transformToServerPath(data.toString()));
+ File imageResource = fileManager.getImage(data.toString());
if (imageResource != null) {
FileInputStream fileInputStream = new FileInputStream(imageResource);
BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java 2009-02-04 12:12:42 UTC (rev 12557)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java 2009-02-04 12:39:38 UTC (rev 12558)
@@ -32,7 +32,7 @@
import org.richfaces.realworld.util.ConversationState;
@Name("albumManager")
-(a)Scope(ScopeType.SESSION)
+(a)Scope(ScopeType.PAGE)
public class AlbumManager {
@In @Out
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ConversationState.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ConversationState.java 2009-02-04 12:12:42 UTC (rev 12557)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ConversationState.java 2009-02-04 12:39:38 UTC (rev 12558)
@@ -37,7 +37,7 @@
import org.richfaces.realworld.service.Constants;
@Name("conversationState")
-(a)Scope(ScopeType.SESSION)
+(a)Scope(ScopeType.PAGE)
public class ConversationState implements Serializable{
private static final long serialVersionUID = 5656562187249324512L;
Modified: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/pages.xml
===================================================================
--- trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/pages.xml 2009-02-04 12:12:42 UTC (rev 12557)
+++ trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/pages.xml 2009-02-04 12:39:38 UTC (rev 12558)
@@ -8,6 +8,9 @@
<rule if-outcome="register">
<redirect view-id="/register.xhtml"/>
</rule>
+ <rule if-outcome="index">
+ <redirect view-id="/index.html"/>
+ </rule>
</navigation>
</page>
15 years, 11 months
JBoss Rich Faces SVN: r12557 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2009-02-04 07:12:42 -0500 (Wed, 04 Feb 2009)
New Revision: 12557
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/panelMenuGroup/panelMenuGroupAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PanelMenuGroupTest.java
Log:
https://jira.jboss.org/jira/browse/RF-5897
https://jira.jboss.org/jira/browse/RF-5905
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/panelMenuGroup/panelMenuGroupAutoTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PanelMenuGroupTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PanelMenuGroupTest.java 2009-02-04 09:35:33 UTC (rev 12556)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PanelMenuGroupTest.java 2009-02-04 12:12:42 UTC (rev 12557)
@@ -82,6 +82,22 @@
tester.testImmediateWithExternalValidationFailed();
}
+ @Test
+ public void testWithExternalValidationFailure(Template template) {
+ AutoTester autoTester = getAutoTester(this);
+ autoTester.renderPage(template, null);
+ writeStatus("Check component in case of external validation failure: listeners are not invoked, model is not updated");
+ autoTester.testExtrenalValidationFailure();
+ }
+
+ @Test
+ public void testBypassUpdatesAttribute(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+ writeStatus("Test component with bypassUpdates = true skips update model values phase");
+ tester.testBypassUpdate();
+ }
+
@Override
public void sendAjax() {
clickAjaxCommandAndWait("icon" + getAutoTester(this).getClientId(AutoTester.COMPONENT_ID));
15 years, 11 months
JBoss Rich Faces SVN: r12556 - Plan and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2009-02-04 04:35:33 -0500 (Wed, 04 Feb 2009)
New Revision: 12556
Added:
trunk/test-applications/qa/Test Plan/Richfaces-Seam integration test plan.doc
Log:
seam and richfaces integration plan.
Added: trunk/test-applications/qa/Test Plan/Richfaces-Seam integration test plan.doc
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/qa/Test Plan/Richfaces-Seam integration test plan.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 11 months
JBoss Rich Faces SVN: r12555 - in branches/jsf2.0: examples/repeater/src/main/java/javax and 9 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2009-02-03 16:12:47 -0500 (Tue, 03 Feb 2009)
New Revision: 12555
Added:
branches/jsf2.0/examples/repeater/src/main/java/javax/
branches/jsf2.0/examples/repeater/src/main/java/javax/faces/
branches/jsf2.0/examples/repeater/src/main/java/javax/faces/ajax/
branches/jsf2.0/examples/repeater/src/main/java/javax/faces/ajax/BehaviorRenderer.java
branches/jsf2.0/examples/repeater/src/main/java/javax/faces/ajax/ClientSideBehavior.java
Modified:
branches/jsf2.0/framework/jsf-test/pom.xml
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebConnection.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebResponse.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/AbstractServerResource.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/ClasspathServerResource.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/ServerResourcesDirectory.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StaggingJspApplicationContext.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingConnection.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpRequest.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpResponse.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpSession.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingServer.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingServletContext.java
branches/jsf2.0/framework/jsf-test/src/main/javadoc/org/richfaces/test/package.html
branches/jsf2.0/framework/jsf-test/src/main/javadoc/overview.html
branches/jsf2.0/framework/pom.xml
branches/jsf2.0/tests/ajax/pom.xml
Log:
Upgrade Jsf-Test dependencies, merge with trunk.
Added: branches/jsf2.0/examples/repeater/src/main/java/javax/faces/ajax/BehaviorRenderer.java
===================================================================
--- branches/jsf2.0/examples/repeater/src/main/java/javax/faces/ajax/BehaviorRenderer.java (rev 0)
+++ branches/jsf2.0/examples/repeater/src/main/java/javax/faces/ajax/BehaviorRenderer.java 2009-02-03 21:12:47 UTC (rev 12555)
@@ -0,0 +1,26 @@
+/**
+ *
+ */
+package javax.faces.ajax;
+
+import javax.faces.context.FacesContext;
+
+/**
+ * @author asmirnov
+ *
+ */
+public interface BehaviorRenderer {
+
+ /**
+ * @param context
+ * @param behavior
+ */
+ public void decode(FacesContext context, ClientSideBehavior behavior);
+
+ /**
+ * @param context
+ * @param behavior
+ * @return
+ */
+ public String getCode(FacesContext context, ClientSideBehavior behavior);
+}
Property changes on: branches/jsf2.0/examples/repeater/src/main/java/javax/faces/ajax/BehaviorRenderer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jsf2.0/examples/repeater/src/main/java/javax/faces/ajax/ClientSideBehavior.java
===================================================================
--- branches/jsf2.0/examples/repeater/src/main/java/javax/faces/ajax/ClientSideBehavior.java (rev 0)
+++ branches/jsf2.0/examples/repeater/src/main/java/javax/faces/ajax/ClientSideBehavior.java 2009-02-03 21:12:47 UTC (rev 12555)
@@ -0,0 +1,42 @@
+/**
+ *
+ */
+package javax.faces.ajax;
+
+import java.io.Serializable;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author asmirnov
+ *
+ */
+public interface ClientSideBehavior extends Serializable {
+ /**
+ * This method called during the Ajaxifiable#addAjaxBehavior(String eventName, AjaxBehavior behavior)
+ * to inform behavior implementation for that component it belongs to.
+ * @param component
+ */
+ public void setComponent(UIComponent component);
+
+ /**
+ * @return component for which behavior belongs.
+ */
+ public UIComponent getComponent();
+
+ /**
+ * Create client-side listener call body. In the common case, behavior should delegate this call to its renderer.
+ * @param context current JSF context
+ * @return client-side function call body.
+ */
+ public String getCode(FacesContext context);
+
+ /**
+ * Return renderer for the this behavior. implementation should get appropriate renderer
+ * from the current RenderKit by randerer type.
+ * @param context
+ * @return corresponding renderer instance from the current RenderKit.
+ */
+ public BehaviorRenderer getRenderer(FacesContext context);
+}
Property changes on: branches/jsf2.0/examples/repeater/src/main/java/javax/faces/ajax/ClientSideBehavior.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: branches/jsf2.0/framework/jsf-test/pom.xml
===================================================================
--- branches/jsf2.0/framework/jsf-test/pom.xml 2009-02-03 16:34:38 UTC (rev 12554)
+++ branches/jsf2.0/framework/jsf-test/pom.xml 2009-02-03 21:12:47 UTC (rev 12555)
@@ -20,24 +20,19 @@
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
- <version>2.3</version>
+ <version>2.4</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>2.0.0-b05</version>
+ <version>2.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
- <artifactId>mojarra-jsf-impl</artifactId>
+ <artifactId>jsf-impl</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
<dependency>
- <groupId>el-impl</groupId>
- <artifactId>el-impl</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
@@ -45,7 +40,7 @@
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit-core-js</artifactId>
- <version>2.2</version>
+ <version>2.4</version>
</dependency>
<dependency>
<groupId>net.sourceforge.cssparser</groupId>
@@ -70,14 +65,30 @@
<dependency>
<groupId>net.sourceforge.nekohtml</groupId>
<artifactId>nekohtml</artifactId>
- <version>1.9.9</version>
+ <version>1.9.11</version>
+ <exclusions>
+ <exclusion>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ <!--
+ <exclusion> <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId> </exclusion>
+ -->
+ </exclusions>
+
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
- <version>1.0</version>
+ <version>1.2</version>
</dependency>
<dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-ri</artifactId>
+ <version>1.2</version>
+ </dependency>
+ <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
@@ -97,10 +108,27 @@
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
</dependency>
- <dependency>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- <version>2.7.0</version>
- </dependency>
+ <dependency>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ <version>2.7.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>de.berlios.jsunit</groupId>
+ <artifactId>jsunit</artifactId>
+ <version>1.3</version>
+ <exclusions>
+ <exclusion>
+ <groupId>rhino</groupId>
+ <artifactId>js</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebConnection.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebConnection.java 2009-02-03 16:34:38 UTC (rev 12554)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebConnection.java 2009-02-03 21:12:47 UTC (rev 12555)
@@ -5,8 +5,6 @@
import java.io.IOException;
-import javax.servlet.ServletException;
-
import org.apache.commons.httpclient.NameValuePair;
import org.richfaces.test.staging.HttpMethod;
import org.richfaces.test.staging.StagingConnection;
@@ -59,7 +57,8 @@
if(null != body && FormEncodingType.URL_ENCODED.getName().equals(contentType)){
connection.parseFormParameters(body);
}
+ long startTime = System.currentTimeMillis();
connection.execute();
- return new LocalWebResponse(settings,connection);
+ return new LocalWebResponse(settings,connection,System.currentTimeMillis()-startTime);
}
}
\ No newline at end of file
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebResponse.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebResponse.java 2009-02-03 16:34:38 UTC (rev 12554)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebResponse.java 2009-02-03 21:12:47 UTC (rev 12555)
@@ -6,6 +6,7 @@
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
@@ -39,16 +40,21 @@
*
*/
public class LocalWebResponse implements WebResponse {
+
private WebRequestSettings settings;
+
private final StagingConnection serverConnection;
+
+ private final long loadTime;
- public LocalWebResponse(StagingConnection serverConnection) {
+ public LocalWebResponse(StagingConnection serverConnection,long l) {
this.serverConnection = serverConnection;
+ this.loadTime = l;
}
public LocalWebResponse(WebRequestSettings settings,
- StagingConnection connection) {
- this(connection);
+ StagingConnection connection, long l) {
+ this(connection,l);
this.settings = settings;
}
@@ -90,7 +96,7 @@
* com.gargoylesoftware.htmlunit.WebResponse#getLoadTimeInMilliSeconds()
*/
public long getLoadTimeInMilliSeconds() {
- return 0;
+ return loadTime;
}
/*
@@ -179,7 +185,46 @@
headers.add(new NameValuePair(entry.getKey(), value));
}
}
- ;
+ int contentLength = serverConnection.getResponseContentLength();
+ if(contentLength>=0){
+ headers.add(new NameValuePair("Content-Length", String.valueOf(contentLength)));
+ }
return headers;
}
+
+ /* (non-Javadoc)
+ * @see com.gargoylesoftware.htmlunit.WebResponse#getContentAsBytes()
+ */
+ public byte[] getContentAsBytes() {
+ return serverConnection.getResponseBody();
+ }
+
+ /* (non-Javadoc)
+ * @see com.gargoylesoftware.htmlunit.WebResponse#getContentAsString(java.lang.String)
+ */
+ public String getContentAsString(String encoding) {
+ byte[] body = serverConnection.getResponseBody();
+ String content;
+ try {
+ content = new String(body,encoding);
+ } catch (UnsupportedEncodingException e) {
+ content = new String(body);
+ }
+ return content;
+ }
+
+ /* (non-Javadoc)
+ * @see com.gargoylesoftware.htmlunit.WebResponse#getLoadTime()
+ */
+ public long getLoadTime() {
+ return loadTime;
+ }
+
+ /* (non-Javadoc)
+ * @see com.gargoylesoftware.htmlunit.WebResponse#getRequestUrl()
+ */
+ public URL getRequestUrl() {
+ // TODO Auto-generated method stub
+ return serverConnection.getUrl();
+ }
}
\ No newline at end of file
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/AbstractServerResource.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/AbstractServerResource.java 2009-02-03 16:34:38 UTC (rev 12554)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/AbstractServerResource.java 2009-02-03 21:12:47 UTC (rev 12555)
@@ -4,7 +4,6 @@
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
-import java.util.Collections;
import java.util.Set;
import java.util.logging.Logger;
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/ClasspathServerResource.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/ClasspathServerResource.java 2009-02-03 16:34:38 UTC (rev 12554)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/ClasspathServerResource.java 2009-02-03 21:12:47 UTC (rev 12555)
@@ -7,7 +7,9 @@
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.richfaces.test.TestException;
+
/**
* This class represents file from classpath in the virtual web application
* content.
@@ -51,8 +53,11 @@
.getContextClassLoader();
if (null == classLoader) {
classLoader = this.getClass().getClassLoader();
+ }
+ url = classLoader.getResource(classpath);
+ if(null == url){
+ throw new TestException("Virtual server resource can't be loaded from "+classpath);
}
- url = classLoader.getResource(classpath);
}
}
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/ServerResourcesDirectory.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/ServerResourcesDirectory.java 2009-02-03 16:34:38 UTC (rev 12554)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/ServerResourcesDirectory.java 2009-02-03 21:12:47 UTC (rev 12555)
@@ -6,7 +6,6 @@
import java.io.InputStream;
import java.net.URL;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.Map;
import java.util.Set;
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StaggingJspApplicationContext.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StaggingJspApplicationContext.java 2009-02-03 16:34:38 UTC (rev 12554)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StaggingJspApplicationContext.java 2009-02-03 21:12:47 UTC (rev 12555)
@@ -9,21 +9,35 @@
import javax.servlet.ServletContext;
import javax.servlet.jsp.JspApplicationContext;
-import com.sun.el.ExpressionFactoryImpl;
+import org.richfaces.test.TestException;
+
/**
* @author asmirnov
*
*/
public class StaggingJspApplicationContext implements JspApplicationContext {
+ private static final String DEFAULT_EXPRESSION_FACTORY="com.sun.el.ExpressionFactoryImpl";
+
private final ExpressionFactory expressionFactory ;
private final ServletContext servletContext;
public StaggingJspApplicationContext(ServletContext servletContext) {
this.servletContext = servletContext;
- expressionFactory = ExpressionFactory.newInstance();
+ String elFactoryClass = servletContext.getInitParameter("com.sun.faces.expressionFactory");
+ if(null == elFactoryClass){
+ elFactoryClass = servletContext.getInitParameter("com.sun.el.ExpressionFactoryImpl");
+ }
+ if(null == elFactoryClass){
+ elFactoryClass = DEFAULT_EXPRESSION_FACTORY;
+ }
+ try {
+ expressionFactory = Class.forName(elFactoryClass).asSubclass(ExpressionFactory.class).newInstance();
+ } catch (Exception e) {
+ throw new TestException("Couldn't instantiate EL expression factory",e);
+ }
}
/* (non-Javadoc)
@@ -37,7 +51,6 @@
* @see javax.servlet.jsp.JspApplicationContext#addELResolver(javax.el.ELResolver)
*/
public void addELResolver(ELResolver resolver) {
-
}
/* (non-Javadoc)
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingConnection.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingConnection.java 2009-02-03 16:34:38 UTC (rev 12554)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingConnection.java 2009-02-03 21:12:47 UTC (rev 12555)
@@ -150,17 +150,17 @@
return started;
}
- private void checkStarted() {
- if (!isFinished()) {
- throw new TestException("request have not been started");
- }
- }
+// private void checkStarted() {
+// if (!isFinished()) {
+// throw new TestException("request have not been started");
+// }
+// }
- private void checkNotStarted() {
- if (isStarted()) {
- throw new TestException("request was started, no parameters changes allowed");
- }
- }
+// private void checkNotStarted() {
+// if (isStarted()) {
+// throw new TestException("request was started, no parameters changes allowed");
+// }
+// }
/**
* Execute this connection request on the associated servlet or filter chain.
@@ -215,11 +215,9 @@
* Set request HTTP methos ( GET, POST etc ).
* @param method
* the method to set
- * @throws TestException
- * if connection have already been started.
*/
public void setRequestMethod(HttpMethod method) {
- checkNotStarted();
+// checkNotStarted();
this.method = method;
}
@@ -235,11 +233,9 @@
* Append additional request parameter.
* @param name
* @param value
- * @throws TestException
- * if connection have already been started.
*/
public void addRequestParameter(String name, String value) {
- checkNotStarted();
+// checkNotStarted();
String[] values = requestParameters.get(name);
if (null == values) {
values = new String[1];
@@ -256,10 +252,10 @@
* Get content of the response as String.
* @return content of the response writer or String created from the ServletOutputStream with current response encoding.
* @throws TestException
- * if connection have not been started or response has an unsupported encoding.
+ * if has an unsupported encoding.
*/
public String getContentAsString() {
- checkStarted();
+// checkStarted();
String content = response.getWriterContent();
if (null == content) {
byte[] streamContent = response.getStreamContent();
@@ -283,10 +279,10 @@
* Get content of the response as byte array.
* @return content of the ServletOutputStream or convert String, collected by response writer, with current response encoding.
* @throws TestException
- * if connection have not been started or response has unsupported encoding.
+ * if response has unsupported encoding.
*/
public byte[] getResponseBody() {
- checkStarted();
+// checkStarted();
byte[] content = response.getStreamContent();
if (null == content) {
String writerContent = response.getWriterContent();
@@ -330,41 +326,33 @@
/**
* @return encoding used to write response.
- * @throws TestException
- * if connection have not been started .
*/
public String getResponseCharacterEncoding() {
- checkStarted();
+// checkStarted();
return response.getCharacterEncoding();
}
/**
* @return content type ( eg 'text/html' ) of the response.
- * @throws TestException
- * if connection have not been started .
*/
public String getResponseContentType() {
- checkStarted();
+// checkStarted();
return response.getContentType();
}
/**
* @return HTTP status code of the response.
- * @throws TestException
- * if connection have not been started .
*/
public int getResponseStatus() {
- checkStarted();
+// checkStarted();
return response.getStatus();
}
/**
* @return HTTP error message.
- * @throws TestException
- * if connection have not been started .
*/
public String getErrorMessage() {
- checkStarted();
+// checkStarted();
return response.getErrorMessage();
}
@@ -372,11 +360,9 @@
* Set request Query string. This method does not parse query string, {@link #parseFormParameters(String)} should be used.
* @param queryString
* the queryString to set
- * @throws TestException
- * if connection have already been started .
*/
public void setQueryString(String queryString) {
- checkNotStarted();
+// checkNotStarted();
this.queryString = queryString;
}
@@ -390,11 +376,9 @@
/**
* Get HTTP response headers.
* @return headers name-values map.
- * @throws TestException
- * if connection have not been started .
*/
public Map<String, String[]> getResponseHeaders() {
- checkStarted();
+// checkStarted();
return response.getHeaders();
}
@@ -404,7 +388,7 @@
* @throws UnsupportedEncodingException
*/
public void setRequestCharacterEncoding(String charset) throws UnsupportedEncodingException {
- checkNotStarted();
+// checkNotStarted();
request.setCharacterEncoding(charset);
}
@@ -413,7 +397,7 @@
* @param body
*/
public void setRequestBody(String body) {
- checkNotStarted();
+// checkNotStarted();
request.setRequestBody(body);
}
@@ -422,7 +406,7 @@
* @param contentType
*/
public void setRequestContentType(String contentType) {
- checkNotStarted();
+// checkNotStarted();
request.setContentType(contentType);
}
@@ -432,7 +416,7 @@
* @param headers
*/
public void addRequestHeaders(Map<String, String> headers) {
- checkNotStarted();
+// checkNotStarted();
request.addHeaders(headers);
}
@@ -633,4 +617,8 @@
}
+ public int getResponseContentLength() {
+ return response.getContentLength();
+ }
+
}
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpRequest.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpRequest.java 2009-02-03 16:34:38 UTC (rev 12554)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpRequest.java 2009-02-03 21:12:47 UTC (rev 12555)
@@ -15,7 +15,6 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
-import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Locale;
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpResponse.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpResponse.java 2009-02-03 16:34:38 UTC (rev 12554)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpResponse.java 2009-02-03 21:12:47 UTC (rev 12555)
@@ -7,22 +7,15 @@
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
-import java.text.DateFormat;
-import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
-import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.logging.Logger;
import javax.servlet.ServletOutputStream;
-import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
-import org.apache.commons.httpclient.HttpStatus;
-import org.junit.internal.matchers.SubstringMatcher;
-
/**
* @author asmirnov
*
@@ -53,6 +46,8 @@
private String contentType="text";
+ private int contentLength = Integer.MIN_VALUE;
+
private String encoding = StagingHttpRequest.UTF8;
@@ -404,8 +399,7 @@
* @see javax.servlet.ServletResponse#setContentLength(int)
*/
public void setContentLength(int len) {
- // TODO Auto-generated method stub
- log.info("unimplemented response method setContentLenght");
+ this.contentLength = len;
}
/*
@@ -449,6 +443,13 @@
}
/**
+ * @return the contentLength
+ */
+ int getContentLength() {
+ return contentLength;
+ }
+
+ /**
* @return the redirectLocation
*/
String getRedirectLocation() {
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpSession.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpSession.java 2009-02-03 16:34:38 UTC (rev 12554)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpSession.java 2009-02-03 21:12:47 UTC (rev 12555)
@@ -4,14 +4,11 @@
package org.richfaces.test.staging;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collections;
import java.util.Enumeration;
-import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
-import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionBindingEvent;
import javax.servlet.http.HttpSessionBindingListener;
@@ -21,6 +18,7 @@
* @author asmirnov
*
*/
+@SuppressWarnings("deprecation")
abstract class StagingHttpSession implements HttpSession {
private static final int DEFAULT_INACTIVE_TIME = 30;
@@ -119,7 +117,6 @@
*
* @see javax.servlet.http.HttpSession#getSessionContext()
*/
- @SuppressWarnings("deprecation")
public HttpSessionContext getSessionContext() {
throw new NotImplementedException("Session context is not implemented");
}
@@ -151,7 +148,7 @@
*/
public void invalidate() {
checkValid();
- unboundAttributes();
+ destroy();
this.valid=false;
}
@@ -168,7 +165,6 @@
*/
public boolean isNew() {
checkValid();
- // TODO Auto-generated method stub
return false;
}
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingServer.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingServer.java 2009-02-03 16:34:38 UTC (rev 12554)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingServer.java 2009-02-03 21:12:47 UTC (rev 12555)
@@ -13,6 +13,7 @@
import java.util.Enumeration;
import java.util.EventListener;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
@@ -44,17 +45,19 @@
import org.richfaces.test.TestException;
/**
- * This class implements limited Http servlet container 2.5 functionality. It is designed for a test purposes only ,so that has a limitations:
+ * This class implements limited Http servlet container 2.5 functionality. It is
+ * designed for a test purposes only ,so that has a limitations:
* <ul>
* <li>supports local calls only.</li>
* <li>java code only configuration ( no xml files processed ).</li>
* <li>just one web application, 'deployed' in the root context.</li>
* <li>only one client session</li>
* <li>communicates by the local java calls only, no network connection</li>
- * <li>no JSP compilator support ( but it is possible to register pre-compiled pages as servlets)</li>
+ * <li>no JSP compilator support ( but it is possible to register pre-compiled
+ * pages as servlets)</li>
* <li>...</li>
* </ul>
- * It is main part of the test framework.
+ * It is main part of the test framework.
*
*/
public class StagingServer {
@@ -73,7 +76,8 @@
private final List<RequestChain> servlets = new ArrayList<RequestChain>();
- private RequestChain defaultServlet= new ServletContainer(null, new StaticServlet());
+ private RequestChain defaultServlet = new ServletContainer(null,
+ new StaticServlet());
private final List<EventListener> contextListeners = new ArrayList<EventListener>();
@@ -89,16 +93,22 @@
private ServletContext contextProxy;
- private ServerHttpSession session=null;
+ private HttpSession currentSession = null;
+
+ private ThreadLocal<HttpSession> sessions = new ThreadLocal<HttpSession>();
+
+ private List<ServerHttpSession> sessionInstances = new ArrayList<ServerHttpSession>();
+
+ private boolean sessionPerThread = false;
- private HttpSession sessionProxy=null;
- private boolean initialised=false;
+ private boolean initialised = false;
/**
* This inner class links ServletContext calls to the server instance.
+ *
* @author asmirnov
- *
+ *
*/
private class LocalContext extends StagingServletContext {
@@ -116,8 +126,12 @@
return mimeTypes.get(file);
}
- /* (non-Javadoc)
- * @see org.richfaces.test.staging.StagingServletContext#valueBound(javax.servlet.ServletContextAttributeEvent)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.richfaces.test.staging.StagingServletContext#valueBound(javax
+ * .servlet.ServletContextAttributeEvent)
*/
@Override
protected void valueBound(ServletContextAttributeEvent event) {
@@ -130,8 +144,12 @@
}
}
- /* (non-Javadoc)
- * @see org.richfaces.test.staging.StagingServletContext#valueReplaced(javax.servlet.ServletContextAttributeEvent)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.richfaces.test.staging.StagingServletContext#valueReplaced(javax
+ * .servlet.ServletContextAttributeEvent)
*/
@Override
protected void valueReplaced(ServletContextAttributeEvent event) {
@@ -144,8 +162,12 @@
}
}
- /* (non-Javadoc)
- * @see org.richfaces.test.staging.StagingServletContext#valueUnbound(javax.servlet.ServletContextAttributeEvent)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.richfaces.test.staging.StagingServletContext#valueUnbound(javax
+ * .servlet.ServletContextAttributeEvent)
*/
@Override
protected void valueUnbound(ServletContextAttributeEvent event) {
@@ -158,8 +180,12 @@
}
}
- /* (non-Javadoc)
- * @see org.richfaces.test.staging.StagingServletContext#getServerResource(java.lang.String)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.richfaces.test.staging.StagingServletContext#getServerResource
+ * (java.lang.String)
*/
@Override
protected ServerResource getServerResource(String path) {
@@ -170,20 +196,27 @@
/**
* This inner class links session object calls to the server instance.
+ *
* @author asmirnov
- *
+ *
*/
private class ServerHttpSession extends StagingHttpSession {
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see javax.servlet.http.HttpSession#getServletContext()
*/
public ServletContext getServletContext() {
return context;
}
- /* (non-Javadoc)
- * @see org.richfaces.test.staging.StagingHttpSession#valueBound(javax.servlet.http.HttpSessionBindingEvent)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.richfaces.test.staging.StagingHttpSession#valueBound(javax.servlet
+ * .http.HttpSessionBindingEvent)
*/
@Override
protected void valueBound(
@@ -197,8 +230,12 @@
});
}
- /* (non-Javadoc)
- * @see org.richfaces.test.staging.StagingHttpSession#valueUnbound(javax.servlet.http.HttpSessionBindingEvent)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.richfaces.test.staging.StagingHttpSession#valueUnbound(javax.
+ * servlet.http.HttpSessionBindingEvent)
*/
@Override
protected void valueUnbound(
@@ -212,8 +249,12 @@
});
}
- /* (non-Javadoc)
- * @see org.richfaces.test.staging.StagingHttpSession#valueReplaced(javax.servlet.http.HttpSessionBindingEvent)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.richfaces.test.staging.StagingHttpSession#valueReplaced(javax
+ * .servlet.http.HttpSessionBindingEvent)
*/
@Override
protected void valueReplaced(
@@ -226,6 +267,12 @@
}
});
}
+
+ @Override
+ public void invalidate() {
+ super.invalidate();
+ setCurrentSession(null);
+ }
}
/**
@@ -239,11 +286,13 @@
invoker.invoke((T) listener);
}
}
+
+
}
/**
- * Append executable server object ( {@link Filter} or {@link Servlet}
- * to the server.
+ * Append executable server object ( {@link Filter} or {@link Servlet} to
+ * the server.
*
* @param servlet
*/
@@ -268,8 +317,9 @@
*
* @param path
* request path relative to web application context.
- * @return Appropriate Filter or Servlet executable object to serve given request. If no servlet was registered for the given path,
- * try to send requested object directly.
+ * @return Appropriate Filter or Servlet executable object to serve given
+ * request. If no servlet was registered for the given path, try to
+ * send requested object directly.
*/
public RequestChain getServlet(String path) {
RequestChain result = null;
@@ -288,7 +338,7 @@
result = defaultServlet;
}
} catch (MalformedURLException e) {
- log.warning("Mailformed request URL "+e.getMessage());
+ log.warning("Mailformed request URL " + e.getMessage());
}
}
return result;
@@ -296,6 +346,7 @@
/**
* Add web application init parameter.
+ *
* @param name
* @param value
*/
@@ -304,7 +355,8 @@
}
/**
- * Add default mime type for serve files with given extension.
+ * Add default mime type for serve files with given extension.
+ *
* @param extension
* @param mimeType
*/
@@ -313,9 +365,14 @@
}
/**
- * Add java resource to the virtual web application content. This method makes all parent directories as needed.
- * @param path path to the file in the virtual web server.
- * @param resource path to the resource in the classpath, as required by the {@link ClassLoader#getResource(String)}.
+ * Add java resource to the virtual web application content. This method
+ * makes all parent directories as needed.
+ *
+ * @param path
+ * path to the file in the virtual web server.
+ * @param resource
+ * path to the resource in the classpath, as required by the
+ * {@link ClassLoader#getResource(String)}.
*/
public void addResource(String path, String resource) {
ServerResourcePath resourcePath = new ServerResourcePath(path);
@@ -324,9 +381,13 @@
}
/**
- * Add resource to the virtual veb application content. This method makes all parent directories as needed.
- * @param path path to the file in the virtual web server.
- * @param resource {@code URL} to the file content.
+ * Add resource to the virtual veb application content. This method makes
+ * all parent directories as needed.
+ *
+ * @param path
+ * path to the file in the virtual web server.
+ * @param resource
+ * {@code URL} to the file content.
*/
public void addResource(String path, URL resource) {
serverRoot.addResource(new ServerResourcePath(path),
@@ -334,9 +395,18 @@
}
/**
- * Add all resources from the directory to the virtual web application content.
- * @param path name of the target directory in the virtual web application. If no such directory exists, it will be created, as well as all parent directories as needed.
- * @param resource {@code URL} to the source directory or any file in the source directory. Only 'file' or 'jar' protocols are supported. If this parameter points to a file, it will be converted to a enclosing directory.
+ * Add all resources from the directory to the virtual web application
+ * content.
+ *
+ * @param path
+ * name of the target directory in the virtual web application.
+ * If no such directory exists, it will be created, as well as
+ * all parent directories as needed.
+ * @param resource
+ * {@code URL} to the source directory or any file in the source
+ * directory. Only 'file' or 'jar' protocols are supported. If
+ * this parameter points to a file, it will be converted to a
+ * enclosing directory.
*/
public void addResourcesFromDirectory(String path, URL resource) {
ServerResourcePath resourcePath = new ServerResourcePath(path);
@@ -357,10 +427,46 @@
}
/**
- * Internal method used by the {@link #addResourcesFromDirectory(String, URL)} to process 'file' protocol.
- * @param resource source directory.
- * @param baseDirectory target virtual directory.
+ * Add all files from the directory to the virtual web application
+ * content.
+ *
+ * @param path
+ * name of the target directory in the virtual web application.
+ * If no such directory exists, it will be created, as well as
+ * all parent directories as needed.
+ * @param resource
+ * {@code File} of the source directory or any file in the source
+ * directory. If this parameter points to a file, it will be converted to a
+ * enclosing directory.
*/
+ public void addResourcesFromDirectory(String path, File directory) {
+ ServerResourcePath resourcePath = new ServerResourcePath(path);
+ ServerResource baseDirectory = serverRoot.getResource(resourcePath);
+ if (null == baseDirectory) {
+ // Create target directory.
+ baseDirectory = new ServerResourcesDirectory();
+ serverRoot.addResource(resourcePath, baseDirectory);
+ }
+ if (!directory.isDirectory()) {
+ directory = directory.getParentFile();
+ }
+ try {
+ addFiles(baseDirectory, directory);
+ } catch (MalformedURLException e) {
+ throw new TestException(e);
+ }
+ }
+
+ /**
+ * Internal method used by the
+ * {@link #addResourcesFromDirectory(String, URL)} to process 'file'
+ * protocol.
+ *
+ * @param resource
+ * source directory.
+ * @param baseDirectory
+ * target virtual directory.
+ */
protected void addResourcesFromFile(URL resource,
ServerResource baseDirectory) {
File file = new File(resource.getPath());
@@ -375,9 +481,14 @@
}
/**
- * Internal method used by the {@link #addResourcesFromDirectory(String, URL)} to process 'jar' protocol.
- * @param resource URL to the any object in the source directory.
- * @param baseDirectory target virtual directory.
+ * Internal method used by the
+ * {@link #addResourcesFromDirectory(String, URL)} to process 'jar'
+ * protocol.
+ *
+ * @param resource
+ * URL to the any object in the source directory.
+ * @param baseDirectory
+ * target virtual directory.
*/
protected void addResourcesFromJar(URL resource,
ServerResource baseDirectory) {
@@ -402,14 +513,16 @@
}
} catch (IOException e) {
- throw new TestException("Error read Jar content",e);
+ throw new TestException("Error read Jar content", e);
} catch (URISyntaxException e) {
throw new TestException(e);
}
}
/**
- * Internal reccursive method process directory content and all subdirectories.
+ * Internal reccursive method process directory content and all
+ * subdirectories.
+ *
* @param baseDirectory
* @param file
* @throws MalformedURLException
@@ -435,8 +548,8 @@
/**
* Add web-application wide listenes, same as it is defined by the
- * <listener> element in the web.xml file for a real server.
- * Supported listener types:
+ * <listener> element in the web.xml file for a real server. Supported
+ * listener types:
* <ul>
* <li>{@link ServletContextListener}</li>
* <li>{@link ServletContextAttributeListener}</li>
@@ -445,7 +558,9 @@
* <li>{@link ServletRequestListener}</li>
* <li>{@link ServletRequestAttributeListener}</li>
* </ul>
- * @param listener web listener instance.
+ *
+ * @param listener
+ * web listener instance.
*/
public void addWebListener(EventListener listener) {
contextListeners.add(listener);
@@ -453,6 +568,7 @@
/**
* Getter method for 'interceptor' events listener.
+ *
* @return the invocationListener
*/
public InvocationListener getInvocationListener() {
@@ -460,8 +576,11 @@
}
/**
- * Set listener which gets events on all calls to any methods of the {@link ServletContext}, {@link HttpSession}, {@link HttpServletRequest}, {@link HttpServletResponse} instances
- * in the virtual server. this interceptor can be used to check internal calls in the tests .
+ * Set listener which gets events on all calls to any methods of the
+ * {@link ServletContext}, {@link HttpSession}, {@link HttpServletRequest},
+ * {@link HttpServletResponse} instances in the virtual server. this
+ * interceptor can be used to check internal calls in the tests .
+ *
* @param invocationListener
* the invocationListener to set
*/
@@ -470,8 +589,10 @@
}
/**
- * Create instance of the {@link InvocationHandler} for the proxy objects. This handler fire events to the
- * registered {@link InvocationListener} ( if present ) after target object method call.
+ * Create instance of the {@link InvocationHandler} for the proxy objects.
+ * This handler fire events to the registered {@link InvocationListener} (
+ * if present ) after target object method call.
+ *
* @return the invocationHandler
*/
InvocationHandler getInvocationHandler(final Object target) {
@@ -500,8 +621,35 @@
}
+ public boolean isSessionPerThread() {
+ return sessionPerThread;
+ }
+
+ public void setSessionPerThread(boolean sessionPerThread) {
+ this.sessionPerThread = sessionPerThread;
+ }
+
+
+ HttpSession getCurrentSession() {
+ if (isSessionPerThread()) {
+ return sessions.get();
+ } else {
+ return currentSession;
+ }
+ }
+
+ void setCurrentSession(HttpSession session) {
+ if (isSessionPerThread()) {
+ sessions.set(session);
+ } else {
+ this.currentSession=session;
+ }
+
+ }
+
/**
* Get virtual server session object. Create new one if necessary.
+ *
* @return instance of the virtual server session.
*/
public HttpSession getSession() {
@@ -509,60 +657,64 @@
}
/**
- *
- * Returns the current <code>HttpSession</code>
- * associated with this server or, if there is no
- * current session and <code>create</code> is true, returns
- * a new session. Staging server supports only one session per instance,
- * different clients for the same server instance does not supported.
- *
- * <p>If <code>create</code> is <code>false</code>
- * and the request has no valid <code>HttpSession</code>,
- * this method returns <code>null</code>.
- *
- *
- * @param create <code>true</code> to create
- * a new session for this request if necessary;
- * <code>false</code> to return <code>null</code>
- * if there's no current session
- *
- *
- * @return the <code>HttpSession</code> associated
- * with this server instance or <code>null</code> if
- * <code>create</code> is <code>false</code>
- * and the server has no session
- *
+ *
+ * Returns the current <code>HttpSession</code> associated with this server
+ * or, if there is no current session and <code>create</code> is true,
+ * returns a new session. Staging server supports only one session per
+ * instance, different clients for the same server instance does not
+ * supported.
+ *
+ * <p>
+ * If <code>create</code> is <code>false</code> and the request has no valid
+ * <code>HttpSession</code>, this method returns <code>null</code>.
+ *
+ *
+ * @param create
+ * <code>true</code> to create a new session for this request if
+ * necessary; <code>false</code> to return <code>null</code> if
+ * there's no current session
+ *
+ *
+ * @return the <code>HttpSession</code> associated with this server instance
+ * or <code>null</code> if <code>create</code> is <code>false</code>
+ * and the server has no session
+ *
*/
public synchronized HttpSession getSession(boolean create) {
- if(!initialised){
+ if (!initialised) {
throw new TestException("Staging server have not been initialised");
}
- if (null == this.session && create) {
- this.session = new ServerHttpSession();
+ HttpSession httpSession = this.getCurrentSession();
+ if (null == httpSession && create) {
+ ServerHttpSession sessionImpl = new ServerHttpSession();
// Create proxy objects.
ClassLoader loader = Thread.currentThread().getContextClassLoader();
if (null == loader) {
loader = this.getClass().getClassLoader();
}
- this.sessionProxy = (HttpSession) Proxy.newProxyInstance(loader,
+ httpSession = (HttpSession) Proxy.newProxyInstance(loader,
new Class[] { HttpSession.class },
- getInvocationHandler(session));
+ getInvocationHandler(sessionImpl));
+ setCurrentSession(httpSession);
// inform session listeners.
- final HttpSessionEvent event = new HttpSessionEvent(session);
+ final HttpSessionEvent event = new HttpSessionEvent(httpSession);
fireEvent(SESSION_LISTENER_CLASS,
new EventInvoker<HttpSessionListener>() {
public void invoke(HttpSessionListener listener) {
listener.sessionCreated(event);
}
});
+ sessionInstances.add(sessionImpl);
}
- return sessionProxy;
+ return httpSession;
}
/**
- * Virtual server initialization. This method creates instances of the {@link ServletContext}, {@link JspFactory},
- * informs {@link ServletContextListener} ind inits all {@link Filter} and {@link Servlet} instances.
- * It should be called from test setUp method to prepare testing environment.
+ * Virtual server initialization. This method creates instances of the
+ * {@link ServletContext}, {@link JspFactory}, informs
+ * {@link ServletContextListener} ind inits all {@link Filter} and
+ * {@link Servlet} instances. It should be called from test setUp method to
+ * prepare testing environment.
*/
public void init() {
log.info("Init staging server");
@@ -595,23 +747,27 @@
}
defaultServlet.init(context);
} catch (ServletException e) {
- throw new TestException("Servlet initialisation error ",e);
+ throw new TestException("Servlet initialisation error ", e);
}
this.initialised = true;
}
/**
- * Stop wirtual server. This method informs {@link ServletContextListener} ind inits all {@link Filter} and {@link Servlet} instances, as well remove all internal objects.
- * It should be called from the testt thearDown method to clean up testing environment.
- *
+ * Stop wirtual server. This method informs {@link ServletContextListener}
+ * ind inits all {@link Filter} and {@link Servlet} instances, as well
+ * remove all internal objects. It should be called from the testt thearDown
+ * method to clean up testing environment.
+ *
*/
public void destroy() {
- if(!initialised){
+ if (!initialised) {
throw new TestException("Staging server have not been initialised");
}
this.initialised = false;
// Destroy session
- if (null != this.session) {
+ // TODO - destroy all threads.
+ for (Iterator<ServerHttpSession> sessionIterator = sessionInstances.iterator(); sessionIterator.hasNext();) {
+ ServerHttpSession session = sessionIterator.next();
// inform session listeners.
final HttpSessionEvent event = new HttpSessionEvent(session);
fireEvent(SESSION_LISTENER_CLASS,
@@ -620,9 +776,10 @@
listener.sessionDestroyed(event);
}
});
- session.destroy();
- session = null;
+ session.invalidate();
+ sessionIterator.remove();
}
+ setCurrentSession(null);
// Inform listeners
final ServletContextEvent event = new ServletContextEvent(context);
fireEvent(CONTEXT_LISTENER_CLASS,
@@ -643,14 +800,18 @@
}
/**
- * Get virtual connection to the given URL. Even thought for an http request to the
- * external servers, only local connection to the virtual server will be created.
- * @param url request url.
- * @return local connection to the appropriate servlet in the virtual server.
+ * Get virtual connection to the given URL. Even thought for an http request
+ * to the external servers, only local connection to the virtual server will
+ * be created.
+ *
+ * @param url
+ * request url.
+ * @return local connection to the appropriate servlet in the virtual
+ * server.
* @throws {@link TestException} if no servlet found to process given URL.
*/
public StagingConnection getConnection(URL url) {
- if(!initialised){
+ if (!initialised) {
throw new TestException("Staging server have not been initialised");
}
return new StagingConnection(this, url);
@@ -658,10 +819,11 @@
/**
* Get instance of virtual web application context.
+ *
* @return context instance.
*/
public ServletContext getContext() {
- if(!initialised){
+ if (!initialised) {
throw new TestException("Staging server have not been initialised");
}
return contextProxy;
@@ -669,7 +831,9 @@
/**
* Inform {@link ServletRequestListener} instances. For internal use only.
- * @param request started request.
+ *
+ * @param request
+ * started request.
*/
void requestStarted(ServletRequest request) {
final ServletRequestEvent event = new ServletRequestEvent(context,
@@ -685,7 +849,9 @@
/**
* Inform {@link ServletRequestListener} instances. For internal use only.
- * @param request finished request.
+ *
+ * @param request
+ * finished request.
*/
void requestFinished(ServletRequest request) {
final ServletRequestEvent event = new ServletRequestEvent(context,
@@ -698,8 +864,7 @@
});
}
- void requestAttributeAdded(ServletRequest request, String name,
- Object o) {
+ void requestAttributeAdded(ServletRequest request, String name, Object o) {
final ServletRequestAttributeEvent event = new ServletRequestAttributeEvent(
context, request, name, o);
fireEvent(REQUEST_ATTRIBUTE_LISTENER_CLASS,
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingServletContext.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingServletContext.java 2009-02-03 16:34:38 UTC (rev 12554)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingServletContext.java 2009-02-03 21:12:47 UTC (rev 12555)
@@ -7,7 +7,6 @@
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
@@ -21,7 +20,6 @@
import javax.servlet.Servlet;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextAttributeEvent;
-import javax.servlet.ServletContextAttributeListener;
import javax.servlet.ServletException;
Modified: branches/jsf2.0/framework/jsf-test/src/main/javadoc/org/richfaces/test/package.html
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/javadoc/org/richfaces/test/package.html 2009-02-03 16:34:38 UTC (rev 12554)
+++ branches/jsf2.0/framework/jsf-test/src/main/javadoc/org/richfaces/test/package.html 2009-02-03 21:12:47 UTC (rev 12555)
@@ -5,6 +5,8 @@
<title>Insert title here</title>
</head>
<body>
-
+<p>This packcage contains <a href="AbstractFacesTest.html">AbstractFacesTest</a> class, wich can be used as a base point for all JSF-related test cases.</p>
+<p>The <a href="LocalWebClient.html">LocalWebClient</a> class, whether is subclass of the HtmlUnit <a href="http://htmlunit.sourceforge.net/apidocs/com/gargoylesoftware/htmlunit/Web...">WebClient</a> class used
+as client to the local staging server <a href="org/richfaces/test/staging/StagingServer.html">StagingServer</a>.</p>
</body>
</html>
\ No newline at end of file
Modified: branches/jsf2.0/framework/jsf-test/src/main/javadoc/overview.html
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/javadoc/overview.html 2009-02-03 16:34:38 UTC (rev 12554)
+++ branches/jsf2.0/framework/jsf-test/src/main/javadoc/overview.html 2009-02-03 21:12:47 UTC (rev 12555)
@@ -5,6 +5,25 @@
<title>Insert title here</title>
</head>
<body>
-
+<h1>Java web application testing framework</h1>
+<p>This is a testing framework desibned ( but not limited to ) for test JSF components and applications</p>
+<p>Though best strategy for alow-level black box testing is to use a Mock objects,
+ writing integration tests required a more real environment.
+ On the other hand, running tests on the real web, or, even more, full JEE server takes a lot of the resoures and has a own limitations.
+</p>
+<p>This framework designed as an intermediate solution. It contains <a href="org/richfaces/test/staging/StagingServer.html">staging Java Web server</a>, where is real
+ JSF framework running. This is at most Servlet 2.5 / JSP 2.1 compatible container, wich allows to run at most all JSF applications. But, in difference with real web container,
+ it is "in process" only server. That does not have network connector, session management, does not process any configuration files etc. Its advantage for a unit testing:
+ <ul>
+ <li>It has a minimal startup time, because no configuration files processed and no resource pools or other heavy objects created.</li>
+ <li>It is extremally flexible. It uses a 'virtual' web application content, that can be builded from any objects:
+ files, java resource, even dynamic classes those generate content 'on the fly'. Every test is able to use individual application content.</li>
+ <li>Not only content, but any other configuration aspects, like servlets, filters, configuration parameters can be changed from the test code.</li>
+ <li>Tests runs as a web server clients in the same JVM and thread as a server-side code does. It allows to inspect any objects on the both sides from the same code. No thread syncronisation is necessary in the test code.</li>
+ <li>It is possible to make test runs "inside" web request. For example, only one JSF lifecycle phase can be tested.
+ </ul>
+ <p>Other important part of the framework is <a href="org/richfaces/test/LocalWebClient.html">LocalWebClient</a>, subclass of the HtmlUnit <a href="http://htmlunit.sourceforge.net/apidocs/com/gargoylesoftware/htmlunit/Web...">WebClient</a>.
+ In difference with the original client it always making local call to the staging server instead of real network protocol use. This client allows to use all HtmlUnit HTML and JavaScript testing features, even client side JavaScript test runs.</p>
+ <p>To make tests are easest, we provide <a href="org/richfaces/test/AbstractFacesTest.html">the base abstract class</a> for a Junit test with set of the template method for a fine virtual server tuning.</p>
</body>
</html>
\ No newline at end of file
Modified: branches/jsf2.0/framework/pom.xml
===================================================================
--- branches/jsf2.0/framework/pom.xml 2009-02-03 16:34:38 UTC (rev 12554)
+++ branches/jsf2.0/framework/pom.xml 2009-02-03 21:12:47 UTC (rev 12555)
@@ -94,7 +94,7 @@
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>2.0.0-b05</version>
+ <version>2.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
Modified: branches/jsf2.0/tests/ajax/pom.xml
===================================================================
--- branches/jsf2.0/tests/ajax/pom.xml 2009-02-03 16:34:38 UTC (rev 12554)
+++ branches/jsf2.0/tests/ajax/pom.xml 2009-02-03 21:12:47 UTC (rev 12555)
@@ -65,7 +65,7 @@
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>2.0.0-b05</version>
+ <version>2.0.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.jvnet.wagon-svn</groupId>
@@ -75,7 +75,7 @@
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
- <artifactId>mojarra-jsf-impl</artifactId>
+ <artifactId>jsf-impl</artifactId>
<version>2.0.0-SNAPSHOT</version>
<scope>runtime</scope>
</dependency>
15 years, 11 months
JBoss Rich Faces SVN: r12554 - in trunk: test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues and 8 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-02-03 11:34:38 -0500 (Tue, 03 Feb 2009)
New Revision: 12554
Added:
trunk/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf5948/
trunk/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf5948/Bean.java
trunk/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf5851/
trunk/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf5851/Test.java
trunk/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf5948/
trunk/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf5948/Test.java
trunk/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf5851.xhtml
trunk/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf5948.xhtml
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
trunk/test-applications/regressionArea/regressionArea-tests/src/test/resources/testng.xml
trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/renderkit/html/SimpleTogglePanelRenderer.java
Log:
Menu Item: process attribute does not work
https://jira.jboss.org/jira/browse/RF-5851
SimpleTogglePanel: process attribute does not work.
https://jira.jboss.org/jira/browse/RF-5948
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2009-02-03 16:24:09 UTC (rev 12553)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2009-02-03 16:34:38 UTC (rev 12554)
@@ -566,7 +566,29 @@
}
return null;
}
+
+ public static void addProcessToAjaxContext(FacesContext facesContext, UIComponent uiComponent){
+ if (!(uiComponent instanceof AjaxComponent)) {
+ return;
+ }
+ AjaxComponent ajaxComponent = (AjaxComponent) uiComponent;
+ Set<String> toProcess = asSet(ajaxComponent.getProcess());
+
+ if (null != toProcess) {
+ HashSet<String> componentIdsToProcess = new HashSet<String>();
+ for (String componentId : toProcess) {
+ UIComponent component = RendererUtils.getInstance().
+ findComponentFor(uiComponent, componentId);
+
+ componentIdsToProcess.add( null == component ?
+ componentId : component.getClientId(facesContext));
+ }
+ AjaxContext.getCurrentInstance(facesContext)
+ .setAjaxAreasToProcess(componentIdsToProcess);
+ }
+ }
+
/**
* Get status area Id for given component.
*
Added: trunk/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf5948/Bean.java
===================================================================
--- trunk/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf5948/Bean.java (rev 0)
+++ trunk/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf5948/Bean.java 2009-02-03 16:34:38 UTC (rev 12554)
@@ -0,0 +1,27 @@
+package org.richfaces.regressionarea.issues.rf5948;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+@Name("rf5948")
+(a)Scope(ScopeType.APPLICATION)
+public class Bean {
+ private String text;
+
+ public String getText() {
+ return text;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ public String getDuplicateText() {
+ return getText();
+ }
+
+ public void setDuplicateText(String duplicateText) {
+ this.text = duplicateText;
+ }
+}
Added: trunk/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf5851/Test.java
===================================================================
--- trunk/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf5851/Test.java (rev 0)
+++ trunk/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf5851/Test.java 2009-02-03 16:34:38 UTC (rev 12554)
@@ -0,0 +1,34 @@
+package org.richfaces.testng.rf5851;
+
+import org.richfaces.SeleniumTestBase;
+
+
+public class Test extends SeleniumTestBase {
+
+ private static final String TEST_STR = "test_02";
+
+ private static final String FORM = "form";
+ private static final String FORM_OUT = FORM + ":out";
+ private static final String FORM_MENU_ITEM = FORM + ":menu";
+ private static final String FORM_IN = FORM + ":in";
+
+ @org.testng.annotations.Test
+ public void testBeyondMinimum() throws Exception {
+ renderPage();
+
+ AssertPresent(FORM_IN);
+ selenium.type(FORM_IN, TEST_STR);
+
+ AssertPresent(FORM_MENU_ITEM);
+ AssertPresent(FORM_OUT);
+ clickAjaxCommandAndWait(FORM_MENU_ITEM);
+
+ AssertValueEquals(FORM_OUT, TEST_STR);
+ }
+
+ @Override
+ public String getTestUrl() {
+ return "pages/rf5851.xhtml";
+ }
+}
+
Added: trunk/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf5948/Test.java
===================================================================
--- trunk/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf5948/Test.java (rev 0)
+++ trunk/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf5948/Test.java 2009-02-03 16:34:38 UTC (rev 12554)
@@ -0,0 +1,32 @@
+package org.richfaces.testng.rf5948;
+
+import org.richfaces.SeleniumTestBase;
+
+public class Test extends SeleniumTestBase {
+
+ private static final String TEST_STR = "test_01";
+
+ private static final String FORM = "form";
+ private static final String FORM_OUT = FORM + ":out";
+ private static final String FORM_PANEL = FORM + ":panel_header";
+ private static final String FORM_IN = FORM + ":in";
+
+ @org.testng.annotations.Test
+ public void testProcessAttr() throws Exception {
+ renderPage();
+
+ AssertPresent(FORM_IN);
+ selenium.type(FORM_IN, TEST_STR);
+
+ AssertPresent(FORM_PANEL);
+ AssertPresent(FORM_OUT);
+ clickAjaxCommandAndWait(FORM_PANEL);
+
+ AssertValueEquals(FORM_OUT, TEST_STR);
+ }
+
+ @Override
+ public String getTestUrl() {
+ return "pages/rf5948.xhtml";
+ }
+}
Modified: trunk/test-applications/regressionArea/regressionArea-tests/src/test/resources/testng.xml
===================================================================
--- trunk/test-applications/regressionArea/regressionArea-tests/src/test/resources/testng.xml 2009-02-03 16:24:09 UTC (rev 12553)
+++ trunk/test-applications/regressionArea/regressionArea-tests/src/test/resources/testng.xml 2009-02-03 16:34:38 UTC (rev 12554)
@@ -10,18 +10,22 @@
<package name="org.richfaces.testng.rf4507" />
<package name="org.richfaces.testng.rf4709" />
<package name="org.richfaces.testng.rf5264" />
+ <package name="org.richfaces.testng.rf5851" />
+ <package name="org.richfaces.testng.rf5948" />
</packages>
</test-->
<test name="FireFoxFunctionalTestsDANe">
<parameter name="loadStyleStrategy" value="DEFAULT"/>
<parameter name="loadScriptStrategy" value="ALL"/>
<parameter name="filterPrefix" value="/faces/NEKO/"/>
- <parameter name="browser" value="*firefox"/>
+ <parameter name="browser" value="*firefox"/>
<packages>
- <package name="org.richfaces.testng" />
+ <package name="org.richfaces.testng" />
<package name="org.richfaces.testng.rf4507" />
<package name="org.richfaces.testng.rf4709" />
<package name="org.richfaces.testng.rf5264" />
- </packages>
+ <package name="org.richfaces.testng.rf5851" />
+ <package name="org.richfaces.testng.rf5948" />
+ </packages>
</test>
</suite>
Added: trunk/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf5851.xhtml
===================================================================
--- trunk/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf5851.xhtml (rev 0)
+++ trunk/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf5851.xhtml 2009-02-03 16:34:38 UTC (rev 12554)
@@ -0,0 +1,22 @@
+<!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:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+<ui:composition template="/layout/layout.xhtml">
+
+ <ui:define name="template">
+ <h:form id="form">
+ <!-- test process -->
+ <h:inputText value="#{rf5948.text}" id="in" /><br />
+ <h:inputText value="#{rf5948.duplicateText}" id="out" />
+
+ <rich:menuItem id="menu" submitMode="ajax" value="test item"
+ process="in" reRender="out" ajaxSingle="true" ></rich:menuItem>
+ </h:form>
+ </ui:define>
+</ui:composition>
+</html>
Added: trunk/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf5948.xhtml
===================================================================
--- trunk/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf5948.xhtml (rev 0)
+++ trunk/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf5948.xhtml 2009-02-03 16:34:38 UTC (rev 12554)
@@ -0,0 +1,24 @@
+<!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:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+<ui:composition template="/layout/layout.xhtml">
+
+ <ui:define name="template">
+ <h:form id="form">
+ <!-- test process -->
+ <h:inputText value="#{rf5948.text}" id="in" /><br />
+ <h:inputText value="#{rf5948.duplicateText}" id="out" />
+
+ <rich:simpleTogglePanel opened="false" switchType="ajax"
+ process="in" reRender="out" id="panel" ajaxSingle="true">
+ Text text text text
+ </rich:simpleTogglePanel>
+ </h:form>
+ </ui:define>
+</ui:composition>
+</html>
Modified: trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
===================================================================
--- trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java 2009-02-03 16:24:09 UTC (rev 12553)
+++ trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java 2009-02-03 16:34:38 UTC (rev 12554)
@@ -83,12 +83,23 @@
ActionEvent actionEvent = new ActionEvent(menuItem);
if(MenuComponent.MODE_AJAX.equalsIgnoreCase(mode)){
- new AjaxEvent(menuItem).queue();
+ new AjaxEvent(menuItem).queue();
+
+ if (AjaxRendererUtils.isAjaxRequest(context)) {
+
+ // add component itself to rendered list of components
+ AjaxRendererUtils.addRegionByName(context, menuItem, menuItem.getId());
+
+ // add regions specified in the "reRender" attribute to
+ // rendered list of components
+ AjaxRendererUtils.addRegionsFromComponent(menuItem, context);
+
+ AjaxRendererUtils.addProcessToAjaxContext(context, menuItem);
+ }
}
if (menuItem.isImmediate()) {
actionEvent.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
-
} else {
actionEvent.setPhaseId(PhaseId.INVOKE_APPLICATION);
}
Modified: trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/renderkit/html/SimpleTogglePanelRenderer.java
===================================================================
--- trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/renderkit/html/SimpleTogglePanelRenderer.java 2009-02-03 16:24:09 UTC (rev 12553)
+++ trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/renderkit/html/SimpleTogglePanelRenderer.java 2009-02-03 16:34:38 UTC (rev 12554)
@@ -95,13 +95,17 @@
// in case of "ajax" request and "ajax" switch mode of toggle panel
// set the regions to be rendered (reRendered) after operating this
// "ajax" request
- if (AjaxRendererUtils.isAjaxRequest(context) && panel.getSwitchType().equals(UISimpleTogglePanel.AJAX_SWITCH_TYPE)) {
- // add toggle panel itself to rendered list of components
+ if (AjaxRendererUtils.isAjaxRequest(context)
+ && panel.getSwitchType().equals(UISimpleTogglePanel.AJAX_SWITCH_TYPE)) {
+
+ // add toggle panel itself to rendered list of components
AjaxRendererUtils.addRegionByName(context, panel, panel.getId());
+
// add regions specified in the "reRender" attribute of toggle
- // panel
- // to rendered list of components
+ // panel to rendered list of components
AjaxRendererUtils.addRegionsFromComponent(panel, context);
+
+ AjaxRendererUtils.addProcessToAjaxContext(context, panel);
}
}
15 years, 11 months