JBoss Rich Faces SVN: r21443 - in branches/enterprise/3.3.X/docs: userguide/en/src/main/docbook/modules and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2011-02-04 00:32:22 -0500 (Fri, 04 Feb 2011)
New Revision: 21443
Modified:
branches/enterprise/3.3.X/docs/cdkguide/en/src/main/docbook/master.xml
branches/enterprise/3.3.X/docs/userguide/en/src/main/docbook/modules/RFCGettingStarted.xml
Log:
Maven sections commented out as per RFPL-1081
Modified: branches/enterprise/3.3.X/docs/cdkguide/en/src/main/docbook/master.xml
===================================================================
--- branches/enterprise/3.3.X/docs/cdkguide/en/src/main/docbook/master.xml 2011-02-03 22:20:40 UTC (rev 21442)
+++ branches/enterprise/3.3.X/docs/cdkguide/en/src/main/docbook/master.xml 2011-02-04 05:32:22 UTC (rev 21443)
@@ -73,7 +73,7 @@
&intro;
&roadmap;
- &setup;
+ <!--&setup;-->
<chapter id="compdev" xreflabel="compdev">
<?dbhtml filename="compdev.html"?>
@@ -215,4 +215,4 @@
&vcpbody;
&vcpmock;
</chapter>
-</book>
\ No newline at end of file
+</book>
Modified: branches/enterprise/3.3.X/docs/userguide/en/src/main/docbook/modules/RFCGettingStarted.xml
===================================================================
--- branches/enterprise/3.3.X/docs/userguide/en/src/main/docbook/modules/RFCGettingStarted.xml 2011-02-03 22:20:40 UTC (rev 21442)
+++ branches/enterprise/3.3.X/docs/userguide/en/src/main/docbook/modules/RFCGettingStarted.xml 2011-02-04 05:32:22 UTC (rev 21443)
@@ -272,7 +272,7 @@
</section>
</section>
- <section>
+<!-- <section>
<title>Integration of RichFaces into Maven Project</title>
<para>In this section we will tell how you can create a simple JSF application with RichFaces using Maven. </para>
<para>In the first place you need to make sure that Maven is installed on you local machine. We will run the JSF application on Tomcat 6.0 server, so please download and install it if you haven't done already so. </para>
@@ -361,29 +361,29 @@
<programlisting role="XML"><![CDATA[
jsf-app
-|-- pom.xml
-`-- src
- |-- main
- | |-- java
- | | `-- org
- | | `-- docs
- | | `-- richfaces
- | | `-- Bean.java
- | |-- resources
- | `-- webapp
- | |-- WEB-INF
- | | |-- faces-config.xml
- | | `-- web.xml
- | |-- index.jsp
- | `-- pages
- | |-- index.jsp
- | `-- index.xhtml
- `-- test
- `-- java
- `-- org
- `-- docs
- `-- richfaces
- `-- BeanTest.java
+|- pom.xml
+`- src
+ |- main
+ | |- java
+ | | `- org
+ | | `- docs
+ | | `- richfaces
+ | | `- Bean.java
+ | |- resources
+ | `- webapp
+ | |- WEB-INF
+ | | |- faces-config.xml
+ | | `- web.xml
+ | |- index.jsp
+ | `- pages
+ | |- index.jsp
+ | `- index.xhtml
+ `- test
+ `- java
+ `- org
+ `- docs
+ `- richfaces
+ `- BeanTest.java
]]></programlisting>
<para>
Now go to "jsf-app" folder, it contains a project descriptor(pom.xml). Open the project descriptor to edit and add dependencies to the <code><dependencies></code> element. Your <code><dependencies></code> element content should be the following:
@@ -449,7 +449,6 @@
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
</dependency>
- <!-- RichFaces libraries -->
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-api</artifactId>
@@ -502,8 +501,8 @@
<para>Now run the application on Tomcat server and open it in your favourite browser by pointing it to "http://localhost:8080/jsf-app/" .</para>
</section>
+-->
-
<!-- RELEVANT RESOURCES LINKS -->
<section id="RelevantResourcesLinks">
13 years, 3 months
JBoss Rich Faces SVN: r21442 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richTreeModelAdaptor and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-03 17:20:40 -0500 (Thu, 03 Feb 2011)
New Revision: 21442
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/RecursiveModelRepresentation.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorLazyLoading.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorToggling.java
Removed:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/RecursiveModelRepresentation.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorLazyLoading.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorSelection.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorToggling.java
Log:
renamed treeModelAdaptor package to richTreeModelAdaptor
Copied: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/RecursiveModelRepresentation.java (from rev 21441, modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/RecursiveModelRepresentation.java)
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/RecursiveModelRepresentation.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/RecursiveModelRepresentation.java 2011-02-03 22:20:40 UTC (rev 21442)
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * 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.richTreeModelAdaptor;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public enum RecursiveModelRepresentation {
+ MAP, LIST;
+}
Copied: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorLazyLoading.java (from rev 21441, modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorLazyLoading.java)
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorLazyLoading.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorLazyLoading.java 2011-02-03 22:20:40 UTC (rev 21442)
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * 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.richTreeModelAdaptor;
+
+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 java.net.URL;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.SortedSet;
+import java.util.TreeSet;
+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.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.richTree.TreeAttributes;
+import org.richfaces.tests.metamer.ftest.richTree.TreeModel;
+import org.richfaces.tests.metamer.ftest.richTree.TreeNodeModel;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestTreeModelAdaptorLazyLoading extends AbstractMetamerTest {
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richTree/treeAdaptors.xhtml");
+ }
+
+ protected TreeAttributes treeAttributes = new TreeAttributes(jq("span[id*=treeAttributes]"));
+ protected TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
+ protected TreeNodeModel treeNode;
+
+ JQueryLocator lazyInitialized = pjq("span[id$=lazyInitialized]");
+
+ protected Integer[][] paths = new Integer[][] { { 1, 1, 1, 8, 1 }, { 4, 4, 11, 4 } };
+
+ @Test
+ public void testLazyLoading() {
+ List<String> expected = getListOfVisibleNodes();
+ List<String> actual = getLazyInitialized();
+
+ assertEquals(actual, expected);
+
+ for (Integer[] path : paths) {
+ treeNode = null;
+ for (int i = 0; i < path.length; i++) {
+ int index = path[i];
+ treeNode = (treeNode == null) ? tree.getNode(index) : treeNode.getNode(index);
+ if (i < path.length - 1) {
+ treeNode.expand();
+
+ expected = getListOfVisibleNodes();
+ actual = getLazyInitialized();
+
+ assertEquals(actual, expected);
+ }
+ }
+ }
+ }
+
+ private List<String> getListOfVisibleNodes() {
+ // takes only recursive nodes + model node (representing leaves)
+ Pattern pattern = Pattern.compile("([RM\\-\\.0-9]+)(?:-.*)?");
+ SortedSet<String> result = new TreeSet<String>();
+ for (TreeNodeModel treeNode : tree.getAnyNodes()) {
+ String labelText = treeNode.getLabelText();
+
+ Matcher matcher = pattern.matcher(labelText);
+
+ if (matcher.matches()) {
+ String node = matcher.group(1);
+ result.add(node);
+ }
+ }
+ return new LinkedList<String>(result);
+ }
+
+ private List<String> getLazyInitialized() {
+ String unseparated = selenium.getText(lazyInitialized);
+ String[] separated = StringUtils.split(unseparated, "[], ");
+ List<String> result = Arrays.asList(separated);
+ Collections.sort(result);
+ return result;
+ }
+}
Copied: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java (from rev 21441, modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorSelection.java)
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java 2011-02-03 22:20:40 UTC (rev 21442)
@@ -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.richTreeModelAdaptor;
+
+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 java.net.URL;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.richfaces.tests.metamer.ftest.annotations.Uses;
+import org.richfaces.tests.metamer.ftest.richTree.TestTreeSelection;
+import org.richfaces.tests.metamer.ftest.richTree.TreeAttributes;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestTreeModelAdaptorSelection extends TestTreeSelection {
+
+ @Inject
+ PathsCrate paths;
+ PathsCrate pathsForListModel = new PathsCrate("listModel", new Integer[][] { { 2, 1, 3 }, { 3, 3, 2, 2 } });
+ PathsCrate pathsForMapModel = new PathsCrate("mapModel", new Integer[][] { { 2, 1, 5 }, { 3, 3, 2, 6 } });
+ PathsCrate pathsForRecursiveModel = new PathsCrate("recursiveModel", new Integer[][] { { 4, 1, 10, 2 },
+ { 1, 4, 3, 11, 4, 1 } });
+
+ @Inject
+ @Use(enumeration = true)
+ public RecursiveModelRepresentation representation = RecursiveModelRepresentation.LIST;
+
+ @Inject
+ @Use(booleans = { true, false })
+ public boolean recursiveLeafChildrenNullable;
+
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "http://localhost:8080/metamer/faces/components/richTree/treeAdaptors.xhtml");
+ }
+
+ @BeforeClass
+ public void initTreeAttributes() {
+ treeAttributes = new TreeAttributes(jq("span[id*=treeAttributes]"));
+ }
+
+ @BeforeMethod
+ public void initPathsAndModelRepresentation() {
+ if (paths != null) {
+ selectionPaths = paths.paths;
+ }
+ if (representation == RecursiveModelRepresentation.MAP) {
+ guardXhr(selenium).click(pjq(":radio[id*=recursiveModelRepresentation]").getNthOccurence(2));
+ }
+ if (recursiveLeafChildrenNullable) {
+ guardXhr(selenium).click(pjq(":checkbox[id$=recursiveLeafChildrenNullable]"));
+ }
+ }
+
+ @Test
+ @Override
+ @Use(field = "paths", empty = true)
+ public void testTopLevelSelection() {
+ super.testTopLevelSelection();
+ }
+
+ @Test
+ @Override
+ @Use(field = "paths", value = "paths*")
+ public void testSubNodesSelection() {
+ super.testSubNodesSelection();
+ }
+
+ @Test
+ @Override
+ @Uses({ @Use(field = "paths", value = "paths*"),
+ @Use(field = "selectionType", value = "eventEnabledSelectionTypes") })
+ public void testSubNodesSelectionEvents() {
+ super.testSubNodesSelectionEvents();
+ }
+
+ @Override
+ protected void expandAll() {
+ for (Integer[] path : selectionPaths) {
+ treeNode = null;
+ for (int i = 0; i < path.length; i++) {
+ int index = path[i];
+ treeNode = (treeNode == null) ? tree.getNode(index) : treeNode.getNode(index);
+ if (i < path.length - 1) {
+ treeNode.expand();
+ }
+ }
+ }
+ }
+
+ @Override
+ protected Integer[] getIntsFromString(String string) {
+ Pattern pattern = Pattern.compile("(?:\\{[^}]+modelKey=(\\d+)\\})");
+ Matcher matcher = pattern.matcher(string);
+ List<Integer> list = new LinkedList<Integer>();
+ while (matcher.find()) {
+ int integer = Integer.valueOf(matcher.group(1)) + 1;
+ integer = fixShiftWhenModelPresent(list, integer);
+ list.add(integer);
+ }
+ if (list.isEmpty()) {
+ throw new IllegalStateException("pattern does not match");
+ }
+ return list.toArray(new Integer[list.size()]);
+ }
+
+ private Integer fixShiftWhenModelPresent(List<Integer> list, int integer) {
+ if (paths.toString().equals(pathsForRecursiveModel.toString())) {
+ if (!list.isEmpty()) {
+ if (list.get(0) % 2 == 0) {
+ if (list.size() == 2) {
+ return integer + 7;
+ }
+ } else {
+ if (list.size() == 3) {
+ return integer + 7;
+ }
+ }
+ }
+ }
+ return integer;
+ }
+
+ private class PathsCrate {
+ String name;
+ Integer[][] paths;
+
+ public PathsCrate(String name, Integer[][] paths) {
+ this.name = name;
+ this.paths = paths;
+ }
+
+ public String toString() {
+ return name;
+ }
+ }
+}
Copied: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSimple.java (from rev 21441, modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorSimple.java)
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSimple.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSimple.java 2011-02-03 22:20:40 UTC (rev 21442)
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.richTreeModelAdaptor;
+
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
+
+import java.net.URL;
+
+import org.jboss.test.selenium.locator.ExtendedLocator;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.richTree.TreeAttributes;
+import org.richfaces.tests.metamer.ftest.richTree.TreeModel;
+import org.richfaces.tests.metamer.ftest.richTree.TreeNodeModel;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestTreeModelAdaptorSimple extends AbstractMetamerTest {
+
+ protected TreeAttributes treeAttributes = new TreeAttributes(jq("span[id*=treeAttributes]"));
+ protected TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
+ protected TreeNodeModel treeNode;
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richTree/treeAdaptors.xhtml");
+ }
+
+ @Test
+ public void testModelAdaptorRendered() {
+ tree.getNode(2).expand();
+ tree.getNode(2).getNode(2).expand();
+ treeNode = tree.getNode(2).getNode(2).getNode(1);
+
+ assertTrue(treeNode.isLeaf());
+
+ modelAdaptorAttributes.setRendered(false);
+
+ assertFalse(treeNode.isLeaf());
+ }
+
+ @Test
+ public void testRecursiveModelAdaptorRendered() {
+ tree.getNode(2).expand();
+ tree.getNode(2).getNode(2).expand();
+
+ boolean subnodePresent = false;
+ for (TreeNodeModel treeNode : tree.getNode(2).getNode(2).getNodes()) {
+ if (!treeNode.isLeaf()) {
+ subnodePresent = true;
+ }
+ }
+ assertTrue(subnodePresent, "there should be at least one subnode (not leaf) in expanded branch");
+
+ recursiveModelAdaptorAttributes.setRendered(false);
+
+ for (TreeNodeModel treeNode : tree.getNode(2).getNode(2).getNodes()) {
+ if (!treeNode.isLeaf()) {
+ fail("there should be no subnode (not leaf) in expanded branch");
+ }
+ }
+ }
+
+ private ModelAdaptorAttributes modelAdaptorAttributes = new ModelAdaptorAttributes(
+ pjq("span[id$=:listAttributes:panel]"));
+ private RecursiveModelAdaptorAttributes recursiveModelAdaptorAttributes = new RecursiveModelAdaptorAttributes(
+ pjq("span[id$=:recursiveAttributes:panel]"));
+
+ private class ModelAdaptorAttributes extends AbstractComponentAttributes {
+
+ public <T extends ExtendedLocator<JQueryLocator>> ModelAdaptorAttributes(T root) {
+ super(root);
+ }
+
+ public void setRendered(Boolean rendered) {
+ setProperty("rendered", rendered);
+ }
+ }
+
+ private class RecursiveModelAdaptorAttributes extends AbstractComponentAttributes {
+
+ public <T extends ExtendedLocator<JQueryLocator>> RecursiveModelAdaptorAttributes(T root) {
+ super(root);
+ }
+
+ public void setRendered(Boolean rendered) {
+ setProperty("rendered", rendered);
+ }
+ }
+}
Copied: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorToggling.java (from rev 21441, modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorToggling.java)
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorToggling.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorToggling.java 2011-02-03 22:20:40 UTC (rev 21442)
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * 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.richTreeModelAdaptor;
+
+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 java.net.URL;
+
+import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.richfaces.tests.metamer.ftest.richTree.TestTreeToggling;
+import org.richfaces.tests.metamer.ftest.richTree.TreeAttributes;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestTreeModelAdaptorToggling extends TestTreeToggling {
+
+ @Inject
+ @Use(enumeration = true)
+ public RecursiveModelRepresentation representation;
+
+ @Inject
+ @Use(booleans = { true, false })
+ public boolean recursiveLeafChildrenNullable;
+
+ @BeforeClass
+ public void initTreeAttributes() {
+ treeAttributes = new TreeAttributes(jq("span[id*=treeAttributes]"));
+ }
+
+ @BeforeMethod
+ public void initPathsAndModelRepresentation() {
+ if (representation == RecursiveModelRepresentation.MAP) {
+ guardXhr(selenium).click(pjq(":radio[id*=recursiveModelRepresentation]").getNthOccurence(2));
+ }
+ if (recursiveLeafChildrenNullable) {
+ guardXhr(selenium).click(pjq(":checkbox[id$=recursiveLeafChildrenNullable]"));
+ }
+ }
+
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "http://localhost:8080/metamer/faces/components/richTree/treeAdaptors.xhtml");
+ }
+
+ @Test
+ @Override
+ public void testTopLevelNodesExpansion() {
+ super.testTopLevelNodesExpansion();
+ }
+
+ @Test
+ @Override
+ public void testTopLevelNodesCollapsion() {
+ super.testTopLevelNodesCollapsion();
+ }
+
+ @Test
+ @Override
+ public void testDeepExpansion() {
+ super.testDeepExpansion();
+ }
+
+ @Test
+ @Override
+ public void testDeepCollapsion() {
+ super.testDeepCollapsion();
+ }
+}
Deleted: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/RecursiveModelRepresentation.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/RecursiveModelRepresentation.java 2011-02-03 22:16:35 UTC (rev 21441)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/RecursiveModelRepresentation.java 2011-02-03 22:20:40 UTC (rev 21442)
@@ -1,30 +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.treeModelAdaptor;
-
-/**
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
-public enum RecursiveModelRepresentation {
- MAP, LIST;
-}
Deleted: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorLazyLoading.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorLazyLoading.java 2011-02-03 22:16:35 UTC (rev 21441)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorLazyLoading.java 2011-02-03 22:20:40 UTC (rev 21442)
@@ -1,112 +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.treeModelAdaptor;
-
-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 java.net.URL;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.SortedSet;
-import java.util.TreeSet;
-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.tests.metamer.ftest.AbstractMetamerTest;
-import org.richfaces.tests.metamer.ftest.richTree.TreeAttributes;
-import org.richfaces.tests.metamer.ftest.richTree.TreeModel;
-import org.richfaces.tests.metamer.ftest.richTree.TreeNodeModel;
-import org.testng.annotations.Test;
-
-/**
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
-public class TestTreeModelAdaptorLazyLoading extends AbstractMetamerTest {
- @Override
- public URL getTestUrl() {
- return buildUrl(contextPath, "faces/components/richTree/treeAdaptors.xhtml");
- }
-
- protected TreeAttributes treeAttributes = new TreeAttributes(jq("span[id*=treeAttributes]"));
- protected TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
- protected TreeNodeModel treeNode;
-
- JQueryLocator lazyInitialized = pjq("span[id$=lazyInitialized]");
-
- protected Integer[][] paths = new Integer[][] { { 1, 1, 1, 8, 1 }, { 4, 4, 11, 4 } };
-
- @Test
- public void testLazyLoading() {
- List<String> expected = getListOfVisibleNodes();
- List<String> actual = getLazyInitialized();
-
- assertEquals(actual, expected);
-
- for (Integer[] path : paths) {
- treeNode = null;
- for (int i = 0; i < path.length; i++) {
- int index = path[i];
- treeNode = (treeNode == null) ? tree.getNode(index) : treeNode.getNode(index);
- if (i < path.length - 1) {
- treeNode.expand();
-
- expected = getListOfVisibleNodes();
- actual = getLazyInitialized();
-
- assertEquals(actual, expected);
- }
- }
- }
- }
-
- private List<String> getListOfVisibleNodes() {
- // takes only recursive nodes + model node (representing leaves)
- Pattern pattern = Pattern.compile("([RM\\-\\.0-9]+)(?:-.*)?");
- SortedSet<String> result = new TreeSet<String>();
- for (TreeNodeModel treeNode : tree.getAnyNodes()) {
- String labelText = treeNode.getLabelText();
-
- Matcher matcher = pattern.matcher(labelText);
-
- if (matcher.matches()) {
- String node = matcher.group(1);
- result.add(node);
- }
- }
- return new LinkedList<String>(result);
- }
-
- private List<String> getLazyInitialized() {
- String unseparated = selenium.getText(lazyInitialized);
- String[] separated = StringUtils.split(unseparated, "[], ");
- List<String> result = Arrays.asList(separated);
- Collections.sort(result);
- return result;
- }
-}
Deleted: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorSelection.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorSelection.java 2011-02-03 22:16:35 UTC (rev 21441)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorSelection.java 2011-02-03 22:20:40 UTC (rev 21442)
@@ -1,168 +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.treeModelAdaptor;
-
-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 java.net.URL;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.richfaces.tests.metamer.ftest.annotations.Inject;
-import org.richfaces.tests.metamer.ftest.annotations.Use;
-import org.richfaces.tests.metamer.ftest.annotations.Uses;
-import org.richfaces.tests.metamer.ftest.richTree.TestTreeSelection;
-import org.richfaces.tests.metamer.ftest.richTree.TreeAttributes;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-/**
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
-public class TestTreeModelAdaptorSelection extends TestTreeSelection {
-
- @Inject
- PathsCrate paths;
- PathsCrate pathsForListModel = new PathsCrate("listModel", new Integer[][] { { 2, 1, 3 }, { 3, 3, 2, 2 } });
- PathsCrate pathsForMapModel = new PathsCrate("mapModel", new Integer[][] { { 2, 1, 5 }, { 3, 3, 2, 6 } });
- PathsCrate pathsForRecursiveModel = new PathsCrate("recursiveModel", new Integer[][] { { 4, 1, 10, 2 },
- { 1, 4, 3, 11, 4, 1 } });
-
- @Inject
- @Use(enumeration = true)
- public RecursiveModelRepresentation representation = RecursiveModelRepresentation.LIST;
-
- @Inject
- @Use(booleans = { true, false })
- public boolean recursiveLeafChildrenNullable;
-
- public URL getTestUrl() {
- return buildUrl(contextPath, "http://localhost:8080/metamer/faces/components/richTree/treeAdaptors.xhtml");
- }
-
- @BeforeClass
- public void initTreeAttributes() {
- treeAttributes = new TreeAttributes(jq("span[id*=treeAttributes]"));
- }
-
- @BeforeMethod
- public void initPathsAndModelRepresentation() {
- if (paths != null) {
- selectionPaths = paths.paths;
- }
- if (representation == RecursiveModelRepresentation.MAP) {
- guardXhr(selenium).click(pjq(":radio[id*=recursiveModelRepresentation]").getNthOccurence(2));
- }
- if (recursiveLeafChildrenNullable) {
- guardXhr(selenium).click(pjq(":checkbox[id$=recursiveLeafChildrenNullable]"));
- }
- }
-
- @Test
- @Override
- @Use(field = "paths", empty = true)
- public void testTopLevelSelection() {
- super.testTopLevelSelection();
- }
-
- @Test
- @Override
- @Use(field = "paths", value = "paths*")
- public void testSubNodesSelection() {
- super.testSubNodesSelection();
- }
-
- @Test
- @Override
- @Uses({ @Use(field = "paths", value = "paths*"),
- @Use(field = "selectionType", value = "eventEnabledSelectionTypes") })
- public void testSubNodesSelectionEvents() {
- super.testSubNodesSelectionEvents();
- }
-
- @Override
- protected void expandAll() {
- for (Integer[] path : selectionPaths) {
- treeNode = null;
- for (int i = 0; i < path.length; i++) {
- int index = path[i];
- treeNode = (treeNode == null) ? tree.getNode(index) : treeNode.getNode(index);
- if (i < path.length - 1) {
- treeNode.expand();
- }
- }
- }
- }
-
- @Override
- protected Integer[] getIntsFromString(String string) {
- Pattern pattern = Pattern.compile("(?:\\{[^}]+modelKey=(\\d+)\\})");
- Matcher matcher = pattern.matcher(string);
- List<Integer> list = new LinkedList<Integer>();
- while (matcher.find()) {
- int integer = Integer.valueOf(matcher.group(1)) + 1;
- integer = fixShiftWhenModelPresent(list, integer);
- list.add(integer);
- }
- if (list.isEmpty()) {
- throw new IllegalStateException("pattern does not match");
- }
- return list.toArray(new Integer[list.size()]);
- }
-
- private Integer fixShiftWhenModelPresent(List<Integer> list, int integer) {
- if (paths.toString().equals(pathsForRecursiveModel.toString())) {
- if (!list.isEmpty()) {
- if (list.get(0) % 2 == 0) {
- if (list.size() == 2) {
- return integer + 7;
- }
- } else {
- if (list.size() == 3) {
- return integer + 7;
- }
- }
- }
- }
- return integer;
- }
-
- private class PathsCrate {
- String name;
- Integer[][] paths;
-
- public PathsCrate(String name, Integer[][] paths) {
- this.name = name;
- this.paths = paths;
- }
-
- public String toString() {
- return name;
- }
- }
-}
Deleted: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorSimple.java 2011-02-03 22:16:35 UTC (rev 21441)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorSimple.java 2011-02-03 22:20:40 UTC (rev 21442)
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.treeModelAdaptor;
-
-import static org.jboss.test.selenium.locator.LocatorFactory.jq;
-import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertTrue;
-import static org.testng.Assert.fail;
-
-import java.net.URL;
-
-import org.jboss.test.selenium.locator.ExtendedLocator;
-import org.jboss.test.selenium.locator.JQueryLocator;
-import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
-import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
-import org.richfaces.tests.metamer.ftest.richTree.TreeAttributes;
-import org.richfaces.tests.metamer.ftest.richTree.TreeModel;
-import org.richfaces.tests.metamer.ftest.richTree.TreeNodeModel;
-import org.testng.annotations.Test;
-
-/**
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
-public class TestTreeModelAdaptorSimple extends AbstractMetamerTest {
-
- protected TreeAttributes treeAttributes = new TreeAttributes(jq("span[id*=treeAttributes]"));
- protected TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
- protected TreeNodeModel treeNode;
-
- @Override
- public URL getTestUrl() {
- return buildUrl(contextPath, "faces/components/richTree/treeAdaptors.xhtml");
- }
-
- @Test
- public void testModelAdaptorRendered() {
- tree.getNode(2).expand();
- tree.getNode(2).getNode(2).expand();
- treeNode = tree.getNode(2).getNode(2).getNode(1);
-
- assertTrue(treeNode.isLeaf());
-
- modelAdaptorAttributes.setRendered(false);
-
- assertFalse(treeNode.isLeaf());
- }
-
- @Test
- public void testRecursiveModelAdaptorRendered() {
- tree.getNode(2).expand();
- tree.getNode(2).getNode(2).expand();
-
- boolean subnodePresent = false;
- for (TreeNodeModel treeNode : tree.getNode(2).getNode(2).getNodes()) {
- if (!treeNode.isLeaf()) {
- subnodePresent = true;
- }
- }
- assertTrue(subnodePresent, "there should be at least one subnode (not leaf) in expanded branch");
-
- recursiveModelAdaptorAttributes.setRendered(false);
-
- for (TreeNodeModel treeNode : tree.getNode(2).getNode(2).getNodes()) {
- if (!treeNode.isLeaf()) {
- fail("there should be no subnode (not leaf) in expanded branch");
- }
- }
- }
-
- private ModelAdaptorAttributes modelAdaptorAttributes = new ModelAdaptorAttributes(
- pjq("span[id$=:listAttributes:panel]"));
- private RecursiveModelAdaptorAttributes recursiveModelAdaptorAttributes = new RecursiveModelAdaptorAttributes(
- pjq("span[id$=:recursiveAttributes:panel]"));
-
- private class ModelAdaptorAttributes extends AbstractComponentAttributes {
-
- public <T extends ExtendedLocator<JQueryLocator>> ModelAdaptorAttributes(T root) {
- super(root);
- }
-
- public void setRendered(Boolean rendered) {
- setProperty("rendered", rendered);
- }
- }
-
- private class RecursiveModelAdaptorAttributes extends AbstractComponentAttributes {
-
- public <T extends ExtendedLocator<JQueryLocator>> RecursiveModelAdaptorAttributes(T root) {
- super(root);
- }
-
- public void setRendered(Boolean rendered) {
- setProperty("rendered", rendered);
- }
- }
-}
Deleted: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorToggling.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorToggling.java 2011-02-03 22:16:35 UTC (rev 21441)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorToggling.java 2011-02-03 22:20:40 UTC (rev 21442)
@@ -1,94 +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.treeModelAdaptor;
-
-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 java.net.URL;
-
-import org.richfaces.tests.metamer.ftest.annotations.Inject;
-import org.richfaces.tests.metamer.ftest.annotations.Use;
-import org.richfaces.tests.metamer.ftest.richTree.TestTreeToggling;
-import org.richfaces.tests.metamer.ftest.richTree.TreeAttributes;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-/**
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
-public class TestTreeModelAdaptorToggling extends TestTreeToggling {
-
- @Inject
- @Use(enumeration = true)
- public RecursiveModelRepresentation representation;
-
- @Inject
- @Use(booleans = { true, false })
- public boolean recursiveLeafChildrenNullable;
-
- @BeforeClass
- public void initTreeAttributes() {
- treeAttributes = new TreeAttributes(jq("span[id*=treeAttributes]"));
- }
-
- @BeforeMethod
- public void initPathsAndModelRepresentation() {
- if (representation == RecursiveModelRepresentation.MAP) {
- guardXhr(selenium).click(pjq(":radio[id*=recursiveModelRepresentation]").getNthOccurence(2));
- }
- if (recursiveLeafChildrenNullable) {
- guardXhr(selenium).click(pjq(":checkbox[id$=recursiveLeafChildrenNullable]"));
- }
- }
-
- public URL getTestUrl() {
- return buildUrl(contextPath, "http://localhost:8080/metamer/faces/components/richTree/treeAdaptors.xhtml");
- }
-
- @Test
- @Override
- public void testTopLevelNodesExpansion() {
- super.testTopLevelNodesExpansion();
- }
-
- @Test
- @Override
- public void testTopLevelNodesCollapsion() {
- super.testTopLevelNodesCollapsion();
- }
-
- @Test
- @Override
- public void testDeepExpansion() {
- super.testDeepExpansion();
- }
-
- @Test
- @Override
- public void testDeepCollapsion() {
- super.testDeepCollapsion();
- }
-}
13 years, 3 months
JBoss Rich Faces SVN: r21441 - modules/tests/metamer/trunk/ftest/src/test/resources.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-03 17:16:35 -0500 (Thu, 03 Feb 2011)
New Revision: 21441
Modified:
modules/tests/metamer/trunk/ftest/src/test/resources/testng-iteration.xml
Log:
added treeNode and treeNodeAdaptors to testng-iteration.xml (RFPL-1052, RFPL-1053)
Modified: modules/tests/metamer/trunk/ftest/src/test/resources/testng-iteration.xml
===================================================================
--- modules/tests/metamer/trunk/ftest/src/test/resources/testng-iteration.xml 2011-02-03 22:16:10 UTC (rev 21440)
+++ modules/tests/metamer/trunk/ftest/src/test/resources/testng-iteration.xml 2011-02-03 22:16:35 UTC (rev 21441)
@@ -12,6 +12,8 @@
<package name="org.richfaces.tests.metamer.ftest.richDataScroller" />
<package name="org.richfaces.tests.metamer.ftest.richExtendedDataTable" />
<package name="org.richfaces.tests.metamer.ftest.richTree" />
+ <package name="org.richfaces.tests.metamer.ftest.richTreeNode" />
+ <package name="org.richfaces.tests.metamer.ftest.richTreeModelAdaptor" />
</packages>
</test>
13 years, 3 months
JBoss Rich Faces SVN: r21440 - in modules/tests/metamer/trunk: application/src/main/webapp/components/richTree and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-03 17:16:10 -0500 (Thu, 03 Feb 2011)
New Revision: 21440
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/RecursiveModelRepresentation.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorLazyLoading.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorSelection.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorToggling.java
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelRecursiveAdaptorBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.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/TestTreeSelection.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeToggling.java
Log:
treeNode adaptors (RFPL-1053)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelRecursiveAdaptorBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelRecursiveAdaptorBean.java 2011-02-03 21:22:09 UTC (rev 21439)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelRecursiveAdaptorBean.java 2011-02-03 22:16:10 UTC (rev 21440)
@@ -24,7 +24,9 @@
import java.io.Serializable;
import java.util.LinkedHashSet;
import java.util.List;
+import java.util.Map;
import java.util.Set;
+import java.util.TreeMap;
import java.util.concurrent.atomic.AtomicReference;
import javax.annotation.PostConstruct;
@@ -54,6 +56,7 @@
private AtomicReference<Boolean> leafChildrenNullable = new AtomicReference<Boolean>(true);
private boolean useMapModel;
private transient List<RecursiveNode> rootNodes;
+ private Map<String, Boolean> expanded = new TreeMap<String, Boolean>();
/*
* Nodes which was loaded lazily in the current request
@@ -119,4 +122,8 @@
public void setUseMapModel(boolean useMapModel) {
this.useMapModel = useMapModel;
}
+
+ public Map<String, Boolean> getExpanded() {
+ return expanded;
+ }
}
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml 2011-02-03 21:22:09 UTC (rev 21439)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml 2011-02-03 22:16:10 UTC (rev 21440)
@@ -91,6 +91,9 @@
toggleNodeEvent="#{richTreeBean.attributes['toggleNodeEvent'].value}"
toggleType="#{richTreeBean.attributes['toggleType'].value}"
>
+ <rich:treeNode expanded="#{richTreeModelRecursiveAdaptorBean.expanded[node.label]}">
+ #{node.label}
+ </rich:treeNode>
<rich:treeModelRecursiveAdaptor
roots="#{richTreeModelRecursiveAdaptorBean.rootNodes}"
@@ -99,6 +102,7 @@
>
<rich:treeNode
+ expanded="#{richTreeModelRecursiveAdaptorBean.expanded[node.label]}"
rendered="#{richTreeNodeBean.attributes[0]['rendered'].value || node.number != 1}"
iconLeaf="#{richTreeNodeBean.attributes[0]['iconLeaf'].value}"
iconExpanded="#{richTreeNodeBean.attributes[0]['iconExpanded'].value}"
@@ -137,6 +141,7 @@
rendered="#{richTreeModelRecursiveAdaptorBean.attributes['rendered'].value}">
<rich:treeNode
+ expanded="#{richTreeModelRecursiveAdaptorBean.expanded[node.label]}"
rendered="#{richTreeNodeBean.attributes[1]['rendered'].value || node.number != 1}"
iconLeaf="#{richTreeNodeBean.attributes[1]['iconLeaf'].value}"
iconExpanded="#{richTreeNodeBean.attributes[1]['iconExpanded'].value}"
@@ -162,7 +167,7 @@
<a4j:outputPanel ajaxRendered="true">
<h:panelGrid id="selectionOutput" 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>
@@ -172,46 +177,46 @@
</h:selectBooleanCheckbox>
<h:outputLabel value="Recursive Leaf Children Nullable:" />
- <h:selectBooleanCheckbox value="#{richTreeModelRecursiveAdaptorBean.leafChildrenNullable}">
- <a4j:ajax render="commonGrid" />
+ <h:selectBooleanCheckbox id="recursiveLeafChildrenNullable" value="#{richTreeModelRecursiveAdaptorBean.leafChildrenNullable}">
+ <a4j:ajax render="#{nestedComponentId}" />
</h:selectBooleanCheckbox>
<h:outputLabel value="Recursive Model Representation:" />
- <h:selectOneRadio value="#{richTreeModelRecursiveAdaptorBean.useMapModel}">
+ <h:selectOneRadio id="recursiveModelRepresentation" value="#{richTreeModelRecursiveAdaptorBean.useMapModel}">
<f:selectItem itemLabel="List<RecursiveNode>" itemValue="false" />
<f:selectItem itemLabel="Map<Integer, RecursiveNode>" itemValue="true" />
- <a4j:ajax render="commonGrid" />
+ <a4j:ajax render="#{nestedComponentId}" />
</h:selectOneRadio>
<h:outputLabel value="Selection:" />
- <h:outputText value="#{richTreeBean.selection}" />
+ <h:outputText id="selection" value="#{richTreeBean.selection}" />
<h:outputLabel value="Lazy Initialized:" />
- <h:outputText value="#{richTreeModelRecursiveAdaptorBean.lazyInitializedNodes}" />
+ <h:outputText id="lazyInitialized" value="#{richTreeModelRecursiveAdaptorBean.lazyInitializedNodes}" />
<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/AbstractComponentAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java 2011-02-03 21:22:09 UTC (rev 21439)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java 2011-02-03 22:16:10 UTC (rev 21440)
@@ -62,6 +62,10 @@
public ExtendedLocator<JQueryLocator> getRoot() {
return root.getLocator();
}
+
+ public void setRoot(ExtendedLocator<JQueryLocator> root) {
+ this.root.setLocator(root);
+ }
protected String getProperty(String propertyName) {
final ElementLocator<?> locator = propertyLocator.format(propertyName, "");
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java 2011-02-03 21:22:09 UTC (rev 21439)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java 2011-02-03 22:16:10 UTC (rev 21440)
@@ -353,14 +353,14 @@
Pattern pattern = Pattern.compile(namePattern);
if (pattern.matcher(field.getName()).matches()) {
boolean isArray = field.getType().isArray();
- Class<?> representedType;
- if (isArray) {
+ Class<?> representedType = field.getType();
+ if (!parameterType.isAssignableFrom(representedType) && isArray) {
representedType = field.getType().getComponentType();
} else {
- representedType = field.getType();
+ isArray = false;
}
if (parameterType.isAssignableFrom(representedType)) {
- Object[] assignments = getDeclaredFieldValues(testInstance, field);
+ Object[] assignments = getDeclaredFieldValues(testInstance, field, isArray);
for (Object assignment : assignments) {
result.add(assignment);
}
@@ -410,14 +410,14 @@
field.setAccessible(isAccessible);
}
- private Object[] getDeclaredFieldValues(Object testInstance, Field field) {
+ private Object[] getDeclaredFieldValues(Object testInstance, Field field, boolean isArray) {
try {
boolean isAccessible = field.isAccessible();
if (!isAccessible) {
field.setAccessible(true);
}
Object[] result;
- if (field.getType().isArray()) {
+ if (isArray) {
result = (Object[]) field.get(testInstance);
} else {
result = new Object[] { field.get(testInstance) };
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-02-03 21:22:09 UTC (rev 21439)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/AbstractTreeNodeModel.java 2011-02-03 22:16:10 UTC (rev 21440)
@@ -50,6 +50,7 @@
static JQueryLocator treeNodeSelected = jq("div.rf-tr-nd:has(> .rf-trn > .rf-trn-sel)");
ReferencedLocator<JQueryLocator> nodes = ref(root, "> " + treeNode.getRawLocator());
+ ReferencedLocator<JQueryLocator> anyNodes = 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());
@@ -60,6 +61,12 @@
return result;
}
+ public Iterable<TreeNodeModel> getAnyNodes() {
+ Iterable<TreeNodeModel> result = new ModelIterable<JQueryLocator, TreeNodeModel>(anyNodes.getAllOccurrences(),
+ TreeNodeModel.class, new Class[] { TreeModel.class }, new Object[] { tree });
+ return result;
+ }
+
public TreeNodeModel getNode(int index) {
TreeNodeModel trn = new TreeNodeModel(nodes.getNthOccurence(index), tree);
return trn;
@@ -78,13 +85,17 @@
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 getNodesCount() {
+ return selenium.getCount(nodes);
+ }
public int getExpandedNodesCount() {
return selenium.getCount(nodesExpanded);
@@ -93,7 +104,7 @@
public int getCollapsedNodesCount() {
return selenium.getCount(nodesCollapsed);
}
-
+
public int getAnySelectedNodesCount() {
return selenium.getCount(anyNodesSelected);
}
Modified: 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 2011-02-03 21:22:09 UTC (rev 21439)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSelection.java 2011-02-03 22:16:10 UTC (rev 21440)
@@ -45,23 +45,24 @@
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
*/
+@Use(field = "selectionPaths", value = "")
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 } };
+ protected Integer[][] selectionPaths = 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;
+ protected TreeAttributes treeAttributes = new TreeAttributes(jq("span[id*=attributes]"));
+ protected TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
+ protected TreeNodeModel treeNode;
@Inject
@Use(value = "selectionTypes")
- SwitchType selectionType = SwitchType.ajax;
+ SwitchType selectionType = SwitchType.client;
SwitchType[] selectionTypes = new SwitchType[] { SwitchType.ajax, SwitchType.client };
SwitchType[] eventEnabledSelectionTypes = new SwitchType[] { SwitchType.ajax };
@@ -94,10 +95,10 @@
@Test
public void testSubNodesSelection() {
- guardXhr(selenium).click(expandAll);
+ expandAll();
assertEquals(tree.getAnySelectedNodesCount(), 0);
- for (Integer[] path : SUBNODE_SELECTION_PATHS) {
+ for (Integer[] path : selectionPaths) {
treeNode = null;
for (int index : path) {
treeNode = (treeNode == null) ? tree.getNode(index) : treeNode.getNode(index);
@@ -112,10 +113,9 @@
@Test
@Use(field = "selectionType", value = "eventEnabledSelectionTypes")
public void testSubNodesSelectionEvents() {
- guardXhr(selenium).click(expandAll);
-
+ expandAll();
Integer[] old = null;
- for (Integer[] path : SUBNODE_SELECTION_PATHS) {
+ for (Integer[] path : selectionPaths) {
treeNode = null;
for (int index : path) {
treeNode = (treeNode == null) ? tree.getNode(index) : treeNode.getNode(index);
@@ -133,6 +133,24 @@
}
}
+ protected void expandAll() {
+ guardXhr(selenium).click(expandAll);
+ }
+
+ protected 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");
+ }
+
private Integer[] getSelection() {
String string = selenium.getText(selection);
return getIntsFromString(string);
@@ -151,18 +169,4 @@
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-02-03 21:22:09 UTC (rev 21439)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeToggling.java 2011-02-03 22:16:10 UTC (rev 21440)
@@ -44,11 +44,10 @@
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 } };
+ int[][] PATHS = new int[][] { { 3, 2, 1, 2 }, { 2, 4, 6 } };
- private TreeAttributes treeAttributes = new TreeAttributes(jq("span[id*=attributes]"));
+ protected TreeAttributes treeAttributes = new TreeAttributes(jq("span[id*=attributes]"));
private TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
private TreeNodeModel treeNode;
@@ -95,11 +94,14 @@
@Test
public void testDeepExpansion() {
for (int[] path : PATHS) {
+ int depth = path.length;
+
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) {
+ if (d < depth) {
assertNodeState(NodeState.COLLAPSED);
treeNode.expand();
assertNodeState(NodeState.EXPANDED);
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/RecursiveModelRepresentation.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/RecursiveModelRepresentation.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/RecursiveModelRepresentation.java 2011-02-03 22:16:10 UTC (rev 21440)
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * 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.treeModelAdaptor;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public enum RecursiveModelRepresentation {
+ MAP, LIST;
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorLazyLoading.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorLazyLoading.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorLazyLoading.java 2011-02-03 22:16:10 UTC (rev 21440)
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * 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.treeModelAdaptor;
+
+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 java.net.URL;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.SortedSet;
+import java.util.TreeSet;
+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.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.richTree.TreeAttributes;
+import org.richfaces.tests.metamer.ftest.richTree.TreeModel;
+import org.richfaces.tests.metamer.ftest.richTree.TreeNodeModel;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestTreeModelAdaptorLazyLoading extends AbstractMetamerTest {
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richTree/treeAdaptors.xhtml");
+ }
+
+ protected TreeAttributes treeAttributes = new TreeAttributes(jq("span[id*=treeAttributes]"));
+ protected TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
+ protected TreeNodeModel treeNode;
+
+ JQueryLocator lazyInitialized = pjq("span[id$=lazyInitialized]");
+
+ protected Integer[][] paths = new Integer[][] { { 1, 1, 1, 8, 1 }, { 4, 4, 11, 4 } };
+
+ @Test
+ public void testLazyLoading() {
+ List<String> expected = getListOfVisibleNodes();
+ List<String> actual = getLazyInitialized();
+
+ assertEquals(actual, expected);
+
+ for (Integer[] path : paths) {
+ treeNode = null;
+ for (int i = 0; i < path.length; i++) {
+ int index = path[i];
+ treeNode = (treeNode == null) ? tree.getNode(index) : treeNode.getNode(index);
+ if (i < path.length - 1) {
+ treeNode.expand();
+
+ expected = getListOfVisibleNodes();
+ actual = getLazyInitialized();
+
+ assertEquals(actual, expected);
+ }
+ }
+ }
+ }
+
+ private List<String> getListOfVisibleNodes() {
+ // takes only recursive nodes + model node (representing leaves)
+ Pattern pattern = Pattern.compile("([RM\\-\\.0-9]+)(?:-.*)?");
+ SortedSet<String> result = new TreeSet<String>();
+ for (TreeNodeModel treeNode : tree.getAnyNodes()) {
+ String labelText = treeNode.getLabelText();
+
+ Matcher matcher = pattern.matcher(labelText);
+
+ if (matcher.matches()) {
+ String node = matcher.group(1);
+ result.add(node);
+ }
+ }
+ return new LinkedList<String>(result);
+ }
+
+ private List<String> getLazyInitialized() {
+ String unseparated = selenium.getText(lazyInitialized);
+ String[] separated = StringUtils.split(unseparated, "[], ");
+ List<String> result = Arrays.asList(separated);
+ Collections.sort(result);
+ return result;
+ }
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorSelection.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorSelection.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorSelection.java 2011-02-03 22:16:10 UTC (rev 21440)
@@ -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.treeModelAdaptor;
+
+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 java.net.URL;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.richfaces.tests.metamer.ftest.annotations.Uses;
+import org.richfaces.tests.metamer.ftest.richTree.TestTreeSelection;
+import org.richfaces.tests.metamer.ftest.richTree.TreeAttributes;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestTreeModelAdaptorSelection extends TestTreeSelection {
+
+ @Inject
+ PathsCrate paths;
+ PathsCrate pathsForListModel = new PathsCrate("listModel", new Integer[][] { { 2, 1, 3 }, { 3, 3, 2, 2 } });
+ PathsCrate pathsForMapModel = new PathsCrate("mapModel", new Integer[][] { { 2, 1, 5 }, { 3, 3, 2, 6 } });
+ PathsCrate pathsForRecursiveModel = new PathsCrate("recursiveModel", new Integer[][] { { 4, 1, 10, 2 },
+ { 1, 4, 3, 11, 4, 1 } });
+
+ @Inject
+ @Use(enumeration = true)
+ public RecursiveModelRepresentation representation = RecursiveModelRepresentation.LIST;
+
+ @Inject
+ @Use(booleans = { true, false })
+ public boolean recursiveLeafChildrenNullable;
+
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "http://localhost:8080/metamer/faces/components/richTree/treeAdaptors.xhtml");
+ }
+
+ @BeforeClass
+ public void initTreeAttributes() {
+ treeAttributes = new TreeAttributes(jq("span[id*=treeAttributes]"));
+ }
+
+ @BeforeMethod
+ public void initPathsAndModelRepresentation() {
+ if (paths != null) {
+ selectionPaths = paths.paths;
+ }
+ if (representation == RecursiveModelRepresentation.MAP) {
+ guardXhr(selenium).click(pjq(":radio[id*=recursiveModelRepresentation]").getNthOccurence(2));
+ }
+ if (recursiveLeafChildrenNullable) {
+ guardXhr(selenium).click(pjq(":checkbox[id$=recursiveLeafChildrenNullable]"));
+ }
+ }
+
+ @Test
+ @Override
+ @Use(field = "paths", empty = true)
+ public void testTopLevelSelection() {
+ super.testTopLevelSelection();
+ }
+
+ @Test
+ @Override
+ @Use(field = "paths", value = "paths*")
+ public void testSubNodesSelection() {
+ super.testSubNodesSelection();
+ }
+
+ @Test
+ @Override
+ @Uses({ @Use(field = "paths", value = "paths*"),
+ @Use(field = "selectionType", value = "eventEnabledSelectionTypes") })
+ public void testSubNodesSelectionEvents() {
+ super.testSubNodesSelectionEvents();
+ }
+
+ @Override
+ protected void expandAll() {
+ for (Integer[] path : selectionPaths) {
+ treeNode = null;
+ for (int i = 0; i < path.length; i++) {
+ int index = path[i];
+ treeNode = (treeNode == null) ? tree.getNode(index) : treeNode.getNode(index);
+ if (i < path.length - 1) {
+ treeNode.expand();
+ }
+ }
+ }
+ }
+
+ @Override
+ protected Integer[] getIntsFromString(String string) {
+ Pattern pattern = Pattern.compile("(?:\\{[^}]+modelKey=(\\d+)\\})");
+ Matcher matcher = pattern.matcher(string);
+ List<Integer> list = new LinkedList<Integer>();
+ while (matcher.find()) {
+ int integer = Integer.valueOf(matcher.group(1)) + 1;
+ integer = fixShiftWhenModelPresent(list, integer);
+ list.add(integer);
+ }
+ if (list.isEmpty()) {
+ throw new IllegalStateException("pattern does not match");
+ }
+ return list.toArray(new Integer[list.size()]);
+ }
+
+ private Integer fixShiftWhenModelPresent(List<Integer> list, int integer) {
+ if (paths.toString().equals(pathsForRecursiveModel.toString())) {
+ if (!list.isEmpty()) {
+ if (list.get(0) % 2 == 0) {
+ if (list.size() == 2) {
+ return integer + 7;
+ }
+ } else {
+ if (list.size() == 3) {
+ return integer + 7;
+ }
+ }
+ }
+ }
+ return integer;
+ }
+
+ private class PathsCrate {
+ String name;
+ Integer[][] paths;
+
+ public PathsCrate(String name, Integer[][] paths) {
+ this.name = name;
+ this.paths = paths;
+ }
+
+ public String toString() {
+ return name;
+ }
+ }
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorSimple.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorSimple.java 2011-02-03 22:16:10 UTC (rev 21440)
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.treeModelAdaptor;
+
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
+
+import java.net.URL;
+
+import org.jboss.test.selenium.locator.ExtendedLocator;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.richTree.TreeAttributes;
+import org.richfaces.tests.metamer.ftest.richTree.TreeModel;
+import org.richfaces.tests.metamer.ftest.richTree.TreeNodeModel;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestTreeModelAdaptorSimple extends AbstractMetamerTest {
+
+ protected TreeAttributes treeAttributes = new TreeAttributes(jq("span[id*=treeAttributes]"));
+ protected TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
+ protected TreeNodeModel treeNode;
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richTree/treeAdaptors.xhtml");
+ }
+
+ @Test
+ public void testModelAdaptorRendered() {
+ tree.getNode(2).expand();
+ tree.getNode(2).getNode(2).expand();
+ treeNode = tree.getNode(2).getNode(2).getNode(1);
+
+ assertTrue(treeNode.isLeaf());
+
+ modelAdaptorAttributes.setRendered(false);
+
+ assertFalse(treeNode.isLeaf());
+ }
+
+ @Test
+ public void testRecursiveModelAdaptorRendered() {
+ tree.getNode(2).expand();
+ tree.getNode(2).getNode(2).expand();
+
+ boolean subnodePresent = false;
+ for (TreeNodeModel treeNode : tree.getNode(2).getNode(2).getNodes()) {
+ if (!treeNode.isLeaf()) {
+ subnodePresent = true;
+ }
+ }
+ assertTrue(subnodePresent, "there should be at least one subnode (not leaf) in expanded branch");
+
+ recursiveModelAdaptorAttributes.setRendered(false);
+
+ for (TreeNodeModel treeNode : tree.getNode(2).getNode(2).getNodes()) {
+ if (!treeNode.isLeaf()) {
+ fail("there should be no subnode (not leaf) in expanded branch");
+ }
+ }
+ }
+
+ private ModelAdaptorAttributes modelAdaptorAttributes = new ModelAdaptorAttributes(
+ pjq("span[id$=:listAttributes:panel]"));
+ private RecursiveModelAdaptorAttributes recursiveModelAdaptorAttributes = new RecursiveModelAdaptorAttributes(
+ pjq("span[id$=:recursiveAttributes:panel]"));
+
+ private class ModelAdaptorAttributes extends AbstractComponentAttributes {
+
+ public <T extends ExtendedLocator<JQueryLocator>> ModelAdaptorAttributes(T root) {
+ super(root);
+ }
+
+ public void setRendered(Boolean rendered) {
+ setProperty("rendered", rendered);
+ }
+ }
+
+ private class RecursiveModelAdaptorAttributes extends AbstractComponentAttributes {
+
+ public <T extends ExtendedLocator<JQueryLocator>> RecursiveModelAdaptorAttributes(T root) {
+ super(root);
+ }
+
+ public void setRendered(Boolean rendered) {
+ setProperty("rendered", rendered);
+ }
+ }
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorToggling.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorToggling.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/treeModelAdaptor/TestTreeModelAdaptorToggling.java 2011-02-03 22:16:10 UTC (rev 21440)
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * 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.treeModelAdaptor;
+
+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 java.net.URL;
+
+import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.richfaces.tests.metamer.ftest.richTree.TestTreeToggling;
+import org.richfaces.tests.metamer.ftest.richTree.TreeAttributes;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestTreeModelAdaptorToggling extends TestTreeToggling {
+
+ @Inject
+ @Use(enumeration = true)
+ public RecursiveModelRepresentation representation;
+
+ @Inject
+ @Use(booleans = { true, false })
+ public boolean recursiveLeafChildrenNullable;
+
+ @BeforeClass
+ public void initTreeAttributes() {
+ treeAttributes = new TreeAttributes(jq("span[id*=treeAttributes]"));
+ }
+
+ @BeforeMethod
+ public void initPathsAndModelRepresentation() {
+ if (representation == RecursiveModelRepresentation.MAP) {
+ guardXhr(selenium).click(pjq(":radio[id*=recursiveModelRepresentation]").getNthOccurence(2));
+ }
+ if (recursiveLeafChildrenNullable) {
+ guardXhr(selenium).click(pjq(":checkbox[id$=recursiveLeafChildrenNullable]"));
+ }
+ }
+
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "http://localhost:8080/metamer/faces/components/richTree/treeAdaptors.xhtml");
+ }
+
+ @Test
+ @Override
+ public void testTopLevelNodesExpansion() {
+ super.testTopLevelNodesExpansion();
+ }
+
+ @Test
+ @Override
+ public void testTopLevelNodesCollapsion() {
+ super.testTopLevelNodesCollapsion();
+ }
+
+ @Test
+ @Override
+ public void testDeepExpansion() {
+ super.testDeepExpansion();
+ }
+
+ @Test
+ @Override
+ public void testDeepCollapsion() {
+ super.testDeepCollapsion();
+ }
+}
13 years, 3 months
JBoss Rich Faces SVN: r21439 - trunk/examples/template.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2011-02-03 16:22:09 -0500 (Thu, 03 Feb 2011)
New Revision: 21439
Modified:
trunk/examples/template/pom.xml
Log:
RESOLVED - issue RF-10311: CSV: JSR-303 validators works using ajax falback only
https://issues.jboss.org/browse/RF-10311
Modified: trunk/examples/template/pom.xml
===================================================================
--- trunk/examples/template/pom.xml 2011-02-03 21:22:04 UTC (rev 21438)
+++ trunk/examples/template/pom.xml 2011-02-03 21:22:09 UTC (rev 21439)
@@ -13,6 +13,11 @@
<version>4.0.0-SNAPSHOT</version>
<name>examples template</name>
<dependencies>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <version>1.2</version>
+ </dependency>
</dependencies>
<build>
<finalName>template</finalName>
13 years, 3 months
JBoss Rich Faces SVN: r21438 - in trunk/ui/validator/ui/src: test/java/org/richfaces/validator and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2011-02-03 16:22:04 -0500 (Thu, 03 Feb 2011)
New Revision: 21438
Modified:
trunk/ui/validator/ui/src/main/java/org/richfaces/validator/BeanValidatorServiceImpl.java
trunk/ui/validator/ui/src/test/java/org/richfaces/validator/BeanValidatorServiceConstrainsTest.java
Log:
RESOLVED - issue RF-10311: CSV: JSR-303 validators works using ajax falback only
https://issues.jboss.org/browse/RF-10311
Modified: trunk/ui/validator/ui/src/main/java/org/richfaces/validator/BeanValidatorServiceImpl.java
===================================================================
--- trunk/ui/validator/ui/src/main/java/org/richfaces/validator/BeanValidatorServiceImpl.java 2011-02-03 21:21:58 UTC (rev 21437)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/validator/BeanValidatorServiceImpl.java 2011-02-03 21:22:04 UTC (rev 21438)
@@ -4,6 +4,7 @@
package org.richfaces.validator;
import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
@@ -22,12 +23,15 @@
import org.richfaces.el.ValueDescriptor;
import org.richfaces.el.ValueExpressionAnalayser;
+import com.google.common.collect.ImmutableSet;
+
/**
* @author asmirnov
*
*/
public class BeanValidatorServiceImpl implements BeanValidatorService {
+ private static final Collection<String> HIDDEN_PARAMS = ImmutableSet.of("message","payload","groups");
private final ValueExpressionAnalayser analayser;
private final BeanValidatorFactory validatorFactory;
@@ -88,13 +92,42 @@
// TODO if cd.isReportedAsSingleConstraint() make sure than only the root constraint raises an error message
// if one or several of the composing constraints are invalid)
FacesMessage message = validatorFactory.interpolateMessage(context, cd);
- BeanValidatorDescriptor beanValidatorDescriptor = new BeanValidatorDescriptor(a.getClass(), message);
+ Class<? extends Annotation> validatorClass = findAnnotationClass(a);
+ BeanValidatorDescriptor beanValidatorDescriptor = new BeanValidatorDescriptor(validatorClass, message);
for (Map.Entry<String, Object> entry : parameters.entrySet()) {
- beanValidatorDescriptor.addParameter(entry.getKey(), entry.getValue());
+ String key = entry.getKey();
+ if (!HIDDEN_PARAMS.contains(key)) {
+ Object value = entry.getValue();
+ try {
+ Method method = validatorClass.getDeclaredMethod(key);
+ Object defaultValue = method.getDefaultValue();
+ if(!value.equals(defaultValue)){
+ beanValidatorDescriptor.addParameter(key, value);
+ }
+ } catch (SecurityException e) {
+ beanValidatorDescriptor.addParameter(key, value);
+ } catch (NoSuchMethodException e) {
+ beanValidatorDescriptor.addParameter(key, value);
+ }
+ }
}
beanValidatorDescriptor.makeImmutable();
descriptors.add(beanValidatorDescriptor);
processConstraints(context, cd.getComposingConstraints(), descriptors); // process the composing constraints
}
}
+
+ private Class<? extends Annotation> findAnnotationClass(Annotation a) {
+ Class<? extends Annotation> annotationClass = a.getClass();
+ // RF-10311, Hibernate validator wraps annotation class with proxy;
+ if (!annotationClass.isAnnotation()) {
+ Class<?>[] interfaces = annotationClass.getInterfaces();
+ for (Class<?> implemented : interfaces) {
+ if (implemented.isAnnotation()) {
+ annotationClass = (Class<? extends Annotation>) implemented;
+ }
+ }
+ }
+ return annotationClass;
+ }
}
Modified: trunk/ui/validator/ui/src/test/java/org/richfaces/validator/BeanValidatorServiceConstrainsTest.java
===================================================================
--- trunk/ui/validator/ui/src/test/java/org/richfaces/validator/BeanValidatorServiceConstrainsTest.java 2011-02-03 21:21:58 UTC (rev 21437)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/validator/BeanValidatorServiceConstrainsTest.java 2011-02-03 21:22:04 UTC (rev 21438)
@@ -109,7 +109,7 @@
for (final Class<? extends Annotation> class1 : validators) {
Iterables.find(constrains, new Predicate<ValidatorDescriptor>(){
public boolean apply(ValidatorDescriptor input) {
- return class1.isAssignableFrom(input.getImplementationClass());
+ return class1.equals(input.getImplementationClass());
}
});
13 years, 3 months
JBoss Rich Faces SVN: r21437 - in trunk/examples/validator-demo: src/main/java/org/richfaces/example and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2011-02-03 16:21:58 -0500 (Thu, 03 Feb 2011)
New Revision: 21437
Modified:
trunk/examples/validator-demo/pom.xml
trunk/examples/validator-demo/src/main/java/org/richfaces/example/MaxBean.java
trunk/examples/validator-demo/src/main/java/org/richfaces/example/MinBean.java
trunk/examples/validator-demo/src/main/java/org/richfaces/example/MinMaxBean.java
trunk/examples/validator-demo/src/main/java/org/richfaces/example/NotEmptyBean.java
trunk/examples/validator-demo/src/main/java/org/richfaces/example/NotNullBean.java
trunk/examples/validator-demo/src/main/java/org/richfaces/example/PatternBean.java
trunk/examples/validator-demo/src/main/java/org/richfaces/example/SizeBean.java
trunk/examples/validator-demo/src/main/java/org/richfaces/example/Validable.java
trunk/examples/validator-demo/src/main/webapp/examples/beanValidation.xhtml
Log:
RESOLVED - issue RF-10311: CSV: JSR-303 validators works using ajax falback only
https://issues.jboss.org/browse/RF-10311
Modified: trunk/examples/validator-demo/pom.xml
===================================================================
--- trunk/examples/validator-demo/pom.xml 2011-02-03 20:26:45 UTC (rev 21436)
+++ trunk/examples/validator-demo/pom.xml 2011-02-03 21:21:58 UTC (rev 21437)
@@ -75,5 +75,10 @@
<artifactId>slf4j-simple</artifactId>
<version>1.5.11</version>
</dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <version>1.2</version>
+ </dependency>
</dependencies>
</project>
Modified: trunk/examples/validator-demo/src/main/java/org/richfaces/example/MaxBean.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/MaxBean.java 2011-02-03 20:26:45 UTC (rev 21436)
+++ trunk/examples/validator-demo/src/main/java/org/richfaces/example/MaxBean.java 2011-02-03 21:21:58 UTC (rev 21437)
@@ -5,14 +5,12 @@
import javax.validation.constraints.Max;
-import org.hibernate.validator.constraints.Email;
-
/**
* @author asmirnov
*
*/
-public class MaxBean implements Validable<Integer> {
+public class MaxBean extends Validable<Integer> {
@Max(10)
private Integer value = 0;
Modified: trunk/examples/validator-demo/src/main/java/org/richfaces/example/MinBean.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/MinBean.java 2011-02-03 20:26:45 UTC (rev 21436)
+++ trunk/examples/validator-demo/src/main/java/org/richfaces/example/MinBean.java 2011-02-03 21:21:58 UTC (rev 21437)
@@ -10,7 +10,7 @@
* @author asmirnov
*
*/
-public class MinBean implements Validable<Integer> {
+public class MinBean extends Validable<Integer> {
@Min(2)
private Integer value=2;
Modified: trunk/examples/validator-demo/src/main/java/org/richfaces/example/MinMaxBean.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/MinMaxBean.java 2011-02-03 20:26:45 UTC (rev 21436)
+++ trunk/examples/validator-demo/src/main/java/org/richfaces/example/MinMaxBean.java 2011-02-03 21:21:58 UTC (rev 21437)
@@ -11,7 +11,7 @@
* @author asmirnov
*
*/
-public class MinMaxBean implements Validable<Integer> {
+public class MinMaxBean extends Validable<Integer> {
@Min(2)
@Max(10)
Modified: trunk/examples/validator-demo/src/main/java/org/richfaces/example/NotEmptyBean.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/NotEmptyBean.java 2011-02-03 20:26:45 UTC (rev 21436)
+++ trunk/examples/validator-demo/src/main/java/org/richfaces/example/NotEmptyBean.java 2011-02-03 21:21:58 UTC (rev 21437)
@@ -10,7 +10,7 @@
* @author asmirnov
*
*/
-public class NotEmptyBean implements Validable<String> {
+public class NotEmptyBean extends Validable<String> {
@NotEmpty
private String value;
Modified: trunk/examples/validator-demo/src/main/java/org/richfaces/example/NotNullBean.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/NotNullBean.java 2011-02-03 20:26:45 UTC (rev 21436)
+++ trunk/examples/validator-demo/src/main/java/org/richfaces/example/NotNullBean.java 2011-02-03 21:21:58 UTC (rev 21437)
@@ -10,7 +10,7 @@
* @author asmirnov
*
*/
-public class NotNullBean implements Validable<String> {
+public class NotNullBean extends Validable<String> {
@NotNull
private String value;
Modified: trunk/examples/validator-demo/src/main/java/org/richfaces/example/PatternBean.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/PatternBean.java 2011-02-03 20:26:45 UTC (rev 21436)
+++ trunk/examples/validator-demo/src/main/java/org/richfaces/example/PatternBean.java 2011-02-03 21:21:58 UTC (rev 21437)
@@ -10,14 +10,14 @@
* @author asmirnov
*
*/
-public class PatternBean implements Validable<String> {
+public class PatternBean extends Validable<String> {
private String value;
/**
* @return the text
*/
- @Pattern(regexp="^[a-Z][a-Z1-9_]$")
+ @Pattern(regexp="[a-z].*")
public String getValue() {
return value;
}
@@ -30,7 +30,7 @@
}
public String getDescription() {
- return "Text Value, Pattern '^[a-Z][a-Z1-9_]$' Validation";
+ return "Text Value, Pattern '[a-Z].*' Validation";
}
public String getLabel() {
return "pattern";
Modified: trunk/examples/validator-demo/src/main/java/org/richfaces/example/SizeBean.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/SizeBean.java 2011-02-03 20:26:45 UTC (rev 21436)
+++ trunk/examples/validator-demo/src/main/java/org/richfaces/example/SizeBean.java 2011-02-03 21:21:58 UTC (rev 21437)
@@ -10,7 +10,7 @@
* @author asmirnov
*
*/
-public class SizeBean implements Validable<String> {
+public class SizeBean extends Validable<String> {
@Size(max=10,min=2,message="incorrect field length")
private String value;
Modified: trunk/examples/validator-demo/src/main/java/org/richfaces/example/Validable.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/Validable.java 2011-02-03 20:26:45 UTC (rev 21436)
+++ trunk/examples/validator-demo/src/main/java/org/richfaces/example/Validable.java 2011-02-03 21:21:58 UTC (rev 21437)
@@ -3,17 +3,33 @@
*/
package org.richfaces.example;
+import java.lang.reflect.ParameterizedType;
+
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
/**
* @author asmirnov
*
*/
-public interface Validable<T> {
+public abstract class Validable<T> {
+
+ T value;
- T getValue();
+ public T getValue(){
+ return value;
+ }
- void setValue(T value);
+ public void setValue(T value){
+ this.value=value;
+ }
- String getDescription();
+ public Converter getConverter(){
+ Class<T> parameterType = (Class<T>) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0];
+ return FacesContext.getCurrentInstance().getApplication().createConverter(parameterType);
+ }
+
+ public abstract String getDescription();
- String getLabel();
+ public abstract String getLabel();
}
Modified: trunk/examples/validator-demo/src/main/webapp/examples/beanValidation.xhtml
===================================================================
--- trunk/examples/validator-demo/src/main/webapp/examples/beanValidation.xhtml 2011-02-03 20:26:45 UTC (rev 21436)
+++ trunk/examples/validator-demo/src/main/webapp/examples/beanValidation.xhtml 2011-02-03 21:21:58 UTC (rev 21437)
@@ -13,19 +13,15 @@
<!-- content -->
<ui:define name="content">
<h:form id="form">
- <h:dataTable value="#{dataBean.beans}" var="bean">
- <h:column>
- <h:outputLabel for="value" value="#{bean.description}" />
- </h:column>
- <h:column>
- <h:inputText id="value" value="#{bean.value}" label="#{bean.label}">
+ <h:panelGrid columns="3">
+ <c:forEach items="#{dataBean.beans}" var="bean">
+ <h:outputLabel for="#{bean.label}" value="#{bean.description}" />
+ <h:inputText id="#{bean.label}" value="#{bean.value}" label="#{bean.label}" converter="#{bean.converter}">
<csv:validator summary="Invalid value" />
</h:inputText>
- </h:column>
- <h:column>
- <csv:message for="value" />
- </h:column>
- </h:dataTable>
+ <csv:message for="#{bean.label}" />
+ </c:forEach>
+ </h:panelGrid>
<h:commandButton value="Submit"></h:commandButton>
<csv:messages />
</h:form>
13 years, 3 months
JBoss Rich Faces SVN: r21436 - in trunk/ui/dnd/ui/src/main: resources/META-INF/resources/org.richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-02-03 15:26:45 -0500 (Thu, 03 Feb 2011)
New Revision: 21436
Modified:
trunk/ui/dnd/ui/src/main/java/org/richfaces/renderkit/DropTargetRenderer.java
trunk/ui/dnd/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-droppable.js
Log:
https://issues.jboss.org/browse/RF-10106
Modified: trunk/ui/dnd/ui/src/main/java/org/richfaces/renderkit/DropTargetRenderer.java
===================================================================
--- trunk/ui/dnd/ui/src/main/java/org/richfaces/renderkit/DropTargetRenderer.java 2011-02-03 20:24:17 UTC (rev 21435)
+++ trunk/ui/dnd/ui/src/main/java/org/richfaces/renderkit/DropTargetRenderer.java 2011-02-03 20:26:45 UTC (rev 21436)
@@ -134,10 +134,12 @@
AbstractDropTarget dropTarget = (AbstractDropTarget)component;
Set<String> acceptedTypes = CoreAjaxRendererUtils.asSimpleSet(dropTarget.getAcceptedTypes());
- if (acceptedTypes.contains("@none")) {
- acceptedTypes = NONE_SET;
- } else if (acceptedTypes.contains("@all")) {
- acceptedTypes = ALL_SET;
+ if (acceptedTypes != null) {
+ if (acceptedTypes.contains("@none")) {
+ acceptedTypes = NONE_SET;
+ } else if (acceptedTypes.contains("@all")) {
+ acceptedTypes = ALL_SET;
+ }
}
options.put("acceptedTypes", acceptedTypes);
Modified: trunk/ui/dnd/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-droppable.js
===================================================================
--- trunk/ui/dnd/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-droppable.js 2011-02-03 20:24:17 UTC (rev 21435)
+++ trunk/ui/dnd/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-droppable.js 2011-02-03 20:26:45 UTC (rev 21436)
@@ -107,7 +107,7 @@
accept : function(draggable) {
var accept = false;
var acceptType = draggable.data("type");
- if (acceptType) {
+ if (acceptType && this.options.acceptedTypes) {
$.each(this.options.acceptedTypes, function() {
if (this == "@none") {
return false;
13 years, 3 months
JBoss Rich Faces SVN: r21435 - in trunk/ui/dnd/ui/src/main: resources/META-INF/resources/org.richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-02-03 15:24:17 -0500 (Thu, 03 Feb 2011)
New Revision: 21435
Modified:
trunk/ui/dnd/ui/src/main/java/org/richfaces/renderkit/DropTargetRenderer.java
trunk/ui/dnd/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-droppable.js
Log:
https://issues.jboss.org/browse/RF-10106
Modified: trunk/ui/dnd/ui/src/main/java/org/richfaces/renderkit/DropTargetRenderer.java
===================================================================
--- trunk/ui/dnd/ui/src/main/java/org/richfaces/renderkit/DropTargetRenderer.java 2011-02-03 20:13:51 UTC (rev 21434)
+++ trunk/ui/dnd/ui/src/main/java/org/richfaces/renderkit/DropTargetRenderer.java 2011-02-03 20:24:17 UTC (rev 21435)
@@ -22,8 +22,10 @@
package org.richfaces.renderkit;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
+import java.util.Set;
import javax.faces.component.ContextCallback;
import javax.faces.component.UIComponent;
@@ -51,6 +53,15 @@
@JsfRenderer(type = "org.richfaces.DropTargetRenderer", family = AbstractDropTarget.COMPONENT_FAMILY)
public class DropTargetRenderer extends DnDRenderBase {
+ /**
+ *
+ */
+ private static final Set<String> ALL_SET = Collections.singleton("@all");
+ /**
+ *
+ */
+ private static final Set<String> NONE_SET = Collections.singleton("@none");
+
@Override
protected void doDecode(FacesContext facesContext, UIComponent component) {
Map<String, String> requestParamMap = facesContext.getExternalContext().getRequestParameterMap();
@@ -121,7 +132,15 @@
function.addToBody(ajaxFunction);
AbstractDropTarget dropTarget = (AbstractDropTarget)component;
- options.put("acceptedTypes", CoreAjaxRendererUtils.asSimpleSet(dropTarget.getAcceptedTypes()));
+ Set<String> acceptedTypes = CoreAjaxRendererUtils.asSimpleSet(dropTarget.getAcceptedTypes());
+
+ if (acceptedTypes.contains("@none")) {
+ acceptedTypes = NONE_SET;
+ } else if (acceptedTypes.contains("@all")) {
+ acceptedTypes = ALL_SET;
+ }
+
+ options.put("acceptedTypes", acceptedTypes);
options.put("ajaxFunction", function);
options.put("parentId", getParentClientId(facesContext, component));
}
Modified: trunk/ui/dnd/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-droppable.js
===================================================================
--- trunk/ui/dnd/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-droppable.js 2011-02-03 20:13:51 UTC (rev 21434)
+++ trunk/ui/dnd/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-droppable.js 2011-02-03 20:24:17 UTC (rev 21435)
@@ -105,17 +105,18 @@
},
accept : function(draggable) {
- // since acceptedTypes is optional it could be null.
- // In this case all types are accepted
- if (!this.options.acceptedTypes)
- return true;
-
- var accept;
+ var accept = false;
var acceptType = draggable.data("type");
if (acceptType) {
$.each(this.options.acceptedTypes, function() {
- accept = (acceptType == this);
- return !(accept);
+ if (this == "@none") {
+ return false;
+ }
+
+ if (this == acceptType || this == "@all") {
+ accept = true;
+ return false;
+ }
});
}
return accept;
13 years, 3 months
JBoss Rich Faces SVN: r21434 - trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2011-02-03 15:13:51 -0500 (Thu, 03 Feb 2011)
New Revision: 21434
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
Log:
RF-10164 select: inconsistency of usage arrow button and showPopup api method.
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2011-02-03 19:54:01 UTC (rev 21433)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2011-02-03 20:13:51 UTC (rev 21434)
@@ -73,7 +73,7 @@
__onBtnMouseDown: function(e) {
if(!this.popupList.isVisible()) {
this.__updateItems();
- this.showPopup();
+ this.__showPopup();
} else {
this.hidePopup();
}
@@ -107,7 +107,7 @@
e.preventDefault();
if(!visible) {
this.__updateItems();
- this.showPopup();
+ this.__showPopup();
} else {
this.popupList.__selectNext() ;
}
@@ -160,7 +160,7 @@
}
if(!this.popupList.isVisible()) {
- this.showPopup();
+ this.__showPopup();
}
}
},
@@ -253,7 +253,7 @@
}
},
- showPopup: function() {
+ __showPopup: function() {
this.popupList.show();
},
13 years, 3 months