Author: nbelaevski
Date: 2009-05-29 14:31:03 -0400 (Fri, 29 May 2009)
New Revision: 14416
Added:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7273/
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7273/Bean.java
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf7273/
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf7273/Test.java
branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf7273.xhtml
Modified:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/resources/META-INF/MANIFEST.MF
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/resources/testng.xml
branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/resources/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/RF-7273
Added:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7273/Bean.java
===================================================================
---
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7273/Bean.java
(rev 0)
+++
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf7273/Bean.java 2009-05-29
18:31:03 UTC (rev 14416)
@@ -0,0 +1,66 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.regressionarea.issues.rf7273;
+
+import javax.faces.component.UIComponent;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.TreeNode;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.event.NodeExpandedEvent;
+
+/**
+ * This test case for: <a
href="https://jira.jboss.org/jira/browse/RF-7273">RF-7273 -
+ * Tree: expanded state is not correct inside NodeExpandedEvent listener</a>
+ *
+ * @author Nick Belaevski
+ * @since 3.3.1
+ */
+@Name("rf7273")
+(a)Scope(ScopeType.SESSION)
+public class Bean {
+
+ private DefaultMutableTreeNode node;
+
+ private String stateString = "";
+
+ public Bean() {
+ node = new DefaultMutableTreeNode("root");
+ node.add(new DefaultMutableTreeNode("child"));
+ }
+
+ public void processExpand(NodeExpandedEvent event) {
+ UIComponent component = event.getComponent();
+ Boolean expanded = (Boolean) component.getAttributes().get("expanded");
+ stateString += expanded ? " expanded" : " collapsed";
+ }
+
+ public TreeNode getNode() {
+ return node;
+ }
+
+ public String getStateString() {
+ return stateString;
+ }
+}
Modified:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/resources/META-INF/MANIFEST.MF
===================================================================
---
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/resources/META-INF/MANIFEST.MF 2009-05-29
17:33:59 UTC (rev 14415)
+++
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/resources/META-INF/MANIFEST.MF 2009-05-29
18:31:03 UTC (rev 14416)
@@ -2,5 +2,5 @@
Class-Path: bsh-1.3.0.jar commons-beanutils-1.7.0.jar commons-collecti
ons-3.2.jar commons-lang-2.3.jar commons-logging-1.0.4.jar el-api-1.0
.jar jboss-el-1.0_02.CR2.jar jboss-seam-2.1.1.GA.jar log4j-1.2.14.jar
- richfaces-api-3.3.1-SNAPSHOT.jar
+ richfaces-api-3.3.2-SNAPSHOT.jar
Added:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf7273/Test.java
===================================================================
---
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf7273/Test.java
(rev 0)
+++
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf7273/Test.java 2009-05-29
18:31:03 UTC (rev 14416)
@@ -0,0 +1,61 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.testng.rf7273;
+
+import junit.framework.Assert;
+
+import org.richfaces.SeleniumTestBase;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.2
+ */
+public class Test extends SeleniumTestBase{
+
+ private static final String HANDLE_LOCATOR = "form:tree:0::node:handle";
+
+ private int getNodesCount() {
+ return selenium.getXpathCount("//*[contains(@class, 'rich-tree-node') and
not(contains(@class, 'rich-tree-node-'))]").intValue();
+ }
+
+ @org.testng.annotations.Test
+ public void testExecute() throws Exception {
+ renderPage();
+
+ AssertTextEquals("statePanel", "");
+ Assert.assertEquals(1, getNodesCount());
+
+ clickAjaxCommandAndWait(HANDLE_LOCATOR);
+ Assert.assertEquals(2, getNodesCount());
+ AssertTextEquals("statePanel", "expanded");
+
+ clickAjaxCommandAndWait(HANDLE_LOCATOR);
+ Assert.assertEquals(1, getNodesCount());
+ AssertTextEquals("statePanel", "expanded collapsed");
+ }
+
+ @Override
+ public String getTestUrl() {
+ return "pages/rf7273.xhtml";
+ }
+
+}
Modified:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/resources/testng.xml
===================================================================
---
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/resources/testng.xml 2009-05-29
17:33:59 UTC (rev 14415)
+++
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/resources/testng.xml 2009-05-29
18:31:03 UTC (rev 14416)
@@ -32,6 +32,7 @@
<package name="org.richfaces.testng.rf6267" />
<package name="org.richfaces.testng.rf6547" />
<package name="org.richfaces.testng.rf5773" />
+ <package name="org.richfaces.testng.rf7273" />
</packages>
</test>
</suite>
Modified:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/resources/META-INF/MANIFEST.MF
===================================================================
---
branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/resources/META-INF/MANIFEST.MF 2009-05-29
17:33:59 UTC (rev 14415)
+++
branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/resources/META-INF/MANIFEST.MF 2009-05-29
18:31:03 UTC (rev 14416)
@@ -1,6 +1,6 @@
Manifest-Version: 1.0
-Class-Path: commons-beanutils-1.7.0.jar commons-digester-2.0.jar jboss
- -seam-debug-2.1.1.GA.jar jboss-seam-jul-2.1.1.GA.jar jboss-seam-remot
- ing-2.1.1.GA.jar jboss-seam-ui-2.1.1.GA.jar jsf-facelets-1.1.15.B1.ja
- r richfaces-impl-3.3.1-SNAPSHOT.jar richfaces-ui-3.3.1-SNAPSHOT.jar
+Class-Path: commons-beanutils-1.7.0.jar commons-digester-1.8.1.jar jbo
+ ss-seam-debug-2.1.1.GA.jar jboss-seam-jul-2.1.1.GA.jar jboss-seam-rem
+ oting-2.1.1.GA.jar jboss-seam-ui-2.1.1.GA.jar jsf-facelets-1.1.15.B1.
+ jar richfaces-impl-3.3.2-SNAPSHOT.jar richfaces-ui-3.3.2-SNAPSHOT.jar
Added:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf7273.xhtml
===================================================================
---
branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf7273.xhtml
(rev 0)
+++
branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf7273.xhtml 2009-05-29
18:31:03 UTC (rev 14416)
@@ -0,0 +1,24 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich">
+
+<ui:composition template="/layout/layout.xhtml">
+ <ui:define name="template">
+ <h:form id="form">
+ <rich:tree id="tree" switchType="ajax"
value="#{rf7273.node}" changeExpandListener="#{rf7273.processExpand}"
var="node">
+ <rich:treeNode id="node">
+ #{node}
+ </rich:treeNode>
+ </rich:tree>
+ </h:form>
+
+ <a4j:outputPanel ajaxRendered="true" id="statePanel">
+ #{rf7273.stateString}
+ </a4j:outputPanel>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file