Author: mvitenkov
Date: 2009-06-05 09:18:55 -0400 (Fri, 05 Jun 2009)
New Revision: 14536
Added:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf3341/
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf3341/Bean.java
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf3341/Capital.java
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf3341/
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf3341/Test.java
branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf3341.xhtml
Modified:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf6951/Test.java
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf7064/Test.java
Log:
+RF-3341 selenium test + correction.
Added:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf3341/Bean.java
===================================================================
---
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf3341/Bean.java
(rev 0)
+++
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf3341/Bean.java 2009-06-05
13:18:55 UTC (rev 14536)
@@ -0,0 +1,103 @@
+/**
+ * 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.rf3341;
+
+import java.util.ArrayList;
+
+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-3341">RF-3341 -
+ * rich:dataTable encodes its childs if this isn't nesessary</a>
+ *
+ * @author Mikhail Vitenkov
+ * @since 3.3.2
+ */
+
+@Name("rf3341")
+(a)Scope(ScopeType.SESSION)
+public class Bean {
+ private String name;
+ private String job;
+ private ArrayList<Capital> capitals;
+ private boolean rendered;
+ private int counter;
+
+ public int getCounter() {
+ return counter;
+ }
+
+ public void setCounter(int counter) {
+ this.counter = counter;
+ }
+
+ public boolean isRendered() {
+ return rendered;
+ }
+
+ public void setRendered(boolean rendered) {
+ this.rendered = rendered;
+ }
+
+ public String getName() {
+ System.out.println("getName()");
+ return name;
+ }
+
+ public void setName(String name) {
+ System.out.println("setName(String name)");
+ this.name = name;
+ }
+
+ public String getJob() {
+ System.out.println("getJob()");
+ return job;
+ }
+
+ public void setJob(String job) {
+ System.out.println("setJob(String job)");
+ this.job = job;
+ }
+
+ public ArrayList<Capital> getCapitals() {
+ System.out.println("getCapitals()");
+ counter++;
+ return capitals;
+ }
+
+ public void setCapitals(ArrayList<Capital> capitals) {
+ System.out.println("setCapitals(ArrayList<Capital> capitals)");
+ this.capitals = capitals;
+ }
+
+ public Bean(){
+ this.name = "name";
+ this.job = "job";
+
+ capitals = new ArrayList<Capital>();
+ String[] caps = {"Washington","Abu
Dhabi","Antananarivo","Minsk"};
+ for(String s:caps){
+ capitals.add(new Capital(s));
+ }
+ }
+}
Added:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf3341/Capital.java
===================================================================
---
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf3341/Capital.java
(rev 0)
+++
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf3341/Capital.java 2009-06-05
13:18:55 UTC (rev 14536)
@@ -0,0 +1,18 @@
+package org.richfaces.regressionarea.issues.rf3341;
+
+public class Capital {
+ private String name;
+
+ public Capital(String name){
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+}
Added:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf3341/Test.java
===================================================================
---
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf3341/Test.java
(rev 0)
+++
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf3341/Test.java 2009-06-05
13:18:55 UTC (rev 14536)
@@ -0,0 +1,82 @@
+/**
+ * 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.rf3341;
+
+import org.richfaces.SeleniumTestBase;
+import org.testng.Assert;
+
+/**
+ * @author Mikhail Vitenkov
+ * @since 3.3.2
+ */
+public class Test extends SeleniumTestBase {
+ private static final String FORM = "form";
+ private static final String OUT1 = FORM + ":out1";
+ private static final String OUT2 = FORM + ":out2";
+ private static final String COUNTER1 = FORM + ":counter1";
+ private static final String COUNTER2 = FORM + ":counter2";
+
+ private String getIdSelector(String id) {
+ return "//*[@id='" + id + "']";
+ }
+
+ @org.testng.annotations.Test
+ public void testExecute() throws Exception {
+ renderPage();
+
+ Assert.assertEquals(selenium.getAttribute("//input[@type='text']@value"),
"name");
+ AssertTextEquals(getIdSelector(OUT2), "name");
+ AssertTextEquals(getIdSelector(COUNTER2), "0");
+
+ type("//input[@type='text']", "test-1");
+ selenium.fireEvent("//input[@type='text']", "blur");
+ waitForAjaxCompletion();
+ selenium.submit("//form[@id='form']");
+ waitForPageToLoad();
+
+ Assert.assertEquals(selenium.getAttribute("//input[@type='text']@value"),
"test-1");
+ AssertTextEquals(getIdSelector(OUT2), "test-1");
+ AssertTextEquals(getIdSelector(COUNTER2), "1");
+
+ selenium.check("//input[@type='checkbox']");
+ selenium.submit("//form[@id='form']");
+ waitForPageToLoad();
+
+ Assert.assertEquals(selenium.getAttribute("//input[@type='text']@value"),
"test-1");
+ AssertTextEquals(getIdSelector(OUT1), "test-1");
+ AssertTextEquals(getIdSelector(COUNTER1), "1");
+
+ type("//input[@type='text']", "test-2");
+ selenium.fireEvent("//input[@type='text']", "blur");
+ waitForAjaxCompletion();
+ selenium.submit("//form[@id='form']");
+ waitForPageToLoad();
+
+ Assert.assertEquals(selenium.getAttribute("//input[@type='text']@value"),
"test-2");
+ AssertTextEquals(getIdSelector(OUT1), "test-2");
+ AssertTextEquals(getIdSelector(COUNTER1), "1");
+ }
+
+ public String getTestUrl() {
+ return "pages/rf3341.xhtml";
+ }
+
+}
\ No newline at end of file
Modified:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf6951/Test.java
===================================================================
---
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf6951/Test.java 2009-06-05
13:14:15 UTC (rev 14535)
+++
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf6951/Test.java 2009-06-05
13:18:55 UTC (rev 14536)
@@ -27,17 +27,20 @@
* @since 3.3.2
*/
public class Test extends SeleniumTestBase {
+ private static final String FORM = "form";
+ private static final String PANEL = FORM + ":panel";
+ private static final String LIST_SHUTTLE = FORM + ":LineConfigs";
@org.testng.annotations.Test
public void testExecute() throws Exception {
renderPage();
- selenium.doubleClick("//*[@id='form:LineConfigs:0']");
- selenium.click("//form[@id='form']/input[@type='button' and
@value='Submit']");
+ selenium.doubleClick("//*[@id='"+ LIST_SHUTTLE +":0']");
+ selenium.click("//form[@id='"+ FORM
+"']/input[@type='button' and @value='Submit']");
waitForAjaxCompletion();
- AssertTextEquals("//table[@id='form:panel']/tbody/tr[1]/td[2]",
"[Line 2, Line 3]");
- AssertTextEquals("//table[@id='form:panel']/tbody/tr[2]/td[2]",
"[Line 1]");
+ AssertTextEquals("//table[@id='"+ PANEL
+"']/tbody/tr[1]/td[2]", "[Line 2, Line 3]");
+ AssertTextEquals("//table[@id='"+ PANEL
+"']/tbody/tr[2]/td[2]", "[Line 1]");
}
@Override
Modified:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf7064/Test.java
===================================================================
---
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf7064/Test.java 2009-06-05
13:14:15 UTC (rev 14535)
+++
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf7064/Test.java 2009-06-05
13:18:55 UTC (rev 14536)
@@ -8,7 +8,8 @@
public void testExecute() throws Exception {
renderPage();
- selenium.assignId("form:toogleModes:1", "textArea");
+ selenium.assignId("form:toogleModes:1", "textArea");
+
clickAjaxCommandAndWait("textArea");
clickAjaxCommandAndWait("form:useSeamText");
Added:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf3341.xhtml
===================================================================
---
branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf3341.xhtml
(rev 0)
+++
branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf3341.xhtml 2009-06-05
13:18:55 UTC (rev 14536)
@@ -0,0 +1,55 @@
+<!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">
+ <rich:tabPanel switchType="ajax" selectedTab="Second"
id="tabPanel">
+ <rich:tab label="First">
+ <h:inputText value="#{rf3341.job}">
+ <a4j:support event="onkeyup" reRender="out" />
+ </h:inputText>
+ <h:outputText id="out" value="#{rf3341.job}" />
+ <rich:dataTable value="#{rf3341.capitals}" var="cap">
+ <rich:column>
+ <h:outputText value="#{cap.name}" />
+ </rich:column>
+ </rich:dataTable>
+ </rich:tab>
+ <rich:tab label="Second" name="Second" >
+ <a4j:region renderRegionOnly="true"
rendered="#{rf3341.rendered}">
+ <h:inputText value="#{rf3341.name}">
+ <a4j:support event="onblur" reRender="out1,counter1" />
+ </h:inputText>
+ <h:outputText id="out1" value="#{rf3341.name}" />
+ <br />
+ <h:outputText value="#{rf3341.counter}" id="counter1" />
+ </a4j:region>
+ <a4j:region renderRegionOnly="false"
rendered="#{!rf3341.rendered}">
+ <h:inputText value="#{rf3341.name}">
+ <a4j:support event="onblur" reRender="out2,counter2" />
+ </h:inputText>
+ <h:outputText id="out2" value="#{rf3341.name}" />
+ <br />
+ <h:outputText value="#{rf3341.counter}" id="counter2" />
+ </a4j:region>
+ </rich:tab>
+ <rich:tab label="Third">
+Here is tab #3
+</rich:tab>
+ </rich:tabPanel>
+ <h:panelGrid columns="2">
+ <h:outputText value="a4j:region rendered:" />
+ <h:selectBooleanCheckbox value="#{rf3341.rendered}"
+ onclick="submit()">
+ </h:selectBooleanCheckbox>
+ </h:panelGrid>
+ </h:form>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file