JBoss Rich Faces SVN: r21165 - trunk/examples/richfaces-showcase/src/main/webapp/richfaces/param/samples.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2011-01-24 05:03:49 -0500 (Mon, 24 Jan 2011)
New Revision: 21165
Modified:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/param/samples/param-sample.xhtml
Log:
simplified param demo. name not mandatory anymore in 4.x.
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/param/samples/param-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/param/samples/param-sample.xhtml 2011-01-24 07:12:45 UTC (rev 21164)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/param/samples/param-sample.xhtml 2011-01-24 10:03:49 UTC (rev 21165)
@@ -9,11 +9,11 @@
<rich:panel>
<h:panelGrid columns="2">
<a4j:commandButton value="Set Name to Alex" render="rep">
- <a4j:param name="username" value="Alex" assignTo="#{userBean.name}" />
+ <a4j:param value="Alex" assignTo="#{userBean.name}" />
</a4j:commandButton>
<a4j:commandButton value="Set Name to John" render="rep">
- <a4j:param name="username" value="John" assignTo="#{userBean.name}" />
+ <a4j:param value="John" assignTo="#{userBean.name}" />
</a4j:commandButton>
</h:panelGrid>
</rich:panel>
13 years, 11 months
JBoss Rich Faces SVN: r21164 - modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-24 02:12:45 -0500 (Mon, 24 Jan 2011)
New Revision: 21164
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/targetting.xhtml
Log:
rich:tree - pre-automation preparations (RFPL-884)
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/simple.xhtml 2011-01-23 20:32:16 UTC (rev 21163)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/simple.xhtml 2011-01-24 07:12:45 UTC (rev 21164)
@@ -54,41 +54,47 @@
<rich:tooltip id="tooltip"
attached="#{richTooltipBean.attributes['attached'].value}"
+ bypassUpdates="#{richTooltipBean.attributes['bypassUpdates'].value}"
+ data="#{richTooltipBean.attributes['data'].value}"
+ dir="#{richTooltipBean.attributes['dir'].value}"
direction="#{richTooltipBean.attributes['direction'].value}"
disabled="#{richTooltipBean.attributes['disabled'].value}"
+ execute="#{richTooltipBean.attributes['execute'].value}"
followMouse="#{richTooltipBean.attributes['followMouse'].value}"
hideDelay="#{richTooltipBean.attributes['hideDelay'].value}"
hideEvent="#{richTooltipBean.attributes['hideEvent'].value}"
horizontalOffset="#{richTooltipBean.attributes['horizontalOffset'].value}"
+ jointPoint="#{richTooltipBean.attributes['jointPoint'].value}"
+ lang="#{richTooltipBean.attributes['lang'].value}"
layout="#{richTooltipBean.attributes['layout'].value}"
+ limitRender="#{richTooltipBean.attributes['limitRender'].value}"
mode="#{richTooltipBean.attributes['mode'].value}"
+ onbeforehide="#{richTooltipBean.attributes['onbeforehide'].value}"
+ onbeforeshow="#{richTooltipBean.attributes['onbeforeshow'].value}"
+ onclick="#{richTooltipBean.attributes['onclick'].value}"
+ ondblclick="#{richTooltipBean.attributes['ondblclick'].value}"
+ onhide="#{richTooltipBean.attributes['onhide'].value}"
+ onmousedown="#{richTooltipBean.attributes['onmousedown'].value}"
+ onmousemove="#{richTooltipBean.attributes['onmousemove'].value}"
+ onmouseout="#{richTooltipBean.attributes['onmouseout'].value}"
+ onmouseover="#{richTooltipBean.attributes['onmouseover'].value}"
+ onmouseup="#{richTooltipBean.attributes['onmouseup'].value}"
+ onshow="#{richTooltipBean.attributes['onshow'].value}"
rendered="#{richTooltipBean.attributes['rendered'].value}"
showDelay="#{richTooltipBean.attributes['showDelay'].value}"
showEvent="#{richTooltipBean.attributes['showEvent'].value}"
+ status="#{richTooltipBean.attributes['status'].value}"
+ style="#{richTooltipBean.attributes['style'].value}"
+ styleClass="#{richTooltipBean.attributes['styleClass'].value}"
+ title="#{richTooltipBean.attributes['title'].value}"
+ verticalOffset="#{richTooltipBean.attributes['verticalOffset'].value}"
+ zindex="#{richTooltipBean.attributes['zindex'].value}"
>
- <!--
-
-
-
-
-
-
-
- -->
-
-
Tooltip content (counter: #{richTooltipBean.counter})
</rich:tooltip>
-
- <!--
-
-
-
- verticalOffset="#{richTooltipBean.attributes['verticalOffset'].value}"
- -->
</rich:panel>
</ui:define>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/targetting.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/targetting.xhtml 2011-01-23 20:32:16 UTC (rev 21163)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/targetting.xhtml 2011-01-24 07:12:45 UTC (rev 21164)
@@ -60,18 +60,42 @@
<rich:tooltip id="tooltip"
attached="#{richTooltipBean.attributes['attached'].value}"
+ bypassUpdates="#{richTooltipBean.attributes['bypassUpdates'].value}"
+ data="#{richTooltipBean.attributes['data'].value}"
+ dir="#{richTooltipBean.attributes['dir'].value}"
direction="#{richTooltipBean.attributes['direction'].value}"
disabled="#{richTooltipBean.attributes['disabled'].value}"
+ execute="#{richTooltipBean.attributes['execute'].value}"
followMouse="#{richTooltipBean.attributes['followMouse'].value}"
hideDelay="#{richTooltipBean.attributes['hideDelay'].value}"
hideEvent="#{richTooltipBean.attributes['hideEvent'].value}"
horizontalOffset="#{richTooltipBean.attributes['horizontalOffset'].value}"
+ jointPoint="#{richTooltipBean.attributes['jointPoint'].value}"
+ lang="#{richTooltipBean.attributes['lang'].value}"
layout="#{richTooltipBean.attributes['layout'].value}"
+ limitRender="#{richTooltipBean.attributes['limitRender'].value}"
mode="#{richTooltipBean.attributes['mode'].value}"
+ onbeforehide="#{richTooltipBean.attributes['onbeforehide'].value}"
+ onbeforeshow="#{richTooltipBean.attributes['onbeforeshow'].value}"
+ onclick="#{richTooltipBean.attributes['onclick'].value}"
+ ondblclick="#{richTooltipBean.attributes['ondblclick'].value}"
+ onhide="#{richTooltipBean.attributes['onhide'].value}"
+ onmousedown="#{richTooltipBean.attributes['onmousedown'].value}"
+ onmousemove="#{richTooltipBean.attributes['onmousemove'].value}"
+ onmouseout="#{richTooltipBean.attributes['onmouseout'].value}"
+ onmouseover="#{richTooltipBean.attributes['onmouseover'].value}"
+ onmouseup="#{richTooltipBean.attributes['onmouseup'].value}"
+ onshow="#{richTooltipBean.attributes['onshow'].value}"
rendered="#{richTooltipBean.attributes['rendered'].value}"
+ showDelay="#{richTooltipBean.attributes['showDelay'].value}"
+ showEvent="#{richTooltipBean.attributes['showEvent'].value}"
+ status="#{richTooltipBean.attributes['status'].value}"
+ style="#{richTooltipBean.attributes['style'].value}"
+ styleClass="#{richTooltipBean.attributes['styleClass'].value}"
target="#{richTooltipBean.attributes['target'].value}"
- showDelay="#{richTooltipBean.attributes['showDelay'].value}"
- showEvent="#{richTooltipBean.attributes['showEvent'].value}">
+ title="#{richTooltipBean.attributes['title'].value}"
+ verticalOffset="#{richTooltipBean.attributes['verticalOffset'].value}"
+ zindex="#{richTooltipBean.attributes['zindex'].value}">
Tooltip content
13 years, 11 months
JBoss Rich Faces SVN: r21163 - in modules/tests/metamer/trunk: ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-23 15:32:16 -0500 (Sun, 23 Jan 2011)
New Revision: 21163
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeHandleLoading.java
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeHandle.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeModel.java
Log:
rich:tree - automated Simple sample - handleLoading facet capabilities (RFPL-935)
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2011-01-23 20:31:19 UTC (rev 21162)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2011-01-23 20:32:16 UTC (rev 21163)
@@ -211,7 +211,7 @@
<h:panelGrid columns="2">
<h:outputLabel value="Test Loading Facet:" />
- <h:selectBooleanCheckbox value="#{richTreeBean.testLoadingFacet}">
+ <h:selectBooleanCheckbox id="loadingFacet" value="#{richTreeBean.testLoadingFacet}">
<a4j:ajax render="#{nestedComponentId}" />
</h:selectBooleanCheckbox>
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java 2011-01-23 20:31:19 UTC (rev 21162)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java 2011-01-23 20:32:16 UTC (rev 21163)
@@ -44,11 +44,13 @@
import java.net.URL;
+import org.jboss.cheiron.halt.XHRHalter;
import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.locator.ElementLocator;
import org.jboss.test.selenium.locator.ExtendedLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.request.RequestType;
+import org.jboss.test.selenium.waiting.selenium.SeleniumCondition;
import org.richfaces.component.SwitchType;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
@@ -84,6 +86,7 @@
new TreeNodeAttributes(pjq("span[id*=treeNode3Attributes]")) };
JQueryLocator expandAll = jq("input:submit[id$=expandAll]");
+ JQueryLocator loadingFacet = jq("input:checkbox[id$=loadingFacet]");
@Override
public URL getTestUrl() {
@@ -300,6 +303,43 @@
}
}
+ @Test
+ public void testLoadingFacet() {
+ setLoadingFacet(true);
+ tree.setToggleType(null);
+ XHRHalter.enable();
+
+ XHRHalter xhrHalter = null;
+
+ for (int index : new int[] { 2, 3 }) {
+ treeNode = (index == 2) ? tree.getNode(index) : treeNode.getNode(index);
+
+ assertFalse(treeNode.getHandleLoading().isVisible());
+ assertTrue(treeNode.getHandle().isCollapsed());
+ assertFalse(treeNode.getHandle().isExpanded());
+ treeNode.expand();
+ assertTrue(treeNode.getHandleLoading().isVisible());
+ assertTrue(treeNode.getHandleLoading().getImageUrl().endsWith(IMAGE_URL));
+ assertFalse(treeNode.getHandle().isCollapsed());
+ assertFalse(treeNode.getHandle().isExpanded());
+
+ if (xhrHalter == null) {
+ xhrHalter = XHRHalter.getHandleBlocking();
+ }
+ xhrHalter.complete();
+
+ waitModel.until(treeNodeExpanded);
+ }
+ }
+
+ SeleniumCondition treeNodeExpanded = new SeleniumCondition() {
+
+ @Override
+ public boolean isTrue() {
+ return treeNode.isExpanded();
+ }
+ };
+
private void fireEvent(ElementLocator<?> target, Event eventToFire, Event eventToSetup) {
RequestType requestType = (eventToFire == eventToSetup) ? RequestType.XHR : RequestType.NONE;
if (eventToFire == MOUSEDOWN) {
@@ -316,6 +356,13 @@
}
}
+ private void setLoadingFacet(boolean turnOn) {
+ boolean checked = Boolean.valueOf(selenium.getValue(loadingFacet));
+ if (checked != turnOn) {
+ guardXhr(selenium).click(loadingFacet);
+ }
+ }
+
private void expandAll() {
guardXhr(selenium).click(expandAll);
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeHandle.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeHandle.java 2011-01-23 20:31:19 UTC (rev 21162)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeHandle.java 2011-01-23 20:32:16 UTC (rev 21163)
@@ -43,14 +43,18 @@
}
public boolean isExpanded() {
- return selenium.belongsClass(this, classHandleExpanded);
+ return isVisible() && selenium.belongsClass(this, classHandleExpanded);
}
public boolean isCollapsed() {
- return selenium.belongsClass(this, classHandleCollapsed);
+ return isVisible() && selenium.belongsClass(this, classHandleCollapsed);
}
public boolean isLeaf() {
- return selenium.belongsClass(this, classHandleLeaf);
+ return isVisible() && selenium.belongsClass(this, classHandleLeaf);
}
+
+ private boolean isVisible() {
+ return selenium.isVisible(this);
+ }
}
Copied: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeHandleLoading.java (from rev 21162, modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeHandle.java)
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeHandleLoading.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeHandleLoading.java 2011-01-23 20:32:16 UTC (rev 21163)
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richTree;
+
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+
+import org.jboss.test.selenium.framework.AjaxSelenium;
+import org.jboss.test.selenium.framework.AjaxSeleniumProxy;
+import org.jboss.test.selenium.locator.Attribute;
+import org.jboss.test.selenium.locator.AttributeLocator;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.richfaces.tests.metamer.ftest.model.AbstractModel;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TreeNodeHandleLoading extends AbstractModel<JQueryLocator> {
+
+ AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
+
+ public TreeNodeHandleLoading(JQueryLocator root) {
+ super(root);
+ }
+
+ public String getImageUrl() {
+ AttributeLocator<JQueryLocator> imageSrc = this.getChild(jq("img")).getAttribute(Attribute.SRC);
+ return selenium.getAttribute(imageSrc);
+ }
+
+ public boolean isVisible() {
+ return selenium.isVisible(this);
+ }
+}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeModel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeModel.java 2011-01-23 20:31:19 UTC (rev 21162)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeModel.java 2011-01-23 20:32:16 UTC (rev 21163)
@@ -51,12 +51,13 @@
private ReferencedLocator<JQueryLocator> content = ref(treeNode, "> span.rf-trn-cnt");
private ReferencedLocator<JQueryLocator> icon = ref(content, "> .rf-trn-ico");
private ReferencedLocator<JQueryLocator> label = ref(content, "> .rf-trn-lbl");
+ private ReferencedLocator<JQueryLocator> handleLoading = ref(treeNode, "> .rf-trn-hnd-ldn-fct");
public TreeNodeModel(JQueryLocator root, TreeModel tree) {
super(root);
this.tree = tree;
}
-
+
public ExtendedLocator<JQueryLocator> getTreeNode() {
return treeNode;
}
@@ -64,6 +65,10 @@
public TreeNodeHandle getHandle() {
return new TreeNodeHandle(handle.getReferenced());
}
+
+ public TreeNodeHandleLoading getHandleLoading() {
+ return new TreeNodeHandleLoading(handleLoading.getReferenced());
+ }
public TreeNodeIcon getIcon() {
return new TreeNodeIcon(icon.getReferenced());
@@ -92,15 +97,19 @@
public String getLabelText() {
return selenium.getText(label);
}
-
+
public void expand() {
- guard(selenium, getRequestType(tree.getToggleType())).click(getHandle());
+ if (tree.getToggleType() == null) {
+ selenium.click(getHandle());
+ } else {
+ guard(selenium, getRequestType(tree.getToggleType())).click(getHandle());
+ }
}
-
+
public void select() {
- guard(selenium, getRequestType(tree.getSelectionType())).clickAt(getLabel(), new Point(0,0));
+ guard(selenium, getRequestType(tree.getSelectionType())).clickAt(getLabel(), new Point(0, 0));
}
-
+
private RequestType getRequestType(SwitchType switchType) {
switch (switchType) {
case ajax:
13 years, 11 months
JBoss Rich Faces SVN: r21162 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richTree and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-23 15:31:19 -0500 (Sun, 23 Jan 2011)
New Revision: 21162
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreePhases.java
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/PhaseInfo.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeToggling.java
Log:
rich:tree - automated Simple sample - phases capabilities (RFPL-935)
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/PhaseInfo.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/PhaseInfo.java 2011-01-23 20:30:31 UTC (rev 21161)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/PhaseInfo.java 2011-01-23 20:31:19 UTC (rev 21162)
@@ -26,11 +26,13 @@
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
+import java.util.LinkedList;
import java.util.Map;
import java.util.Set;
import javax.faces.event.PhaseId;
+import org.apache.commons.lang.ArrayUtils;
import org.jboss.test.selenium.framework.AjaxSelenium;
import org.jboss.test.selenium.framework.AjaxSeleniumProxy;
import org.jboss.test.selenium.locator.JQueryLocator;
@@ -55,6 +57,9 @@
*/
public void assertPhases(PhaseId... expectedPhases) {
initialize();
+ if (ArrayUtils.contains(expectedPhases, PhaseId.ANY_PHASE)) {
+ expectedPhases = new LinkedList<PhaseId>(PhaseId.VALUES).subList(1, 7).toArray(new PhaseId[6]);
+ }
PhaseId[] actualPhases = map.keySet().toArray(new PhaseId[map.size()]);
assertEquals(actualPhases, expectedPhases);
}
@@ -88,12 +93,12 @@
int count = selenium.getCount(phasesItems);
- Set<String> set;
+ Set<String> set = null;
for (int i = 1; i <= count; i++) {
String description = selenium.getText(phasesItems.getNthChildElement(i));
- set = new LinkedHashSet<String>();
if (!description.startsWith("* ")) {
+ set = new LinkedHashSet<String>();
map.put(getPhaseId(description), set);
} else {
set.add(description.substring(2));
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreePhases.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreePhases.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreePhases.java 2011-01-23 20:31:19 UTC (rev 21162)
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richTree;
+
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+
+import java.net.URL;
+
+import javax.faces.event.PhaseId;
+
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestTreePhases extends AbstractMetamerTest {
+ @Inject
+ @Use(booleans = { true, false })
+ Boolean immediate;
+
+ private TreeAttributes treeAttributes = new TreeAttributes(jq("span[id*=attributes]"));
+ private TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richTree/simple.xhtml");
+ }
+
+ @BeforeMethod
+ public void initialize() {
+ treeAttributes.setImmediate(immediate);
+ }
+
+ @Test
+ public void testPhasesSelection() {
+ tree.getNode(2).expand();
+ tree.getNode(2).getNode(3).select();
+ phaseInfo.assertPhases(PhaseId.ANY_PHASE);
+ phaseInfo.assertListener(PhaseId.APPLY_REQUEST_VALUES, "selection change listener invoked");
+ }
+
+ @Test
+ public void testPhasesToggling() {
+ tree.getNode(2).expand();
+ PhaseId phaseId = (immediate) ? PhaseId.APPLY_REQUEST_VALUES : PhaseId.PROCESS_VALIDATIONS;
+ phaseInfo.assertListener(phaseId, "tree toggle listener invoked");
+ }
+}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeToggling.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeToggling.java 2011-01-23 20:30:31 UTC (rev 21161)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeToggling.java 2011-01-23 20:31:19 UTC (rev 21162)
@@ -33,7 +33,6 @@
import org.richfaces.component.SwitchType;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
-import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.richfaces.tests.metamer.ftest.annotations.Use;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
13 years, 11 months
JBoss Rich Faces SVN: r21161 - in modules/tests/metamer/trunk: ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-23 15:30:31 -0500 (Sun, 23 Jan 2011)
New Revision: 21161
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSelection.java
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/AbstractTreeNodeModel.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeToggling.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeModel.java
Log:
rich:tree - automated Simple sample - selection capabilities (RFPL-935)
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2011-01-23 20:29:41 UTC (rev 21160)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2011-01-23 20:30:31 UTC (rev 21161)
@@ -221,30 +221,30 @@
</h:selectBooleanCheckbox>
<h:outputLabel value="Selection:" />
- <h:outputText value="#{richTreeBean.selection}" />
+ <h:outputText id="selection" value="#{richTreeBean.selection}" />
<h:outputLabel value="Selection Change Event:" rendered="#{not empty richTreeListenerBean.treeSelectionChangeEvent}" />
<h:panelGrid columns="2" rendered="#{not empty richTreeListenerBean.treeSelectionChangeEvent}">
<h:outputLabel value="Client ID:" />
- <h:outputText value="#{richTreeListenerBean.treeSelectionChangeEvent.component.id}" />
+ <h:outputText id="selectionEventClientId" value="#{richTreeListenerBean.treeSelectionChangeEvent.component.id}" />
<h:outputLabel value="New Selection:" />
- <h:outputText value="#{richTreeListenerBean.treeSelectionChangeEvent.newSelection}" />
+ <h:outputText id="selectionEventNewSelection" value="#{richTreeListenerBean.treeSelectionChangeEvent.newSelection}" />
<h:outputLabel value="Old Selection:" />
- <h:outputText value="#{richTreeListenerBean.treeSelectionChangeEvent.oldSelection}" />
+ <h:outputText id="selectionEventOldSelection" value="#{richTreeListenerBean.treeSelectionChangeEvent.oldSelection}" />
</h:panelGrid>
<h:outputLabel value="Tree Toggle Event:" rendered="#{not empty richTreeListenerBean.treeToggleEvent}" />
<h:panelGrid columns="2" rendered="#{not empty richTreeListenerBean.treeToggleEvent}">
<h:outputLabel value="Client ID:" />
- <h:outputText value="#{richTreeListenerBean.treeToggleEvent.component.id}" />
+ <h:outputText id="toggleEventClientId" value="#{richTreeListenerBean.treeToggleEvent.component.id}" />
<h:outputLabel value="Collapsed:" />
- <h:outputText value="#{richTreeListenerBean.treeToggleEvent.collapsed}" />
+ <h:outputText id="toggleEventCollapsed" value="#{richTreeListenerBean.treeToggleEvent.collapsed}" />
<h:outputLabel value="Expanded:" />
- <h:outputText value="#{richTreeListenerBean.treeToggleEvent.expanded}" />
+ <h:outputText id="toggleEventExpanded" value="#{richTreeListenerBean.treeToggleEvent.expanded}" />
</h:panelGrid>
</h:panelGrid>
</a4j:outputPanel>
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/AbstractTreeNodeModel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/AbstractTreeNodeModel.java 2011-01-23 20:29:41 UTC (rev 21160)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/AbstractTreeNodeModel.java 2011-01-23 20:30:31 UTC (rev 21161)
@@ -47,10 +47,12 @@
static JQueryLocator treeNode = jq("div.rf-tr-nd");
static JQueryLocator treeNodeExpanded = jq("div.rf-tr-nd-exp");
static JQueryLocator treeNodeCollapsed = jq("div.rf-tr-nd-colps");
+ static JQueryLocator treeNodeSelected = jq("div.rf-tr-nd:has(> .rf-trn > .rf-trn-sel)");
ReferencedLocator<JQueryLocator> nodes = ref(root, "> " + treeNode.getRawLocator());
ReferencedLocator<JQueryLocator> nodesCollapsed = ref(root, "> " + treeNodeCollapsed.getRawLocator());
ReferencedLocator<JQueryLocator> nodesExpanded = ref(root, "> " + treeNodeExpanded.getRawLocator());
+ ReferencedLocator<JQueryLocator> anyNodesSelected = ref(root, treeNodeSelected.getRawLocator());
public Iterable<TreeNodeModel> getNodes() {
Iterable<TreeNodeModel> result = new ModelIterable<JQueryLocator, TreeNodeModel>(nodes.getAllOccurrences(),
@@ -76,6 +78,13 @@
new Object[] { tree });
return result;
}
+
+ public Iterable<TreeNodeModel> getAnySelectedNodes() {
+ Iterable<TreeNodeModel> result = new ModelIterable<JQueryLocator, TreeNodeModel>(
+ anyNodesSelected.getAllOccurrences(), TreeNodeModel.class, new Class[] { TreeModel.class },
+ new Object[] { tree });
+ return result;
+ }
public int getExpandedNodesCount() {
return selenium.getCount(nodesExpanded);
@@ -84,4 +93,8 @@
public int getCollapsedNodesCount() {
return selenium.getCount(nodesCollapsed);
}
+
+ public int getAnySelectedNodesCount() {
+ return selenium.getCount(anyNodesSelected);
+ }
}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSelection.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSelection.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSelection.java 2011-01-23 20:30:31 UTC (rev 21161)
@@ -0,0 +1,168 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richTree;
+
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+
+import java.net.URL;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.commons.lang.StringUtils;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.richfaces.component.SwitchType;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestTreeSelection extends AbstractMetamerTest {
+
+ Integer[][] SUBNODE_SELECTION_PATHS = new Integer[][] { { 2, 3 }, { 3, 4 }, { 4, 1, 1 }, { 4 }, { 4, 1 }, { 1, 5 },
+ { 2, 3, 3 } };
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richTree/simple.xhtml");
+ }
+
+ private TreeAttributes treeAttributes = new TreeAttributes(jq("span[id*=attributes]"));
+ private TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
+ private TreeNodeModel treeNode;
+
+ @Inject
+ @Use(value = "selectionTypes")
+ SwitchType selectionType = SwitchType.ajax;
+ SwitchType[] selectionTypes = new SwitchType[] { SwitchType.ajax, SwitchType.client };
+ SwitchType[] eventEnabledSelectionTypes = new SwitchType[] { SwitchType.ajax };
+
+ JQueryLocator expandAll = jq("input:submit[id$=expandAll]");
+ JQueryLocator selection = jq("span[id$=selection]");
+ JQueryLocator clientId = jq("span[id$=selectionEventClientId]");
+ JQueryLocator newSelection = jq("span[id$=selectionEventNewSelection]");
+ JQueryLocator oldSelection = jq("span[id$=selectionEventOldSelection]");
+
+ @BeforeMethod
+ public void testInitialize() {
+ treeAttributes.setSelectionType(selectionType);
+ tree.setSelectionType(selectionType);
+ }
+
+ @Test
+ public void testTopLevelSelection() {
+ assertEquals(tree.getAnySelectedNodesCount(), 0);
+
+ for (TreeNodeModel treeNode : tree.getNodes()) {
+ assertFalse(treeNode.isSelected());
+ assertTrue(treeNode.isCollapsed());
+ treeNode.select();
+ assertTrue(treeNode.isSelected());
+ assertTrue(treeNode.isCollapsed());
+
+ assertEquals(tree.getAnySelectedNodesCount(), 1);
+ }
+ }
+
+ @Test
+ public void testSubNodesSelection() {
+ guardXhr(selenium).click(expandAll);
+ assertEquals(tree.getAnySelectedNodesCount(), 0);
+
+ for (Integer[] path : SUBNODE_SELECTION_PATHS) {
+ treeNode = null;
+ for (int index : path) {
+ treeNode = (treeNode == null) ? tree.getNode(index) : treeNode.getNode(index);
+ }
+ assertFalse(treeNode.isSelected());
+ treeNode.select();
+ assertTrue(treeNode.isSelected());
+ assertEquals(tree.getAnySelectedNodesCount(), 1);
+ }
+ }
+
+ @Test
+ @Use(field = "selectionType", value = "eventEnabledSelectionTypes")
+ public void testSubNodesSelectionEvents() {
+ guardXhr(selenium).click(expandAll);
+
+ Integer[] old = null;
+ for (Integer[] path : SUBNODE_SELECTION_PATHS) {
+ treeNode = null;
+ for (int index : path) {
+ treeNode = (treeNode == null) ? tree.getNode(index) : treeNode.getNode(index);
+ }
+ treeNode.select();
+ assertEquals(getClientId(), "richTree");
+ assertEquals(getSelection(), path);
+ assertEquals(getNewSelection(), path);
+ if (old != null) {
+ assertEquals(getOldSelection(), old);
+ } else {
+ assertEquals(selenium.getText(oldSelection), "[]");
+ }
+ old = getNewSelection();
+ }
+ }
+
+ private Integer[] getSelection() {
+ String string = selenium.getText(selection);
+ return getIntsFromString(string);
+ }
+
+ private Integer[] getNewSelection() {
+ String string = selenium.getText(newSelection);
+ return getIntsFromString(string);
+ }
+
+ private Integer[] getOldSelection() {
+ String string = selenium.getText(oldSelection);
+ return getIntsFromString(string);
+ }
+
+ private String getClientId() {
+ return selenium.getText(clientId);
+ }
+
+ private Integer[] getIntsFromString(String string) {
+ Pattern pattern = Pattern.compile(".*\\[((?:(?:\\d+)(?:, )?)+)\\].*");
+ Matcher matcher = pattern.matcher(string);
+ if (matcher.find()) {
+ String[] strings = StringUtils.split(matcher.group(1), ", ");
+ Integer[] numbers = new Integer[strings.length];
+ for (int i = 0; i < strings.length; i++) {
+ numbers[i] = Integer.valueOf(strings[i]) + 1;
+ }
+ return numbers;
+ }
+ throw new IllegalStateException("pattern does not match");
+ }
+}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeToggling.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeToggling.java 2011-01-23 20:29:41 UTC (rev 21160)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeToggling.java 2011-01-23 20:30:31 UTC (rev 21161)
@@ -94,7 +94,6 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-10264")
public void testDeepExpansion() {
for (int[] path : PATHS) {
for (int d = 1; d <= path.length; d++) {
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeModel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeModel.java 2011-01-23 20:29:41 UTC (rev 21160)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeModel.java 2011-01-23 20:30:31 UTC (rev 21161)
@@ -22,10 +22,8 @@
package org.richfaces.tests.metamer.ftest.richTree;
import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guard;
-import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
import static org.jboss.test.selenium.locator.reference.ReferencedLocator.ref;
-import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.framework.AjaxSelenium;
import org.jboss.test.selenium.framework.AjaxSeleniumProxy;
import org.jboss.test.selenium.geometry.Point;
@@ -33,10 +31,7 @@
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.locator.reference.ReferencedLocator;
import org.jboss.test.selenium.request.RequestType;
-import org.junit.Assert;
import org.richfaces.component.SwitchType;
-import org.richfaces.tests.metamer.ftest.model.AbstractModel;
-import org.richfaces.tests.metamer.ftest.model.ModelIterable;
/**
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
@@ -46,8 +41,6 @@
private AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
- private ReferencedLocator<JQueryLocator> subnodes = ref(root, TreeModel.treeNode.getRawLocator());
-
private String classNodeExpanded = "rf-tr-nd-exp";
private String classNodeLeaf = "rf-tr-nd-lf";
private String classNodeCollapsed = "rf-tr-nd-colps";
@@ -81,7 +74,7 @@
}
public boolean isSelected() {
- return selenium.belongsClass(root.getLocator(), classSelected);
+ return selenium.belongsClass(content, classSelected);
}
public boolean isExpanded() {
@@ -105,7 +98,7 @@
}
public void select() {
- guardXhr(selenium).clickAt(getLabel(), new Point(0,0));
+ guard(selenium, getRequestType(tree.getSelectionType())).clickAt(getLabel(), new Point(0,0));
}
private RequestType getRequestType(SwitchType switchType) {
13 years, 11 months
JBoss Rich Faces SVN: r21160 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richTree and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-23 15:29:41 -0500 (Sun, 23 Jan 2011)
New Revision: 21160
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeToggling.java
Removed:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeExpansion.java
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/ModelIterable.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/AbstractTreeNodeModel.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeModel.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeModel.java
Log:
rich:tree - automated Simple sample - toggling capabilities (RFPL-935)
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/ModelIterable.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/ModelIterable.java 2011-01-22 22:48:17 UTC (rev 21159)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/ModelIterable.java 2011-01-23 20:29:41 UTC (rev 21160)
@@ -3,17 +3,27 @@
import java.lang.reflect.Constructor;
import java.util.Iterator;
+import org.apache.commons.lang.ArrayUtils;
import org.jboss.test.selenium.locator.ExtendedLocator;
public class ModelIterable<E extends ExtendedLocator<E>, T extends AbstractModel<E>> implements Iterable<T> {
Iterable<E> iterable;
Class<T> classT;
+ Class[] constructorParamTypes = new Class[] {};
+ Object[] constructorParams = new Object[] {};
public ModelIterable(Iterable<E> iterable, Class<T> classT) {
this.iterable = iterable;
this.classT = classT;
}
+
+ public ModelIterable(Iterable<E> iterable, Class<T> classT, Class[] constructorParamTypes, Object[] constructorParams) {
+ this.iterable = iterable;
+ this.classT = classT;
+ this.constructorParamTypes = constructorParamTypes;
+ this.constructorParams = constructorParams;
+ }
@Override
public Iterator<T> iterator() {
@@ -34,10 +44,20 @@
ExtendedLocator<E> locator = iterator.next();
try {
- for (Constructor<?> constructor : classT.getConstructors()) {
+ constructorLoop: for (Constructor<?> constructor : classT.getConstructors()) {
if (ExtendedLocator.class.isAssignableFrom(constructor.getParameterTypes()[0])) {
- T newInstance = (T) constructor.newInstance(locator);
- return newInstance;
+ if (constructorParamTypes.length == constructor.getParameterTypes().length - 1) {
+ Object[] params = new Object[constructorParamTypes.length + 1];
+ for (int i = 0; i < constructorParamTypes.length; i++) {
+ if (constructorParamTypes[i] != constructor.getParameterTypes()[i+1]) {
+ continue constructorLoop;
+ }
+ params[i+1] = constructorParams[i];
+ }
+ params[0] = locator;
+ T newInstance = (T) constructor.newInstance(params);
+ return newInstance;
+ }
}
}
} catch (Exception e) {
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/AbstractTreeNodeModel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/AbstractTreeNodeModel.java 2011-01-22 22:48:17 UTC (rev 21159)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/AbstractTreeNodeModel.java 2011-01-23 20:29:41 UTC (rev 21160)
@@ -40,10 +40,6 @@
public AbstractTreeNodeModel(JQueryLocator root) {
super(root);
}
-
- public void setTree(TreeModel tree) {
- this.tree = tree;
- }
private AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
protected TreeModel tree;
@@ -57,32 +53,27 @@
ReferencedLocator<JQueryLocator> nodesExpanded = ref(root, "> " + treeNodeExpanded.getRawLocator());
public Iterable<TreeNodeModel> getNodes() {
- Iterable<TreeNodeModel> result = new ModelIterable<JQueryLocator, TreeNodeModel>(nodes.getAllOccurrences(), TreeNodeModel.class);
- for (TreeNodeModel trn : result) {
- trn.setTree(tree);
- }
+ Iterable<TreeNodeModel> result = new ModelIterable<JQueryLocator, TreeNodeModel>(nodes.getAllOccurrences(),
+ TreeNodeModel.class, new Class[] { TreeModel.class }, new Object[] { tree });
return result;
}
public TreeNodeModel getNode(int index) {
- TreeNodeModel trn = new TreeNodeModel(nodes.getNthOccurence(index));
- trn.setTree(tree);
+ TreeNodeModel trn = new TreeNodeModel(nodes.getNthOccurence(index), tree);
return trn;
}
public Iterable<TreeNodeModel> getExpandedNodes() {
- Iterable<TreeNodeModel> result = new ModelIterable<JQueryLocator, TreeNodeModel>(nodesExpanded.getAllOccurrences(), TreeNodeModel.class);
- for (TreeNodeModel trn : result) {
- trn.setTree(tree);
- }
+ Iterable<TreeNodeModel> result = new ModelIterable<JQueryLocator, TreeNodeModel>(
+ nodesExpanded.getAllOccurrences(), TreeNodeModel.class, new Class[] { TreeModel.class },
+ new Object[] { tree });
return result;
}
public Iterable<TreeNodeModel> getCollapsedNodes() {
- Iterable<TreeNodeModel> result = new ModelIterable<JQueryLocator, TreeNodeModel>(nodesCollapsed.getAllOccurrences(), TreeNodeModel.class);
- for (TreeNodeModel trn : result) {
- trn.setTree(tree);
- }
+ Iterable<TreeNodeModel> result = new ModelIterable<JQueryLocator, TreeNodeModel>(
+ nodesCollapsed.getAllOccurrences(), TreeNodeModel.class, new Class[] { TreeModel.class },
+ new Object[] { tree });
return result;
}
Deleted: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeExpansion.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeExpansion.java 2011-01-22 22:48:17 UTC (rev 21159)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeExpansion.java 2011-01-23 20:29:41 UTC (rev 21160)
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *******************************************************************************/
-package org.richfaces.tests.metamer.ftest.richTree;
-
-import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertTrue;
-
-import java.net.URL;
-import java.util.Deque;
-import java.util.LinkedList;
-
-import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
-import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-/**
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
-public class TestTreeExpansion extends AbstractMetamerTest {
-
- private static final int TOP_LEVEL_NODES = 4;
- private static final int DEPTH = 3;
-
- int[][] PATHS = new int[][] { { 3, 2, 1 }, { 2, 4, 1 } };
-
- private TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
- private TreeNodeModel treeNode;
-
- @Override
- public URL getTestUrl() {
- return buildUrl(contextPath, "faces/components/richTree/simple.xhtml");
- }
-
- @BeforeMethod
- public void verifyInitialState() {
- assertEquals(tree.getCollapsedNodesCount(), TOP_LEVEL_NODES);
- assertEquals(tree.getExpandedNodesCount(), 0);
- }
-
- @Test
- public void testTopLevelNodesExpansion() {
- for (int i = 1; i <= TOP_LEVEL_NODES; i++) {
- treeNode = tree.getNode(i);
- treeNode.expand();
- assertEquals(tree.getCollapsedNodesCount(), TOP_LEVEL_NODES - i);
- assertEquals(tree.getExpandedNodesCount(), i);
- assertTrue(treeNode.isExpanded());
- }
- }
-
- @Test
- public void testTopLevelNodesCollapsion() {
- testTopLevelNodesExpansion();
- for (int i = 1; i <= TOP_LEVEL_NODES; i++) {
- treeNode = tree.getNode(i);
- treeNode.expand();
- assertEquals(tree.getCollapsedNodesCount(), i);
- assertEquals(tree.getExpandedNodesCount(), TOP_LEVEL_NODES - i);
- assertTrue(treeNode.isCollapsed());
- }
- }
-
- @Test
- @IssueTracking("https://issues.jboss.org/browse/RF-10264")
- public void testDeepExpansion() {
- for (int[] path : PATHS) {
- for (int d = 1; d <= path.length; d++) {
- int number = path[d - 1];
- treeNode = (d == 1) ? tree.getNode(number) : treeNode.getNode(number);
-
- if (d < DEPTH) {
- assertNodeState(NodeState.COLLAPSED);
- treeNode.expand();
- assertNodeState(NodeState.EXPANDED);
- } else {
- assertNodeState(NodeState.LEAF);
- }
- }
- }
- }
-
- @Test
- @IssueTracking("https://issues.jboss.org/browse/RF-10264")
- public void testDeepCollapsion() {
- Deque<TreeNodeModel> stack = new LinkedList<TreeNodeModel>();
-
- testDeepExpansion();
-
- for (TreeNodeModel treeNode1 : tree.getExpandedNodes()) {
- stack.push(treeNode1);
- for (TreeNodeModel treeNode2 : treeNode1.getExpandedNodes()) {
- stack.push(treeNode2);
- }
- }
-
- while ((treeNode = stack.poll()) != null) {
- treeNode.expand();
- }
- }
-
- public void assertNodeState(NodeState state) {
- assertEquals(treeNode.isLeaf() && treeNode.getIcon().isLeaf() && treeNode.getHandle().isLeaf(),
- state == NodeState.LEAF);
- assertEquals(treeNode.isCollapsed() && treeNode.getIcon().isCollapsed() && treeNode.getHandle().isCollapsed(),
- state == NodeState.COLLAPSED);
- assertEquals(treeNode.isExpanded() && treeNode.getIcon().isExpanded() && treeNode.getHandle().isExpanded(),
- state == NodeState.EXPANDED);
- }
-
- public enum NodeState {
- LEAF, COLLAPSED, EXPANDED;
- }
-}
Copied: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeToggling.java (from rev 21159, modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeExpansion.java)
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeToggling.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeToggling.java 2011-01-23 20:29:41 UTC (rev 21160)
@@ -0,0 +1,145 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richTree;
+
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
+
+import java.net.URL;
+import java.util.Deque;
+import java.util.LinkedList;
+
+import org.richfaces.component.SwitchType;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestTreeToggling extends AbstractMetamerTest {
+
+ private static final int TOP_LEVEL_NODES = 4;
+ private static final int DEPTH = 3;
+
+ int[][] PATHS = new int[][] { { 3, 2, 1 }, { 2, 4, 1 } };
+
+ private TreeAttributes treeAttributes = new TreeAttributes(jq("span[id*=attributes]"));
+ private TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
+ private TreeNodeModel treeNode;
+
+ @Inject
+ @Use(enumeration = true)
+ SwitchType toggleType = SwitchType.ajax;
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richTree/simple.xhtml");
+ }
+
+ @BeforeMethod
+ public void verifyInitialState() {
+ treeAttributes.setToggleType(toggleType);
+ tree.setToggleType(toggleType);
+ assertEquals(tree.getCollapsedNodesCount(), TOP_LEVEL_NODES);
+ assertEquals(tree.getExpandedNodesCount(), 0);
+ }
+
+ @Test
+ public void testTopLevelNodesExpansion() {
+ for (int i = 1; i <= TOP_LEVEL_NODES; i++) {
+ treeNode = tree.getNode(i);
+ treeNode.expand();
+ assertEquals(tree.getCollapsedNodesCount(), TOP_LEVEL_NODES - i);
+ assertEquals(tree.getExpandedNodesCount(), i);
+ assertTrue(treeNode.isExpanded());
+ }
+ }
+
+ @Test
+ public void testTopLevelNodesCollapsion() {
+ testTopLevelNodesExpansion();
+ for (int i = 1; i <= TOP_LEVEL_NODES; i++) {
+ treeNode = tree.getNode(i);
+ treeNode.expand();
+ assertEquals(tree.getCollapsedNodesCount(), i);
+ assertEquals(tree.getExpandedNodesCount(), TOP_LEVEL_NODES - i);
+ assertTrue(treeNode.isCollapsed());
+ }
+ }
+
+ @Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10264")
+ public void testDeepExpansion() {
+ for (int[] path : PATHS) {
+ for (int d = 1; d <= path.length; d++) {
+ int number = path[d - 1];
+ treeNode = (d == 1) ? tree.getNode(number) : treeNode.getNode(number);
+
+ if (d < DEPTH) {
+ assertNodeState(NodeState.COLLAPSED);
+ treeNode.expand();
+ assertNodeState(NodeState.EXPANDED);
+ } else {
+ assertNodeState(NodeState.LEAF);
+ }
+ }
+ }
+ }
+
+ @Test
+ public void testDeepCollapsion() {
+ Deque<TreeNodeModel> stack = new LinkedList<TreeNodeModel>();
+
+ testDeepExpansion();
+
+ for (TreeNodeModel treeNode1 : tree.getExpandedNodes()) {
+ stack.push(treeNode1);
+ for (TreeNodeModel treeNode2 : treeNode1.getExpandedNodes()) {
+ stack.push(treeNode2);
+ }
+ }
+
+ while ((treeNode = stack.poll()) != null) {
+ treeNode.expand();
+ }
+ }
+
+ public void assertNodeState(NodeState state) {
+ assertEquals(treeNode.isLeaf() && treeNode.getIcon().isLeaf() && treeNode.getHandle().isLeaf(),
+ state == NodeState.LEAF);
+ assertEquals(treeNode.isCollapsed() && treeNode.getIcon().isCollapsed() && treeNode.getHandle().isCollapsed(),
+ state == NodeState.COLLAPSED);
+ assertEquals(treeNode.isExpanded() && treeNode.getIcon().isExpanded() && treeNode.getHandle().isExpanded(),
+ state == NodeState.EXPANDED);
+ }
+
+ public enum NodeState {
+ LEAF, COLLAPSED, EXPANDED;
+ }
+}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeModel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeModel.java 2011-01-22 22:48:17 UTC (rev 21159)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeModel.java 2011-01-23 20:29:41 UTC (rev 21160)
@@ -30,12 +30,12 @@
*/
public class TreeModel extends AbstractTreeNodeModel {
- SwitchType toggleType;
- SwitchType selectionType;
+ SwitchType toggleType = SwitchType.ajax;
+ SwitchType selectionType = SwitchType.ajax;
public TreeModel(JQueryLocator root) {
super(root);
- this.setTree(this);
+ this.tree = this;
}
public void setToggleType(SwitchType toggleType) {
@@ -55,6 +55,6 @@
}
public TreeNodeModel getAnyNode() {
- return new TreeNodeModel(root.getLocator().getDescendant(treeNode));
+ return new TreeNodeModel(root.getLocator().getDescendant(treeNode), tree);
}
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeModel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeModel.java 2011-01-22 22:48:17 UTC (rev 21159)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeModel.java 2011-01-23 20:29:41 UTC (rev 21160)
@@ -21,6 +21,7 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.richTree;
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guard;
import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
import static org.jboss.test.selenium.locator.reference.ReferencedLocator.ref;
@@ -31,7 +32,9 @@
import org.jboss.test.selenium.locator.ExtendedLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.locator.reference.ReferencedLocator;
+import org.jboss.test.selenium.request.RequestType;
import org.junit.Assert;
+import org.richfaces.component.SwitchType;
import org.richfaces.tests.metamer.ftest.model.AbstractModel;
import org.richfaces.tests.metamer.ftest.model.ModelIterable;
@@ -56,8 +59,9 @@
private ReferencedLocator<JQueryLocator> icon = ref(content, "> .rf-trn-ico");
private ReferencedLocator<JQueryLocator> label = ref(content, "> .rf-trn-lbl");
- public TreeNodeModel(JQueryLocator root) {
+ public TreeNodeModel(JQueryLocator root, TreeModel tree) {
super(root);
+ this.tree = tree;
}
public ExtendedLocator<JQueryLocator> getTreeNode() {
@@ -97,10 +101,21 @@
}
public void expand() {
- guardXhr(selenium).click(getHandle());
+ guard(selenium, getRequestType(tree.getToggleType())).click(getHandle());
}
public void select() {
guardXhr(selenium).clickAt(getLabel(), new Point(0,0));
}
+
+ private RequestType getRequestType(SwitchType switchType) {
+ switch (switchType) {
+ case ajax:
+ return RequestType.XHR;
+ case server:
+ return RequestType.HTTP;
+ default:
+ return RequestType.NONE;
+ }
+ }
}
13 years, 11 months
JBoss Rich Faces SVN: r21159 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richDataTable and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-22 17:48:17 -0500 (Sat, 22 Jan 2011)
New Revision: 21159
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestInstantAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataTable/TestDataTableSortingUsingColumn.java
Log:
modified issue tracking for RF-9932 and RF-9118
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestInstantAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestInstantAttributes.java 2011-01-22 22:47:42 UTC (rev 21158)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestInstantAttributes.java 2011-01-22 22:48:17 UTC (rev 21159)
@@ -69,8 +69,7 @@
}
@Test
- @IssueTracking({ "https://issues.jboss.org/browse/RF-9118",
- "https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1788" })
+ @IssueTracking({ "https://issues.jboss.org/browse/RF-9118", "http://java.net/jira/browse/JAVASERVERFACES-1788" })
public void testOnError() {
for (int i = 0; i < 2; i++) {
attributes.setOnError(alert.parametrize("error" + i));
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataTable/TestDataTableSortingUsingColumn.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataTable/TestDataTableSortingUsingColumn.java 2011-01-22 22:47:42 UTC (rev 21158)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataTable/TestDataTableSortingUsingColumn.java 2011-01-22 22:48:17 UTC (rev 21159)
@@ -97,7 +97,8 @@
@Test
@Override
- @IssueTracking("https://issues.jboss.org/browse/RF-9932")
+ @IssueTracking({ "https://issues.jboss.org/browse/RF-9932",
+ "http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-790" })
public void testSortModeMultiRerenderAll() {
super.testSortModeMultiRerenderAll();
}
13 years, 11 months
JBoss Rich Faces SVN: r21158 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richAutocomplete and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-22 17:47:42 -0500 (Sat, 22 Jan 2011)
New Revision: 21158
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/Autocomplete.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteByKeys.java
Log:
rich:autocomplete - fixed and removed issue tracking for RF-10254
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/Autocomplete.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/Autocomplete.java 2011-01-22 20:30:44 UTC (rev 21157)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/Autocomplete.java 2011-01-22 22:47:42 UTC (rev 21158)
@@ -21,11 +21,12 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.model;
+import static org.jboss.test.selenium.javascript.JQueryScript.jqObject;
+import static org.jboss.test.selenium.javascript.JQueryScript.jqScript;
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static org.jboss.test.selenium.waiting.WaitFactory.elementPresent;
+import static org.jboss.test.selenium.waiting.WaitFactory.waitGui;
import static org.richfaces.tests.metamer.ftest.AbstractMetamerTest.pjq;
-import static org.jboss.test.selenium.locator.LocatorFactory.jq;
-import static org.jboss.test.selenium.javascript.JQueryScript.jqScript;
-import static org.jboss.test.selenium.javascript.JQueryScript.jqObject;
-import static org.jboss.test.selenium.waiting.WaitFactory.*;
import java.awt.event.KeyEvent;
@@ -41,8 +42,7 @@
* @version $Revision$
*/
public class Autocomplete implements Model {
-
- private static String KEY_ENTER = "13";
+
private static String KEY_UP = "38";
private static String KEY_DOWN = "40";
@@ -120,7 +120,7 @@
}
public void pressEnter() {
- selenium.keyDown(input, KEY_ENTER);
+ selenium.keyDownNative(Integer.toString(KeyEvent.VK_ENTER));
}
public void pressLeft() {
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteByKeys.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteByKeys.java 2011-01-22 20:30:44 UTC (rev 21157)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteByKeys.java 2011-01-22 22:47:42 UTC (rev 21158)
@@ -25,6 +25,7 @@
import static org.jboss.test.selenium.RequestTypeModelGuard.guardNoRequest;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
import java.net.URL;
import java.util.LinkedList;
@@ -57,11 +58,11 @@
@Inject
@Use(booleans = { true, false })
- Boolean autofill = false;
+ Boolean autofill;
@Inject
@Use(booleans = { true, false })
- Boolean selectFirst = false;
+ Boolean selectFirst;
List<Capital> capitals = Model.unmarshallCapitals();
@@ -86,6 +87,7 @@
assertCompletionVisible(true);
confirm();
assertCompletionVisible(false);
+ assertTrue(autocomplete.getInputText().toLowerCase().startsWith(getExpectedStateForPrefix().toLowerCase()));
}
@Test
@@ -141,7 +143,7 @@
}
public int getExpectedSelectedOptionIndex() {
- return (selectFirst) ? 0 : -1;
+ return (selectFirst && partialInput.length() > 0) ? 0 : -1;
}
public List<String> getStatesByPrefix(String prefix) {
13 years, 11 months
JBoss Rich Faces SVN: r21156 - in modules/tests/metamer/trunk: application/src/main/webapp/components/richCollapsibleSubTable and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-22 14:04:35 -0500 (Sat, 22 Jan 2011)
New Revision: 21156
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/components1.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/components2.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/facets.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/filtering.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/scroller.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/sorting-using-column.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/CollapsibleSubTable.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/CollapsibleSubTableAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/TestCollapsibleSubTableSimple.java
Log:
integrated fixes for RF-10181, RF-10217
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java 2011-01-21 16:03:53 UTC (rev 21155)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java 2011-01-22 19:04:35 UTC (rev 21156)
@@ -79,6 +79,9 @@
// filtering
private Map<String, Object> filtering = new HashMap<String, Object>();
+
+ // expanded
+ private Map<List<Employee>, Boolean> expanded = new HashMap<List<Employee>, Boolean>();
/**
* Initializes the managed bean.
@@ -89,12 +92,12 @@
logger.debug("initializing bean " + getClass().getName());
attributes = Attributes.getComponentAttributesFromFacesConfig(UICollapsibleSubTable.class, getClass());
-
- attributes.setAttribute("expanded", true);
+
attributes.setAttribute("rendered", true);
attributes.setAttribute("rows", 5);
// TODO these attributes have to be tested in another way
+ attributes.remove("expanded");
attributes.remove("columns");
attributes.remove("selection");
attributes.remove("filterVar");
@@ -120,6 +123,9 @@
lists = new ArrayList<List<Employee>>();
lists.add(men);
lists.add(women);
+
+ expanded.put(men, true);
+ expanded.put(women, true);
state = true;
}
@@ -175,4 +181,8 @@
public Map<String, Object> getFiltering() {
return filtering;
}
+
+ public Map<List<Employee>, Boolean> getExpanded() {
+ return expanded;
+ }
}
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java 2011-01-21 16:03:53 UTC (rev 21155)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java 2011-01-22 19:04:35 UTC (rev 21156)
@@ -28,7 +28,6 @@
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
-import java.util.TreeMap;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/components1.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/components1.xhtml 2011-01-21 16:03:53 UTC (rev 21155)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/components1.xhtml 2011-01-22 19:04:35 UTC (rev 21156)
@@ -42,7 +42,7 @@
<ui:define name="component">
- <rich:dataTable id="dataTable" value="#{richSubTableBean.lists}" var="list">
+ <rich:dataTable id="dataTable" value="#{richSubTableBean.lists}" var="list" keepSaved="true">
<f:facet name="header">
<rich:columnGroup>
<rich:column id="columnHeaderEmployees" colspan="6">
@@ -87,7 +87,6 @@
<rich:collapsibleSubTable id="richSubTable"
breakBefore="#{richSubTableBean.attributes['breakBefore'].value}"
expandMode="#{richSubTableBean.attributes['expandMode'].value}"
- expanded="#{richSubTableBean.attributes['expanded'].value}"
filterVar="#{richSubTableBean.attributes['filterVar'].value}"
filteringListeners="#{richSubTableBean.attributes['filteringListeners'].value}"
first="#{richSubTableBean.attributes['first'].value}"
@@ -113,6 +112,12 @@
sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
sortingListeners="#{richSubTableBean.attributes['sortingListeners'].value}"
toggleListeners="#{richSubTableBean.attributes['toggleListeners'].value}"
+ columnClasses="#{richSubTableBean.attributes['columnClasses'].value}"
+ footerClass="#{richSubTableBean.attributes['footerClass'].value}"
+ headerClass="#{richSubTableBean.attributes['headerClass'].value}"
+ rowClass="#{richSubTableBean.attributes['rowClass'].value}"
+ rowClasses="#{richSubTableBean.attributes['rowClasses'].value}"
+ expanded="#{richSubTableBean.expanded[list]}"
value="#{list}"
var="item">
<rich:column id="columnSex">
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/components2.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/components2.xhtml 2011-01-21 16:03:53 UTC (rev 21155)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/components2.xhtml 2011-01-22 19:04:35 UTC (rev 21156)
@@ -41,7 +41,7 @@
<ui:define name="component">
- <rich:dataTable id="dataTable" value="#{richSubTableBean.lists}" var="list">
+ <rich:dataTable id="dataTable" value="#{richSubTableBean.lists}" var="list" keepSaved="true">
<f:facet name="header">
<rich:columnGroup>
<rich:column id="columnHeaderEmployees" colspan="6">
@@ -86,7 +86,6 @@
<rich:collapsibleSubTable id="richSubTable"
breakBefore="#{richSubTableBean.attributes['breakBefore'].value}"
expandMode="#{richSubTableBean.attributes['expandMode'].value}"
- expanded="#{richSubTableBean.attributes['expanded'].value}"
filterVar="#{richSubTableBean.attributes['filterVar'].value}"
filteringListeners="#{richSubTableBean.attributes['filteringListeners'].value}"
first="#{richSubTableBean.attributes['first'].value}"
@@ -112,6 +111,12 @@
sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
sortingListeners="#{richSubTableBean.attributes['sortingListeners'].value}"
toggleListeners="#{richSubTableBean.attributes['toggleListeners'].value}"
+ columnClasses="#{richSubTableBean.attributes['columnClasses'].value}"
+ footerClass="#{richSubTableBean.attributes['footerClass'].value}"
+ headerClass="#{richSubTableBean.attributes['headerClass'].value}"
+ rowClass="#{richSubTableBean.attributes['rowClass'].value}"
+ rowClasses="#{richSubTableBean.attributes['rowClasses'].value}"
+ expanded="#{richSubTableBean.expanded[list]}"
value="#{list}"
var="item">
<rich:column id="columnSex">
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/facets.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/facets.xhtml 2011-01-21 16:03:53 UTC (rev 21155)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/facets.xhtml 2011-01-22 19:04:35 UTC (rev 21156)
@@ -47,10 +47,8 @@
</ui:define>
<ui:define name="component">
-
- #{nestedComponentId}
- <rich:dataTable id="richDataTable" value="#{richSubTableBean.lists}" var="list">
+ <rich:dataTable id="richDataTable" value="#{richSubTableBean.lists}" var="list" keepSaved="true">
<f:facet name="header">
<rich:columnGroup id="columnGroup">
<rich:column id="columnHeaderEmployees" colspan="3">
@@ -76,7 +74,6 @@
<rich:collapsibleSubTable id="richSubTable"
breakBefore="#{richSubTableBean.attributes['breakBefore'].value}"
expandMode="#{richSubTableBean.attributes['expandMode'].value}"
- expanded="#{richSubTableBean.attributes['expanded'].value}"
filterVar="#{richSubTableBean.attributes['filterVar'].value}"
filteringListeners="#{richSubTableBean.attributes['filteringListeners'].value}"
first="#{richSubTableBean.attributes['first'].value}"
@@ -102,6 +99,12 @@
sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
sortingListeners="#{richSubTableBean.attributes['sortingListeners'].value}"
toggleListeners="#{richSubTableBean.attributes['toggleListeners'].value}"
+ columnClasses="#{richSubTableBean.attributes['columnClasses'].value}"
+ footerClass="#{richSubTableBean.attributes['footerClass'].value}"
+ headerClass="#{richSubTableBean.attributes['headerClass'].value}"
+ rowClass="#{richSubTableBean.attributes['rowClass'].value}"
+ rowClasses="#{richSubTableBean.attributes['rowClasses'].value}"
+ expanded="#{richSubTableBean.expanded[list]}"
value="#{richSubTableBean.state ? list : null}"
var="item">
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/filtering.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/filtering.xhtml 2011-01-21 16:03:53 UTC (rev 21155)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/filtering.xhtml 2011-01-22 19:04:35 UTC (rev 21156)
@@ -48,7 +48,7 @@
<ui:define name="component">
- <rich:dataTable id="richDataTable" value="#{richSubTableBean.lists}" var="list">
+ <rich:dataTable id="richDataTable" value="#{richSubTableBean.lists}" var="list" keepSaved="true">
<f:facet name="header">
<rich:columnGroup id="columnGroup">
<rich:column id="columnHeaderEmployees" colspan="3">
@@ -86,7 +86,6 @@
<rich:collapsibleSubTable id="richSubTable"
breakBefore="#{richSubTableBean.attributes['breakBefore'].value}"
expandMode="#{richSubTableBean.attributes['expandMode'].value}"
- expanded="#{richSubTableBean.attributes['expanded'].value}"
filterVar="#{richSubTableBean.attributes['filterVar'].value}"
filteringListeners="#{richSubTableBean.attributes['filteringListeners'].value}"
first="#{richSubTableBean.attributes['first'].value}"
@@ -112,6 +111,12 @@
sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
sortingListeners="#{richSubTableBean.attributes['sortingListeners'].value}"
toggleListeners="#{richSubTableBean.attributes['toggleListeners'].value}"
+ columnClasses="#{richSubTableBean.attributes['columnClasses'].value}"
+ footerClass="#{richSubTableBean.attributes['footerClass'].value}"
+ headerClass="#{richSubTableBean.attributes['headerClass'].value}"
+ rowClass="#{richSubTableBean.attributes['rowClass'].value}"
+ rowClasses="#{richSubTableBean.attributes['rowClasses'].value}"
+ expanded="#{richSubTableBean.expanded[list]}"
value="#{richSubTableBean.state ? list : null}"
var="item">
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/scroller.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/scroller.xhtml 2011-01-21 16:03:53 UTC (rev 21155)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/scroller.xhtml 2011-01-22 19:04:35 UTC (rev 21156)
@@ -47,7 +47,7 @@
<ui:define name="component">
- <rich:dataTable id="richDataTable" value="#{richSubTableBean.lists}" var="list">
+ <rich:dataTable id="richDataTable" value="#{richSubTableBean.lists}" var="list" keepSaved="true">
<f:facet name="header">
<rich:columnGroup id="columnGroup">
<rich:column id="columnHeaderEmployees" colspan="3">
@@ -73,7 +73,6 @@
<rich:collapsibleSubTable id="richSubTable"
breakBefore="#{richSubTableBean.attributes['breakBefore'].value}"
expandMode="#{richSubTableBean.attributes['expandMode'].value}"
- expanded="#{richSubTableBean.attributes['expanded'].value}"
filterVar="#{richSubTableBean.attributes['filterVar'].value}"
filteringListeners="#{richSubTableBean.attributes['filteringListeners'].value}"
first="#{richSubTableBean.attributes['first'].value}"
@@ -99,6 +98,12 @@
sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
sortingListeners="#{richSubTableBean.attributes['sortingListeners'].value}"
toggleListeners="#{richSubTableBean.attributes['toggleListeners'].value}"
+ columnClasses="#{richSubTableBean.attributes['columnClasses'].value}"
+ footerClass="#{richSubTableBean.attributes['footerClass'].value}"
+ headerClass="#{richSubTableBean.attributes['headerClass'].value}"
+ rowClass="#{richSubTableBean.attributes['rowClass'].value}"
+ rowClasses="#{richSubTableBean.attributes['rowClasses'].value}"
+ expanded="#{richSubTableBean.expanded[list]}"
value="#{richSubTableBean.state ? list : null}"
var="item">
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/simple.xhtml 2011-01-21 16:03:53 UTC (rev 21155)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/simple.xhtml 2011-01-22 19:04:35 UTC (rev 21156)
@@ -47,7 +47,7 @@
<ui:define name="component">
- <rich:dataTable id="richDataTable" value="#{richSubTableBean.lists}" var="list">
+ <rich:dataTable id="richDataTable" value="#{richSubTableBean.lists}" var="list" keepSaved="true">
<f:facet name="header">
<rich:columnGroup id="columnGroup">
<rich:column id="columnHeaderEmployees" colspan="3">
@@ -73,7 +73,6 @@
<rich:collapsibleSubTable id="richSubTable"
breakBefore="#{richSubTableBean.attributes['breakBefore'].value}"
expandMode="#{richSubTableBean.attributes['expandMode'].value}"
- expanded="#{richSubTableBean.attributes['expanded'].value}"
filterVar="#{richSubTableBean.attributes['filterVar'].value}"
filteringListeners="#{richSubTableBean.attributes['filteringListeners'].value}"
first="#{richSubTableBean.attributes['first'].value}"
@@ -99,6 +98,12 @@
sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
sortingListeners="#{richSubTableBean.attributes['sortingListeners'].value}"
toggleListeners="#{richSubTableBean.attributes['toggleListeners'].value}"
+ columnClasses="#{richSubTableBean.attributes['columnClasses'].value}"
+ footerClass="#{richSubTableBean.attributes['footerClass'].value}"
+ headerClass="#{richSubTableBean.attributes['headerClass'].value}"
+ rowClass="#{richSubTableBean.attributes['rowClass'].value}"
+ rowClasses="#{richSubTableBean.attributes['rowClasses'].value}"
+ expanded="#{richSubTableBean.expanded[list]}"
value="#{richSubTableBean.state ? list : null}"
var="item">
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/sorting-using-column.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/sorting-using-column.xhtml 2011-01-21 16:03:53 UTC (rev 21155)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/sorting-using-column.xhtml 2011-01-22 19:04:35 UTC (rev 21156)
@@ -47,7 +47,7 @@
<ui:define name="component">
- <rich:dataTable id="richDataTable" value="#{richSubTableBean.lists}" var="list">
+ <rich:dataTable id="richDataTable" value="#{richSubTableBean.lists}" var="list" keepSaved="true">
<f:facet name="header">
<rich:columnGroup id="columnGroup">
<rich:column id="columnHeaderEmployees" colspan="3">
@@ -74,7 +74,6 @@
binding="#{richSubTableBean.binding}"
breakBefore="#{richSubTableBean.attributes['breakBefore'].value}"
expandMode="#{richSubTableBean.attributes['expandMode'].value}"
- expanded="#{richSubTableBean.attributes['expanded'].value}"
filterVar="#{richSubTableBean.attributes['filterVar'].value}"
filteringListeners="#{richSubTableBean.attributes['filteringListeners'].value}"
first="#{richSubTableBean.attributes['first'].value}"
@@ -100,6 +99,12 @@
sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
sortingListeners="#{richSubTableBean.attributes['sortingListeners'].value}"
toggleListeners="#{richSubTableBean.attributes['toggleListeners'].value}"
+ columnClasses="#{richSubTableBean.attributes['columnClasses'].value}"
+ footerClass="#{richSubTableBean.attributes['footerClass'].value}"
+ headerClass="#{richSubTableBean.attributes['headerClass'].value}"
+ rowClass="#{richSubTableBean.attributes['rowClass'].value}"
+ rowClasses="#{richSubTableBean.attributes['rowClasses'].value}"
+ expanded="#{richSubTableBean.expanded[list]}"
value="#{richSubTableBean.state ? list : null}"
var="item">
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/CollapsibleSubTable.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/CollapsibleSubTable.java 2011-01-21 16:03:53 UTC (rev 21155)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/CollapsibleSubTable.java 2011-01-22 19:04:35 UTC (rev 21156)
@@ -5,6 +5,7 @@
import org.jboss.test.selenium.framework.AjaxSelenium;
import org.jboss.test.selenium.framework.AjaxSeleniumProxy;
+import org.jboss.test.selenium.locator.ElementLocator;
import org.jboss.test.selenium.locator.ExtendedLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.locator.reference.ReferencedLocator;
@@ -13,7 +14,7 @@
AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
- JQueryLocator subtableRow = jq("tr[class^=rf-cst][class$=-r]");
+ JQueryLocator subtableRow = jq("tr[class*=rf-cst-][class*=-r]");
JQueryLocator subtableCell = jq("td.rf-cst-c");
ReferencedLocator<JQueryLocator> noData = ref(root, "> tr.rf-cst-nd > td.rf-cst-nd-c");
@@ -25,6 +26,14 @@
public CollapsibleSubTable(JQueryLocator root) {
super(root);
}
+
+ public JQueryLocator getAnyRow() {
+ return root.getLocator().getChild(subtableRow);
+ }
+
+ public JQueryLocator getAnyCellInColumn(int column) {
+ return root.getLocator().getChild(subtableRow).getChild(subtableCell).getNthChildElement(column);
+ }
public Iterable<JQueryLocator> getRows() {
return root.getLocator().getChildren(subtableRow);
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/CollapsibleSubTableAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/CollapsibleSubTableAttributes.java 2011-01-21 16:03:53 UTC (rev 21155)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/CollapsibleSubTableAttributes.java 2011-01-22 19:04:35 UTC (rev 21156)
@@ -80,4 +80,24 @@
public void setSortPriority(Collection<String> sortPriority) {
setProperty("sortPriority", sortPriority);
}
+
+ public void setColumnClasses(String columnClasses) {
+ setProperty("columnClasses", columnClasses);
+ }
+
+ public void setRowClasses(String rowClasses) {
+ setProperty("rowClasses", rowClasses);
+ }
+
+ public void setRowClass(String rowClass) {
+ setProperty("rowClass", rowClass);
+ }
+
+ public void setHeaderClass(String headerClass) {
+ setProperty("headerClass", headerClass);
+ }
+
+ public void setFooterClass(String footerClass) {
+ setProperty("footerClass", footerClass);
+ }
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/TestCollapsibleSubTableSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/TestCollapsibleSubTableSimple.java 2011-01-21 16:03:53 UTC (rev 21155)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/TestCollapsibleSubTableSimple.java 2011-01-22 19:04:35 UTC (rev 21156)
@@ -21,16 +21,18 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.richCollapsibleSubTable;
+import static org.jboss.test.selenium.JQuerySelectors.append;
+import static org.jboss.test.selenium.JQuerySelectors.not;
import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guard;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
-import static org.testng.Assert.fail;
import java.net.URL;
import java.util.List;
+import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.request.RequestType;
import org.richfaces.ExpandMode;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
@@ -51,7 +53,6 @@
@Test
@Use(field = "expandMode", enumeration = true)
- @IssueTracking("https://issues.jboss.org/browse/RF-10181")
public void testExpandMode() {
final RequestType requestType = getRequestTypeForExpandMode();
@@ -144,10 +145,40 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-10217")
- @Use(field = "configuration", empty = true)
- public void testClasses() {
- // TODO classes are currently not working
- fail();
+ public void testColumnClasses() {
+ attributes.setColumnClasses("col1,col2,col3");
+ for (int i = 1; i <= 3; i++) {
+ JQueryLocator anyCellInColumn = subtable.getAnyCellInColumn(i);
+ JQueryLocator haveClassSet = append(anyCellInColumn, ".col" + i);
+ JQueryLocator haveNotClassSet = not(anyCellInColumn, ".col" + i);
+ assertTrue(selenium.isElementPresent(haveClassSet) && selenium.isVisible(haveClassSet));
+ assertFalse(selenium.isElementPresent(haveNotClassSet));
+ }
}
+
+ @Test
+ public void testRowClasses() {
+ attributes.setRows(13);
+ attributes.setRowClasses("row1,row2,row3");
+
+ int rowCount = subtable.getRowCount();
+ assertEquals(rowCount, 13);
+
+ for (int i = 1; i <= rowCount; i++) {
+ JQueryLocator row = subtable.getRow(i);
+ selenium.belongsClass(row, "row" + (i + 1 % 3));
+ }
+ }
+
+ @Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10212")
+ public void testRowClass() {
+ attributes.setRows(13);
+ attributes.setRowClass("rowClass");
+ JQueryLocator anyRow = subtable.getAnyRow();
+ JQueryLocator haveClassSet = append(anyRow, ".rowClass");
+ JQueryLocator haveNotClassSet = not(append(anyRow, ":visible"), ".rowClass");
+ assertEquals(selenium.getCount(haveClassSet), 13);
+ assertEquals(selenium.getCount(haveNotClassSet), 0);
+ }
}
13 years, 11 months