Author: konstantin.mishin
Date: 2009-01-23 14:42:25 -0500 (Fri, 23 Jan 2009)
New Revision: 12412
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeNodesAdaptorTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/treeNodesAdaptor/recursiveTreeNodesAdaptor.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/treeNodesAdaptor/treeNodesAdaptorBase.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AbstractTreeNodesAdaptorTest.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/RecursiveTreeNodesAdaptorTest.java
Log:
RF-5579
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeNodesAdaptorTestBean.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeNodesAdaptorTestBean.java 2009-01-23
17:43:39 UTC (rev 12411)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeNodesAdaptorTestBean.java 2009-01-23
19:42:25 UTC (rev 12412)
@@ -50,6 +50,7 @@
private String trace;
private Boolean ajaxSingle;
private Boolean includedNode;
+ private Boolean includedRoot;
public TreeNodesAdaptorTestBean() {
init();
@@ -71,6 +72,7 @@
trace = "";
ajaxSingle = false;
includedNode = true;
+ includedRoot = true;
}
public void submit(ActionEvent event) {
@@ -108,4 +110,12 @@
public Boolean getIncludedNode() {
return includedNode;
}
+
+ public void setIncludedRoot(Boolean includedRoot) {
+ this.includedRoot = includedRoot;
+ }
+
+ public Boolean getIncludedRoot() {
+ return includedRoot;
+ }
}
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/treeNodesAdaptor/recursiveTreeNodesAdaptor.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/treeNodesAdaptor/recursiveTreeNodesAdaptor.xhtml 2009-01-23
17:43:39 UTC (rev 12411)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/treeNodesAdaptor/recursiveTreeNodesAdaptor.xhtml 2009-01-23
19:42:25 UTC (rev 12412)
@@ -8,7 +8,7 @@
<ui:composition template="treeNodesAdaptorBase.xhtml">
<ui:define name="treeNodesAdaptor">
- <rich:recursiveTreeNodesAdaptor roots="#{treeNodesAdaptor.nodes}"
var="node" nodes="#{node.children}"
includedNode="#{treeNodesAdaptor.includedNode}">
+ <rich:recursiveTreeNodesAdaptor roots="#{treeNodesAdaptor.nodes}"
var="node" nodes="#{node.children}"
includedNode="#{treeNodesAdaptor.includedNode}"
includedRoot="#{treeNodesAdaptor.includedRoot}">
<rich:treeNode ajaxSingle="#{treeNodesAdaptor.ajaxSingle}">
<h:inputText value="#{node.id}"></h:inputText>
<h:commandButton id="submit" value="submit"
actionListener="#{treeNodesAdaptor.submit}"></h:commandButton>
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/treeNodesAdaptor/treeNodesAdaptorBase.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/treeNodesAdaptor/treeNodesAdaptorBase.xhtml 2009-01-23
17:43:39 UTC (rev 12411)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/treeNodesAdaptor/treeNodesAdaptorBase.xhtml 2009-01-23
19:42:25 UTC (rev 12412)
@@ -17,6 +17,10 @@
<h:selectBooleanCheckbox id="includedNode"
value="#{treeNodesAdaptor.includedNode}">
<a4j:support event="onchange" reRender="tree"/>
</h:selectBooleanCheckbox>
+ <h:outputText value="includedRoot" />
+ <h:selectBooleanCheckbox id="includedRoot"
value="#{treeNodesAdaptor.includedRoot}">
+ <a4j:support event="onchange" reRender="tree"/>
+ </h:selectBooleanCheckbox>
</h:form>
<h:form id="mainForm">
<rich:tree id="tree">
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AbstractTreeNodesAdaptorTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AbstractTreeNodesAdaptorTest.java 2009-01-23
17:43:39 UTC (rev 12411)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AbstractTreeNodesAdaptorTest.java 2009-01-23
19:42:25 UTC (rev 12412)
@@ -32,17 +32,21 @@
public abstract class AbstractTreeNodesAdaptorTest extends SeleniumTestBase {
- private List<Node> nodes;
+ protected List<Node> nodes;
- private String ajaxSingle;
+ protected String attrForm;
+ private String ajaxSingle;
+
private String includedNode;
- private String tree;
+ protected String tree;
private String outputText;
+
private String dataTable;
- private void init(Template template) {
+
+ protected void init(Template template) {
renderPage(null, template, "#{treeNodesAdaptor.init}");
nodes = new ArrayList<Node>(3);
for (int i = 1; i <= 3; i++) {
@@ -56,13 +60,13 @@
}
}
}
- String attrForm = getParentId() + "attrForm";
- ajaxSingle = attrForm + ":ajaxSingle";
- includedNode = attrForm + ":includedNode";
- String mainForm = getParentId() + "mainForm";
- tree = mainForm + ":tree";
- outputText = getParentId() + "outputText";
- dataTable = getParentId() + "dataTable";
+ attrForm = getParentId() + "attrForm";
+ ajaxSingle = attrForm + ":ajaxSingle";
+ includedNode = attrForm + ":includedNode";
+ String mainForm = getParentId() + "mainForm";
+ tree = mainForm + ":tree";
+ outputText = getParentId() + "outputText";
+ dataTable = getParentId() + "dataTable";
}
/**
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/RecursiveTreeNodesAdaptorTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/RecursiveTreeNodesAdaptorTest.java 2009-01-23
17:43:39 UTC (rev 12411)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/RecursiveTreeNodesAdaptorTest.java 2009-01-23
19:42:25 UTC (rev 12412)
@@ -20,11 +20,36 @@
*/
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
public class RecursiveTreeNodesAdaptorTest extends AbstractTreeNodesAdaptorTest {
+ private String includedRoot;
+
@Override
+ protected void init(Template template) {
+ super.init(template);
+ includedRoot = attrForm + ":includedRoot";
+ }
+ /**
+ * includedRoot expression is handled properly
+ */
+ @Test
+ public void testIncludedRoot(Template template) {
+ init(template);
+ String xpath = "id('"+ tree + "')/div";
+ clickAjaxCommandAndWait("xpath=" + xpath +
"/table[2]/tbody/tr/td[1]/div/a");
+ String childrenXpath = "id('"+ tree + "')/div/table";
+ Assert.assertEquals(selenium.getXpathCount(childrenXpath), nodes.size());
+ clickAjaxCommandAndWait(includedRoot);
+ Assert.assertEquals(selenium.getXpathCount(childrenXpath), 0);
+ }
+
+ @Override
public String getTestUrl() {
return "pages/treeNodesAdaptor/recursiveTreeNodesAdaptor.xhtml";
}
Show replies by date