Author: ppitonak(a)redhat.com
Date: 2012-01-09 09:55:52 -0500 (Mon, 09 Jan 2012)
New Revision: 23134
Added:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/AbstractTestTreeSelection.java
Modified:
modules/tests/metamer/branches/wfk2-product-branch/
modules/tests/metamer/branches/wfk2-product-branch/application/pom.xml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeBean.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/WEB-INF/web.xml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/a4jQueue/formQueue.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/a4jQueue/globalQueue.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richEditor/simple.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/templates/header.xhtml
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/Autocomplete.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteByKeys.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestDateEditor.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMenuGroup/TestRichMenuGroup.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbar/TestRichToolbar.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/AbstractTestTree.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreePhases.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSelection.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java
Log:
merged with trunk
Property changes on: modules/tests/metamer/branches/wfk2-product-branch
___________________________________________________________________
Modified: svn:mergeinfo
- /modules/tests/metamer/trunk:22762-22826,22828-22843,22845-23029,23033-23067
+
/modules/tests/metamer/trunk:22762-22826,22828-22843,22845-23029,23033-23067,23070-23133
Modified: modules/tests/metamer/branches/wfk2-product-branch/application/pom.xml
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/application/pom.xml 2012-01-06
16:36:16 UTC (rev 23133)
+++ modules/tests/metamer/branches/wfk2-product-branch/application/pom.xml 2012-01-09
14:55:52 UTC (rev 23134)
@@ -12,7 +12,8 @@
02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-->
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -88,8 +89,8 @@
</dependency>
<dependency>
- <groupId>org.jboss.spec.javax.jms</groupId>
- <artifactId>jboss-jms-api_1.1_spec</artifactId>
+ <groupId>javax.jms</groupId>
+ <artifactId>jms</artifactId>
</dependency>
<dependency>
<groupId>org.hornetq</groupId>
@@ -112,6 +113,12 @@
</dependency>
<dependency>
+ <groupId>org.jboss.netty</groupId>
+ <artifactId>netty</artifactId>
+ <version>3.2.5.Final</version>
+ </dependency>
+
+ <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.1</version>
@@ -134,15 +141,15 @@
</dependency>
<dependency>
- <groupId>javassist</groupId>
+ <groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
- <version>3.12.1.GA</version>
+ <version>3.15.0-GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
- <version>4.1.0.Final</version>
+ <version>4.2.0.Final</version>
</dependency>
<!-- JBoss AS7 management -->
@@ -157,10 +164,10 @@
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-controller-client</artifactId>
- <version>7.0.2.Final</version>
+ <version>[7.0.2.Final,)</version>
<scope>provided</scope>
</dependency>
-
+
</dependencies>
<build>
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeBean.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeBean.java 2012-01-06
16:36:16 UTC (rev 23133)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeBean.java 2012-01-09
14:55:52 UTC (rev 23134)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2012, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
@@ -145,10 +145,10 @@
public RichFacesTreeNode<Labeled> getRichFacesTreeNodeRoot() {
if (richfacesTreeNodeRoot == null) {
- List<RichFacesTreeNode<Labeled>> richfacesTreeNodeList =
(List<RichFacesTreeNode<Labeled>>) (List<?>)
buldTree(RichFacesTreeNode.createFactory());
+ List<RichFacesTreeNode<Labeled>> richfacesTreeNodeList =
(List<RichFacesTreeNode<Labeled>>) (List<?>)
buildTree(RichFacesTreeNode.createFactory());
richfacesTreeNodeRoot = new RichFacesTreeNode<Labeled>();
int i=0;
- for (RichFacesTreeNode node : richfacesTreeNodeList) {
+ for (RichFacesTreeNode<?> node : richfacesTreeNodeList) {
richfacesTreeNodeRoot.addChild(i, node);
i++;
}
@@ -158,8 +158,8 @@
public List<SwingTreeNode<Labeled>> getSwingTreeNodeRoot() {
if (swingTreeNodeRoot == null) {
- List<SwingTreeNode<Labeled>> swingTreeNodelist =
(List<SwingTreeNode<Labeled>>) (List<?>)
buldTree(SwingTreeNode.createFactory());
- swingTreeNodeRoot = swingTreeNodelist;
+ List<SwingTreeNode<Labeled>> swingTreeNodeList =
(List<SwingTreeNode<Labeled>>) (List<?>)
buildTree(SwingTreeNode.createFactory());
+ swingTreeNodeRoot = swingTreeNodeList;
}
return swingTreeNodeRoot;
}
@@ -214,7 +214,7 @@
}
}
- private List<TreeNodeWithContent<Labeled>>
buldTree(TreeNodeWithContentFactory<TreeNodeWithContent<Labeled>>
treeNodeFactory) {
+ private List<TreeNodeWithContent<Labeled>>
buildTree(TreeNodeWithContentFactory<TreeNodeWithContent<Labeled>>
treeNodeFactory) {
List<TreeNodeWithContent<Labeled>> firstLevelNodes = new
ArrayList<TreeNodeWithContent<Labeled>>();
for(State state : companiesCache.keySet()) {
TreeNodeWithContent<Labeled> stateTreeNode =
treeNodeFactory.createTreeNode(null, state);
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/WEB-INF/web.xml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/WEB-INF/web.xml 2012-01-06
16:36:16 UTC (rev 23133)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/WEB-INF/web.xml 2012-01-09
14:55:52 UTC (rev 23134)
@@ -92,10 +92,6 @@
</welcome-file-list>
<error-page>
- <error-code>500</error-code>
- <location>/faces/error/500.xhtml</location>
- </error-page>
- <error-page>
<error-code>404</error-code>
<location>/faces/error/404.xhtml</location>
</error-page>
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/a4jQueue/formQueue.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/a4jQueue/formQueue.xhtml 2012-01-06
16:36:16 UTC (rev 23133)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/a4jQueue/formQueue.xhtml 2012-01-09
14:55:52 UTC (rev 23134)
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!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:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j"
-
xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
xmlns:rich="http://richfaces.org/rich"
-
xmlns:c="http://java.sun.com/jsp/jstl/core">
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
xmlns:rich="http://richfaces.org/rich"
+
xmlns:c="http://java.sun.com/jsp/jstl/core">
- <!--
+<!--
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
@@ -27,110 +27,117 @@
02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-->
- <ui:composition template="/templates/template.xhtml">
- <ui:param name="dontRenderForm" value="true" />
+<ui:composition template="/templates/template.xhtml">
+ <ui:param name="dontRenderForm" value="true" />
- <ui:define name="view">
- <f:metadata>
- <f:viewParam name="templates"
value="#{templateBean.templates}">
- <f:converter converterId="templatesListConverter" />
- </f:viewParam>
- </f:metadata>
- </ui:define>
+ <ui:define name="view">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
- <ui:define name="head"/>
+ <ui:define name="head" />
- <ui:define name="outOfTemplateBefore">
+ <ui:define name="outOfTemplateBefore">
- <a4j:queue id="globalQueue"
-
ignoreDupResponses="#{a4jQueueBean.globalQueue.attributes['ignoreDupResponses'].value}"
-
onbeforedomupdate="#{a4jQueueBean.globalQueue.attributes['onbeforedomupdate'].value}"
-
oncomplete="#{a4jQueueBean.globalQueue.attributes['oncomplete'].value}"
-
onerror="#{a4jQueueBean.globalQueue.attributes['onerror'].value}"
-
onevent="#{a4jQueueBean.globalQueue.attributes['onevent'].value}"
-
onrequestdequeue="#{a4jQueueBean.globalQueue.attributes['onrequestdequeue'].value}"
-
onrequestqueue="#{a4jQueueBean.globalQueue.attributes['onrequestqueue'].value}"
-
onsubmit="#{a4jQueueBean.globalQueue.attributes['onsubmit'].value}"
-
rendered="#{a4jQueueBean.globalQueue.attributes['rendered'].value}"
-
requestDelay="#{a4jQueueBean.globalQueue.attributes['requestDelay'].value}"
- />
+ <a4j:queue id="globalQueue"
ignoreDupResponses="#{a4jQueueBean.globalQueue.attributes['ignoreDupResponses'].value}"
+
onbeforedomupdate="#{a4jQueueBean.globalQueue.attributes['onbeforedomupdate'].value}"
+
oncomplete="#{a4jQueueBean.globalQueue.attributes['oncomplete'].value}"
+
onerror="#{a4jQueueBean.globalQueue.attributes['onerror'].value}"
+
onevent="#{a4jQueueBean.globalQueue.attributes['onevent'].value}"
+
onrequestdequeue="#{a4jQueueBean.globalQueue.attributes['onrequestdequeue'].value}"
+
onrequestqueue="#{a4jQueueBean.globalQueue.attributes['onrequestqueue'].value}"
+
onsubmit="#{a4jQueueBean.globalQueue.attributes['onsubmit'].value}"
+
rendered="#{a4jQueueBean.globalQueue.attributes['rendered'].value}"
+
requestDelay="#{a4jQueueBean.globalQueue.attributes['requestDelay'].value}"
/>
- </ui:define>
+ </ui:define>
- <ui:define name="component">
+ <ui:define name="component">
- <c:forEach var="i" begin="1" end="2"
step="1">
- <rich:panel id="formQueue${i}Panel" header="Form Based
Queue ${i}">
- <h:form id="formQueue${i}Form">
+ <c:forEach var="i" begin="1" end="2"
step="1">
+ <rich:panel id="formQueue${i}Panel" header="Form Based
Queue ${i}">
+ <h:form id="formQueue${i}Form">
- <a4j:queue id="queue"
-
ignoreDupResponses="#{a4jQueueBean.formQueues[i-1].attributes['ignoreDupResponses'].value}"
-
name="#{a4jQueueBean.formQueues[i-1].attributes['name'].value}"
-
onbeforedomupdate="#{a4jQueueBean.formQueues[i-1].attributes['onbeforedomupdate'].value}"
-
oncomplete="#{a4jQueueBean.formQueues[i-1].attributes['oncomplete'].value}"
-
onerror="#{a4jQueueBean.formQueues[i-1].attributes['onerror'].value}"
-
onevent="#{a4jQueueBean.formQueues[i-1].attributes['event'].value}"
-
onrequestdequeue="#{a4jQueueBean.formQueues[i-1].attributes['onrequestdequeue'].value}"
-
onrequestqueue="#{a4jQueueBean.formQueues[i-1].attributes['onrequestqueue'].value}"
-
onsubmit="#{a4jQueueBean.formQueues[i-1].attributes['onsubmit'].value}"
-
rendered="#{a4jQueueBean.formQueues[i-1].attributes['rendered'].value}"
-
requestDelay="#{a4jQueueBean.formQueues[i-1].attributes['requestDelay'].value}"
- />
+ <a4j:queue id="queue"
+
ignoreDupResponses="#{a4jQueueBean.formQueues[i-1].attributes['ignoreDupResponses'].value}"
+
name="#{a4jQueueBean.formQueues[i-1].attributes['name'].value}"
+
onbeforedomupdate="#{a4jQueueBean.formQueues[i-1].attributes['onbeforedomupdate'].value}"
+
oncomplete="#{a4jQueueBean.formQueues[i-1].attributes['oncomplete'].value}"
+
onerror="#{a4jQueueBean.formQueues[i-1].attributes['onerror'].value}"
+
onevent="#{a4jQueueBean.formQueues[i-1].attributes['event'].value}"
+
onrequestdequeue="#{a4jQueueBean.formQueues[i-1].attributes['onrequestdequeue'].value}"
+
onrequestqueue="#{a4jQueueBean.formQueues[i-1].attributes['onrequestqueue'].value}"
+
onsubmit="#{a4jQueueBean.formQueues[i-1].attributes['onsubmit'].value}"
+
rendered="#{a4jQueueBean.formQueues[i-1].attributes['rendered'].value}"
+
requestDelay="#{a4jQueueBean.formQueues[i-1].attributes['requestDelay'].value}"
/>
- <script type="text/javascript">
+ <script type="text/javascript">
function add(element) {
element.innerHTML = 1 + parseInt(element.innerHTML);
}
</script>
- <h:panelGrid columns="2">
- <h:outputText value="Event 1:" />
- <h:inputText id="input1"
value="#{a4jQueueBean.text}"
onkeypress="add(#{rich:element('events1')});
#{rich:element('timeWatcher:grid')}.event(1); ">
- <a4j:ajax event="keypress"
onbegin="add(#{rich:element('requests')});
#{rich:element('timeWatcher:grid')}.begin(); " render="outtext"
-
oncomplete="#{rich:element('timeWatcher:grid')}.complete();
#{rich:element('timeWatcher:grid')}.difference();"
onbeforedomupdate="add(#{rich:element('updates')}); " />
- </h:inputText>
- <h:outputText value="Event 2:" />
- <h:inputText id="input2"
value="#{a4jQueueBean.text}"
onkeypress="add(#{rich:element('events2')});
#{rich:element('timeWatcher:grid')}.event(2) ">
- <a4j:ajax event="keypress"
onbegin="add(#{rich:element('requests')});
#{rich:element('timeWatcher:grid')}.begin(); " render="outtext"
-
oncomplete="#{rich:element('timeWatcher:grid')}.complete();
#{rich:element('timeWatcher:grid')}.difference();"
onbeforedomupdate="add(#{rich:element('updates')}); " />
- </h:inputText>
+ <h:panelGrid columns="2">
+ <h:outputText value="Event 1:" />
+ <h:inputText id="input1"
value="#{a4jQueueBean.text}"
+ onkeypress="add(#{rich:element('events1')});
#{rich:element('timeWatcher:grid')}.event(1); ">
+ <a4j:ajax event="keypress"
+ onbegin="add(#{rich:element('requests')});
#{rich:element('timeWatcher:grid')}.begin(); "
+ render="outtext"
+
oncomplete="#{rich:element('timeWatcher:grid')}.complete();
#{rich:element('timeWatcher:grid')}.difference();"
+
onbeforedomupdate="add(#{rich:element('updates')}); " />
+ </h:inputText>
+ <h:outputText value="Event 2:" />
+ <h:inputText id="input2"
value="#{a4jQueueBean.text}"
+ onkeypress="add(#{rich:element('events2')});
#{rich:element('timeWatcher:grid')}.event(2) ">
+ <a4j:ajax event="keypress"
+ onbegin="add(#{rich:element('requests')});
#{rich:element('timeWatcher:grid')}.begin(); "
+ render="outtext"
+
oncomplete="#{rich:element('timeWatcher:grid')}.complete();
#{rich:element('timeWatcher:grid')}.difference();"
+
onbeforedomupdate="add(#{rich:element('updates')}); " />
+ </h:inputText>
- <h:outputText value="Repeated text:" />
- <h:outputText value="#{a4jQueueBean.text}"
id="outtext" style="font-weight:bold;" />
- <h:outputText value="Event 1 count:" />
- <h:outputText value="0" id="events1"
/>
- <h:outputText value="Event 2 count:" />
- <h:outputText value="0" id="events2"
/>
- <h:outputText value="Requests count:" />
- <h:outputText value="0" id="requests"
/>
- <h:outputText value="DOM updates count:" />
- <h:outputText value="0" id="updates"
/>
+ <h:outputText value="Repeated text:" />
+ <h:outputText value="#{a4jQueueBean.text}"
id="outtext" style="font-weight:bold;" />
+ <h:outputText value="Click here (with error):"
/>
+ <a4j:commandButton id="errorButton"
value="Action with error" action="#{richBean.causeError}" />
+ <h:outputText value="Event 1 count:" />
+ <h:outputText value="0" id="events1"
/>
+ <h:outputText value="Event 2 count:" />
+ <h:outputText value="0" id="events2"
/>
+ <h:outputText value="Requests count:" />
+ <h:outputText value="0" id="requests"
/>
+ <h:outputText value="DOM updates count:" />
+ <h:outputText value="0" id="updates"
/>
- </h:panelGrid>
+ </h:panelGrid>
- <metamer:clientTimeWatcher id="timeWatcher"
events="2" />
+ <metamer:clientTimeWatcher id="timeWatcher"
events="2" />
- </h:form>
- </rich:panel>
+ </h:form>
+ </rich:panel>
- </c:forEach>
+ </c:forEach>
- </ui:define>
+ </ui:define>
- <ui:define name="outOfTemplateAfter">
- <h:form id="attributeForm">
- <rich:panel id="formQueue1AttributesPanel" header="Form
Queue 1 Attributes">
- <metamer:attributes
value="#{a4jQueueBean.formQueue1.attributes}"
id="formQueue1Attributes" />
- </rich:panel>
- <rich:panel id="formQueue2AttributesPanel" header="Form
Queue 2 Attributes">
- <metamer:attributes
value="#{a4jQueueBean.formQueue2.attributes}"
id="formQueue2Attributes" />
- </rich:panel>
- <rich:panel id="globalQueueAttributesPanel"
header="Global Queue Attributes">
- <metamer:attributes
value="#{a4jQueueBean.globalQueue.attributes}"
id="globalQueueAttributes" />
- </rich:panel>
- </h:form>
- </ui:define>
+ <ui:define name="outOfTemplateAfter">
+ <h:form id="attributeForm">
+ <rich:panel id="formQueue1AttributesPanel" header="Form
Queue 1 Attributes">
+ <metamer:attributes
value="#{a4jQueueBean.formQueue1.attributes}"
id="formQueue1Attributes" />
+ </rich:panel>
+ <rich:panel id="formQueue2AttributesPanel" header="Form
Queue 2 Attributes">
+ <metamer:attributes
value="#{a4jQueueBean.formQueue2.attributes}"
id="formQueue2Attributes" />
+ </rich:panel>
+ <rich:panel id="globalQueueAttributesPanel" header="Global
Queue Attributes">
+ <metamer:attributes
value="#{a4jQueueBean.globalQueue.attributes}"
id="globalQueueAttributes" />
+ </rich:panel>
+ </h:form>
+ </ui:define>
- </ui:composition>
+</ui:composition>
</html>
\ No newline at end of file
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/a4jQueue/globalQueue.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/a4jQueue/globalQueue.xhtml 2012-01-06
16:36:16 UTC (rev 23133)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/a4jQueue/globalQueue.xhtml 2012-01-09
14:55:52 UTC (rev 23134)
@@ -77,6 +77,9 @@
oncomplete="#{rich:element('timeWatcher:grid')}.complete();
#{rich:element('timeWatcher:grid')}.difference(); "
onbeforedomupdate="add(#{rich:element('updates')});" />
</h:commandButton>
+
+ <h:outputText value="Click here (with error):" />
+ <a4j:commandButton id="errorButton"
value="Action" action="#{richBean.causeError}"/>
<h:outputText value="Repeated text:" />
<h:outputText value="#{a4jQueueBean.text}"
id="outtext" style="font-weight:bold;" />
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richEditor/simple.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richEditor/simple.xhtml 2012-01-06
16:36:16 UTC (rev 23133)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richEditor/simple.xhtml 2012-01-09
14:55:52 UTC (rev 23134)
@@ -111,16 +111,16 @@
<fieldset>
<legend>JavaScript API of rich:editor by
a4j:commandButton</legend>
- <a4j:commandButton value="getValue()"
onclick="alert('Editor value:
'+#{rich:component('editor')}.getValue());" />
- <a4j:commandButton value="setValue()"
onclick="#{rich:component('editor')}.setValue('NEW VALUE SET BY
JS!')" />
- <a4j:commandButton value="getInput()"
onclick="alert('Inut value:
'+#{rich:component('editor')}.getInput());" />
- <a4j:commandButton value="focus()"
onclick="#{rich:component('editor')}.focus()" />
- <a4j:commandButton value="blur()"
onclick="#{rich:component('editor')}.blur()" />
- <a4j:commandButton value="isFocused()"
onclick="alert('Is editor focused:
'+#{rich:component('editor')}.isFocused());" />
- <a4j:commandButton value="isDirty()"
onclick="alert('Is editor dirty:
'+#{rich:component('editor')}.isDirty());" />
- <a4j:commandButton value="isValueChanged()"
onclick="alert('Is editor value changed:
'+#{rich:component('editor')}.isValueChanged());" />
- <a4j:commandButton value="isReadonly()"
onclick="alert('Is editor readonly:
'+#{rich:component('editor')}.isReadonly());" />
- <a4j:commandButton value="setReadonly()"
onclick="#{rich:component('editor')}.setReadonly()" />
+ <input type="button" value="getValue()"
onclick="alert('Editor value:
'+#{rich:component('editor')}.getValue());" />
+ <input type="button" value="setValue()"
onclick="#{rich:component('editor')}.setValue('NEW VALUE SET BY
JS!')" />
+ <input type="button" value="getInput()"
onclick="alert('Inut value:
'+#{rich:component('editor')}.getInput());" />
+ <input type="button" value="focus()"
onclick="#{rich:component('editor')}.focus()" />
+ <input type="button" value="blur()"
onclick="#{rich:component('editor')}.blur()" />
+ <input type="button" value="isFocused()"
onclick="alert('Is editor focused:
'+#{rich:component('editor')}.isFocused());" />
+ <input type="button" value="isDirty()"
onclick="alert('Is editor dirty:
'+#{rich:component('editor')}.isDirty());" />
+ <input type="button" value="isValueChanged()"
onclick="alert('Is editor value changed:
'+#{rich:component('editor')}.isValueChanged());" />
+ <input type="button" value="isReadonly()"
onclick="alert('Is editor readonly:
'+#{rich:component('editor')}.isReadonly());" />
+ <input type="button" value="setReadonly()"
onclick="#{rich:component('editor')}.setReadonly()" />
</fieldset>
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/templates/header.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/templates/header.xhtml 2012-01-06
16:36:16 UTC (rev 23133)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/templates/header.xhtml 2012-01-09
14:55:52 UTC (rev 23134)
@@ -60,6 +60,9 @@
<f:facet name="start">
<h:outputText value="WORKING" style="color:
red;" />
</f:facet>
+ <f:facet name="error">
+ <h:outputText value="ERROR" style="color:
red;" />
+ </f:facet>
</a4j:status>
</a4j:outputPanel>
Modified:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2012-01-06
16:36:16 UTC (rev 23133)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2012-01-09
14:55:52 UTC (rev 23134)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2012, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
@@ -50,8 +50,6 @@
import org.apache.commons.lang.LocaleUtils;
import org.jboss.cheiron.retriever.ScriptEvaluationRetriever;
import org.jboss.test.selenium.AbstractTestCase;
-import org.jboss.test.selenium.SystemProperties;
-import org.jboss.test.selenium.browser.BrowserType;
import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.encapsulated.JavaScript;
import org.jboss.test.selenium.locator.Attribute;
@@ -68,8 +66,6 @@
import org.richfaces.tests.metamer.TemplatesList;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
import org.richfaces.tests.metamer.ftest.annotations.Templates;
-import org.richfaces.tests.metamer.ftest.attributes.AttributeEnum;
-import org.richfaces.tests.metamer.ftest.attributes.Attributes;
import org.testng.SkipException;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
Modified:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/Autocomplete.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/Autocomplete.java 2012-01-06
16:36:16 UTC (rev 23133)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/Autocomplete.java 2012-01-09
14:55:52 UTC (rev 23134)
@@ -35,6 +35,7 @@
import org.jboss.test.selenium.encapsulated.JavaScript;
import org.jboss.test.selenium.framework.AjaxSelenium;
import org.jboss.test.selenium.framework.AjaxSeleniumProxy;
+import org.jboss.test.selenium.geometry.Point;
import org.jboss.test.selenium.locator.JQueryLocator;
/**
@@ -53,7 +54,7 @@
JQueryLocator items = jq("div.rf-au-lst-cord[id$=autocompleteList]
div[id$=autocompleteItems]");
JQueryLocator selection = items.getDescendant(jq("div.rf-au-itm-sel"));
JQueryLocator option = jq("div.rf-au-itm");
- JQueryLocator labeledOption = jq("div.rf-au-opt:contains('{0}')");
+ JQueryLocator labeledOption = jq("div.rf-au-opt:contains({0})");
public void typeKeys(String keys) {
for (int i = 0; i < keys.length(); i++) {
@@ -83,6 +84,19 @@
pressUp();
}
}
+
+ /**
+ * Method for select option from autocomplete suggestions. This method doesn't
invoke/display suggestions.
+ * Is should be already done by another selenium invocation.
+ *
+ * For now, it is just selenium.clickAt()
+ *
+ * @param label
+ */
+ public void selectByMouse(String label) {
+ selenium.mouseOver(labeledOption.format(label));
+ selenium.clickAt(labeledOption.format(label), new Point(3, 3));
+ }
public boolean isLabeledOptionAvailable(String label) {
return selenium.isElementPresent(getLabeledOption(label));
Modified:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteByKeys.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteByKeys.java 2012-01-06
16:36:16 UTC (rev 23133)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteByKeys.java 2012-01-09
14:55:52 UTC (rev 23134)
@@ -81,6 +81,14 @@
assertCompletionVisible(false);
assertTrue(getAutocomplete().getInputText().toLowerCase().startsWith(getExpectedStateForPrefix().toLowerCase()));
}
+
+ @Test
+ public void testSimpleSelection() {
+ String expected = "Alaska"; // this item is 2nd if type filter
"ala", so it ensure that it was not picked first item
+ typePrefix("ala");
+ autocomplete.selectByMouse(expected);
+ assertEquals(getAutocomplete().getInputText(), expected);
+ }
@Test
@IssueTracking("https://issues.jboss.org/browse/RF-11323")
Modified:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestDateEditor.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestDateEditor.java 2012-01-06
16:36:16 UTC (rev 23133)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestDateEditor.java 2012-01-09
14:55:52 UTC (rev 23134)
@@ -67,8 +67,8 @@
}
for (int i = 0; i < 10; i++) {
- assertTrue(selenium.isElementPresent(dateEditorYears.format(i)), "Date
editor doesn't contain label for year " + (2007 + i));
- assertEquals(selenium.getText(dateEditorYears.format(i)),
Integer.toString(2007 + i), "Label of year");
+ assertTrue(selenium.isElementPresent(dateEditorYears.format(i)), "Date
editor doesn't contain label for year " + (2008 + i));
+ assertEquals(selenium.getText(dateEditorYears.format(i)),
Integer.toString(2008 + i), "Label of year");
if (currentYear.equals(selenium.getText(dateEditorYears.format(i)))) {
assertTrue(selenium.belongsClass(dateEditorYears.format(i),
"rf-cal-edtr-btn-sel"), "Current year should be selected.");
Modified:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMenuGroup/TestRichMenuGroup.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMenuGroup/TestRichMenuGroup.java 2012-01-06
16:36:16 UTC (rev 23133)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMenuGroup/TestRichMenuGroup.java 2012-01-09
14:55:52 UTC (rev 23134)
@@ -54,8 +54,8 @@
private JQueryLocator fileMenuList = pjq("div[id$=menu1_list]");
private JQueryLocator group = pjq("div[id$=menuGroup4]");
private JQueryLocator groupList = pjq("div[id$=menuGroup4_list]");
- private JQueryLocator icon = group.getDescendant(jq("> span.rf-ddm-itm-ic
img"));
- private JQueryLocator emptyIcon = group.getDescendant(jq(">
span.rf-ddm-itm-ic > div.rf-ddm-emptyIcon"));
+ private JQueryLocator icon = group.getDescendant(jq("> div.rf-ddm-itm-ic
img"));
+ private JQueryLocator emptyIcon = group.getDescendant(jq("> div.rf-ddm-itm-ic
> div.rf-ddm-emptyIcon"));
private JQueryLocator label =
group.getDescendant(jq("span.rf-ddm-itm-lbl"));
private JQueryLocator menuItem41 = pjq("div[id$=menuItem41]");
Modified:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbar/TestRichToolbar.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbar/TestRichToolbar.java 2012-01-06
16:36:16 UTC (rev 23133)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbar/TestRichToolbar.java 2012-01-09
14:55:52 UTC (rev 23134)
@@ -26,7 +26,6 @@
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.richfaces.tests.metamer.ftest.BasicAttributes.itemClass;
import static org.richfaces.tests.metamer.ftest.BasicAttributes.itemStyle;
-import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
@@ -51,10 +50,10 @@
private JQueryLocator toolbar = pjq("table[id$=toolbar]");
private JQueryLocator separator = pjq("td.rf-tb-sep");
- private JQueryLocator[] items = {pjq("td[id$=createDocument_itm]"),
pjq("td[id$=createFolder_itm]"),
+ private JQueryLocator[] items = { pjq("td[id$=createDocument_itm]"),
pjq("td[id$=createFolder_itm]"),
pjq("td[id$=copy_itm]"), pjq("td[id$=save_itm]"),
pjq("td[id$=saveAs_itm]"), pjq("td[id$=saveAll_itm]"),
- pjq("td[id$=input_itm]"), pjq("td[id$=button_itm]")};
- private String[] separators = {"disc", "grid", "line",
"square"};
+ pjq("td[id$=input_itm]"), pjq("td[id$=button_itm]") };
+ private String[] separators = { "disc", "grid", "line",
"square" };
@Inject
@Use(empty = true)
private JQueryLocator item;
@@ -83,10 +82,14 @@
@Test
public void testHeight() {
- selenium.type(pjq("input[id$=heightInput]"), "");
+ AttributeLocator<?> attr = toolbar.getAttribute(Attribute.STYLE);
+ assertTrue(selenium.isAttributePresent(attr), "Attribute style should be
present.");
+ assertTrue(selenium.getAttribute(attr).contains("height: 28px"),
"Height in attribute style should be 28px");
+
+ selenium.type(pjq("input[id$=heightInput]"), "50px");
selenium.waitForPageToLoad();
- testHtmlAttribute(toolbar, "height", "50px");
+ assertTrue(selenium.getAttribute(attr).contains("height: 50px"),
"Attribute style should have height 50px.");
}
@Test
@@ -127,7 +130,7 @@
selenium.waitForPageToLoad();
JQueryLocator separatorImg = separator.getDescendant(jq("> img"));
- AttributeLocator attr = separatorImg.getAttribute(Attribute.SRC);
+ AttributeLocator<?> attr = separatorImg.getAttribute(Attribute.SRC);
assertTrue(selenium.isElementPresent(separator), "Item separator should be
present on the page.");
assertTrue(selenium.isElementPresent(separatorImg), "Item separator does not
work correctly.");
@@ -142,7 +145,7 @@
selenium.waitForPageToLoad();
JQueryLocator separatorImg = separator.getDescendant(jq("> img"));
- AttributeLocator attr = separatorImg.getAttribute(Attribute.SRC);
+ AttributeLocator<?> attr = separatorImg.getAttribute(Attribute.SRC);
assertTrue(selenium.isElementPresent(separator), "Item separator should be
present on the page.");
assertTrue(selenium.isElementPresent(separatorImg), "Item separator does not
work correctly.");
@@ -230,21 +233,22 @@
public void testStyle() {
super.testStyle(toolbar);
}
-
+
@Test
public void testStyleClass() {
super.testStyleClass(toolbar);
}
-
+
@Test
public void testWidth() {
- AttributeLocator attr = toolbar.getAttribute(Attribute.WIDTH);
- assertTrue(selenium.isAttributePresent(attr), "Attribute width should be
present.");
- assertEquals(selenium.getAttribute(attr), "100%", "Attribute width
when it is not set.");
+ AttributeLocator<?> attr = toolbar.getAttribute(Attribute.STYLE);
+ assertTrue(selenium.isAttributePresent(attr), "Attribute style should be
present.");
+ assertTrue(selenium.getAttribute(attr).contains("width: 100%"),
+ "Attribute style should have 100% width when it is not set.");
selenium.type(pjq("input[id$=widthInput]"), "500px");
selenium.waitForPageToLoad();
- assertTrue(selenium.getAttribute(attr).contains("500px"),
"Attribute width should contain \"500px\".");
+ assertTrue(selenium.getAttribute(attr).contains("width: 500px"),
"Attribute style should have width 500px.");
}
}
Modified:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/AbstractTestTree.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/AbstractTestTree.java 2012-01-06
16:36:16 UTC (rev 23133)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/AbstractTestTree.java 2012-01-09
14:55:52 UTC (rev 23134)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2012, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
@@ -32,15 +32,14 @@
/**
* @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
*/
-public class AbstractTestTree extends AbstractMetamerTest {
+public abstract class AbstractTestTree extends AbstractMetamerTest {
@Inject
- @Use(strings = {"simpleSwingTreeNode", "simpleRichFacesTreeNode",
"simpleRichFacesTreeDataModel"})
+ @Use(strings = { "simpleSwingTreeNode",
"simpleRichFacesTreeNode", "simpleRichFacesTreeDataModel" })
private String sample;
@Override
public URL getTestUrl() {
return buildUrl(contextPath, "faces/components/richTree/" + sample +
".xhtml");
}
-
}
Copied:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/AbstractTestTreeSelection.java
(from rev 23133,
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/AbstractTestTreeSelection.java)
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/AbstractTestTreeSelection.java
(rev 0)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/AbstractTestTreeSelection.java 2012-01-09
14:55:52 UTC (rev 23134)
@@ -0,0 +1,174 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2012, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richTree;
+
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.treeAttributes;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+
+import java.util.Arrays;
+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.jboss.test.selenium.utils.text.SimplifiedFormat;
+import org.richfaces.component.SwitchType;
+import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.testng.annotations.BeforeMethod;
+
+/**
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ */
+public abstract class AbstractTestTreeSelection extends AbstractTestTree {
+
+ @Inject
+ @Use(value = "selectionTypes")
+ protected SwitchType selectionType;
+
+ protected SwitchType[] selectionTypes = new SwitchType[] { SwitchType.ajax,
SwitchType.client };
+ protected SwitchType[] selectionTypeAjax = new SwitchType[] { SwitchType.ajax };
+ protected SwitchType[] selectionTypeClient = new SwitchType[] { SwitchType.client };
+ protected SwitchType[] eventEnabledSelectionTypes = new SwitchType[] {
SwitchType.ajax };
+
+ protected TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
+ protected TreeNodeModel treeNode;
+
+ protected Integer[][] selectionPaths = new Integer[][] { { 4, 3 }, { 2, 1, 1 }, { 2
}, { 4, 10, 3 } };
+
+ private JQueryLocator expandAll = jq("input:submit[id$=expandAll]");
+ private JQueryLocator selection = jq("span[id$=selection]");
+ private JQueryLocator clientId = jq("span[id$=selectionEventClientId]");
+ private JQueryLocator newSelection =
jq("span[id$=selectionEventNewSelection]");
+ private JQueryLocator oldSelection =
jq("span[id$=selectionEventOldSelection]");
+
+ @BeforeMethod
+ public void testInitialize() {
+ treeAttributes.set(TreeAttributes.selectionType, selectionType);
+ tree.setSelectionType(selectionType);
+ }
+
+ protected void testTopLevelSelection() {
+ assertEquals(tree.getAnySelectedNodesCount(), 0);
+
+ for (TreeNodeModel treeNode : tree.getNodes()) {
+ assertFalse(treeNode.isSelected());
+ assertTrue(treeNode.isCollapsed());
+ treeNode.select();
+ assertTrue(treeNode.isSelected());
+ assertTrue(treeNode.isCollapsed());
+
+ assertEquals(tree.getAnySelectedNodesCount(), 1);
+ }
+ }
+
+ protected void testSubNodesSelection() {
+ expandAll();
+ assertEquals(tree.getAnySelectedNodesCount(), 0);
+
+ for (Integer[] path : selectionPaths) {
+ treeNode = null;
+ for (int index : path) {
+ treeNode = (treeNode == null) ? tree.getNode(index) :
treeNode.getNode(index);
+ }
+ assertFalse(treeNode.isSelected());
+ treeNode.select();
+ assertTrue(treeNode.isSelected());
+ assertEquals(tree.getAnySelectedNodesCount(), 1);
+ }
+ }
+
+ protected void testSubNodesSelectionEvents() {
+ expandAll();
+ Integer[] old = null;
+ for (Integer[] path : selectionPaths) {
+ treeNode = null;
+ for (int index : path) {
+ treeNode = (treeNode == null) ? tree.getNode(index) :
treeNode.getNode(index);
+ }
+ treeNode.select();
+ assertEquals(getClientId(), "richTree");
+ assertEquals(
+ getSelection(),
+ path,
+ SimplifiedFormat.format("Actual Selection ({0}) doesn't
correspond to expected ({1})",
+ Arrays.deepToString(getSelection()), Arrays.deepToString(path)));
+ assertEquals(
+ getNewSelection(),
+ path,
+ SimplifiedFormat.format("Actual New selection ({0}) doesn't
correspond to expected ({1})",
+ Arrays.deepToString(getNewSelection()), Arrays.deepToString(path)));
+ if (old != null) {
+ assertEquals(
+ getOldSelection(),
+ old,
+ SimplifiedFormat.format("Actual Old selection ({0}) doesn't
correspond to expected ({1})",
+ Arrays.deepToString(getOldSelection()),
Arrays.deepToString(old)));
+ } else {
+ assertEquals(selenium.getText(oldSelection), "[]");
+ }
+ old = getNewSelection();
+ }
+ }
+
+ protected Integer[] getSelection() {
+ String string = selenium.getText(selection);
+ return getIntsFromString(string);
+ }
+
+ protected Integer[] getNewSelection() {
+ String string = selenium.getText(newSelection);
+ return getIntsFromString(string);
+ }
+
+ protected Integer[] getOldSelection() {
+ String string = selenium.getText(oldSelection);
+ return getIntsFromString(string);
+ }
+
+ protected String getClientId() {
+ return selenium.getText(clientId);
+ }
+
+ 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");
+ }
+
+ protected void expandAll() {
+ guardXhr(selenium).click(expandAll);
+ }
+}
Modified:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreePhases.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreePhases.java 2012-01-06
16:36:16 UTC (rev 23133)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreePhases.java 2012-01-09
14:55:52 UTC (rev 23134)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2012, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
@@ -26,6 +26,7 @@
import javax.faces.event.PhaseId;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.richfaces.tests.metamer.ftest.annotations.Use;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -47,6 +48,7 @@
}
@Test
+ @Use(field = "sample", strings = { "simpleSwingTreeNode",
"simpleRichFacesTreeDataModel" })
public void testPhasesSelection() {
tree.getNode(4).expand();
tree.getNode(4).getNode(3).select();
@@ -54,6 +56,13 @@
phaseInfo.assertListener(PhaseId.APPLY_REQUEST_VALUES, "selection change
listener invoked");
}
+ @Test(groups = { "4.2" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-11766")
+ @Use(field = "sample", strings = { "simpleRichFacesTreeNode" })
+ public void testPhasesSelectionWithSimpleTreeNode() {
+ testPhasesSelection();
+ }
+
@Test
public void testPhasesToggling() {
tree.getNode(2).expand();
Modified:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSelection.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSelection.java 2012-01-06
16:36:16 UTC (rev 23133)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSelection.java 2012-01-09
14:55:52 UTC (rev 23134)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2012, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
@@ -21,158 +21,78 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.richTree;
-import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
-import static org.jboss.test.selenium.locator.LocatorFactory.jq;
import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.treeAttributes;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertTrue;
-import java.util.Arrays;
-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.jboss.test.selenium.utils.text.SimplifiedFormat;
import org.richfaces.component.SwitchType;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.richfaces.tests.metamer.ftest.annotations.Uses;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a> *
@author <a href="mailto:ppitonak@redhat.com">Pavol
+ * Pitonak</a>
* @version $Revision$
*/
-@Use(field = "selectionPaths", value = "")
-public class TestTreeSelection extends AbstractTestTree {
+public class TestTreeSelection extends AbstractTestTreeSelection {
- protected Integer[][] selectionPaths = new Integer[][] {{4, 3}, {1, 4}, {2, 1, 1},
{2}, {2, 1},
- {3, 5 }, {4, 10, 3 } };
-
- protected TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
- protected TreeNodeModel treeNode;
-
- @Inject
- @Use(value = "selectionTypes")
- SwitchType selectionType;
- SwitchType[] selectionTypes = new SwitchType[] {SwitchType.ajax, SwitchType.client};
- SwitchType[] eventEnabledSelectionTypes = new SwitchType[] {SwitchType.ajax};
-
- JQueryLocator expandAll = jq("input:submit[id$=expandAll]");
- JQueryLocator selection = jq("span[id$=selection]");
- JQueryLocator clientId = jq("span[id$=selectionEventClientId]");
- JQueryLocator newSelection = jq("span[id$=selectionEventNewSelection]");
- JQueryLocator oldSelection = jq("span[id$=selectionEventOldSelection]");
-
- @BeforeMethod
- public void testInitialize() {
- treeAttributes.set(TreeAttributes.selectionType, selectionType);
- tree.setSelectionType(selectionType);
+ @Test
+ @Use(field = "selectionType", value = "selectionTypeClient")
+ public void testTopLevelSelectionClient() {
+ testTopLevelSelection();
}
@Test
- public void testTopLevelSelection() {
- assertEquals(tree.getAnySelectedNodesCount(), 0);
+ @Uses({ @Use(field = "selectionType", value =
"selectionTypeAjax"),
+ @Use(field = "sample", strings = { "simpleSwingTreeNode",
"simpleRichFacesTreeDataModel" }) })
+ public void testTopLevelSelectionAjax() {
+ testTopLevelSelection();
+ }
- for (TreeNodeModel treeNode : tree.getNodes()) {
- assertFalse(treeNode.isSelected());
- assertTrue(treeNode.isCollapsed());
- treeNode.select();
- assertTrue(treeNode.isSelected());
- assertTrue(treeNode.isCollapsed());
-
- assertEquals(tree.getAnySelectedNodesCount(), 1);
- }
+ @Test(groups = { "4.2" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-11766")
+ @Uses({ @Use(field = "selectionType", value =
"selectionTypeAjax"),
+ @Use(field = "sample", strings = { "simpleRichFacesTreeNode"
}) })
+ public void testTopLevelSelectionAjaxWithSimpleTreeNode() {
+ testTopLevelSelection();
}
@Test
- public void testSubNodesSelection() {
- expandAll();
- assertEquals(tree.getAnySelectedNodesCount(), 0);
-
- for (Integer[] path : selectionPaths) {
- treeNode = null;
- for (int index : path) {
- treeNode = (treeNode == null) ? tree.getNode(index) :
treeNode.getNode(index);
- }
- assertFalse(treeNode.isSelected());
- treeNode.select();
- assertTrue(treeNode.isSelected());
- assertEquals(tree.getAnySelectedNodesCount(), 1);
- }
+ @Use(field = "selectionType", value = "selectionTypeClient")
+ public void testSubNodesSelectionClient() {
+ testSubNodesSelection();
}
@Test
- @Use(field = "selectionType", value =
"eventEnabledSelectionTypes")
- public void testSubNodesSelectionEvents() {
- expandAll();
- Integer[] old = null;
- for (Integer[] path : selectionPaths) {
- treeNode = null;
- for (int index : path) {
- treeNode = (treeNode == null) ? tree.getNode(index) :
treeNode.getNode(index);
- }
- treeNode.select();
- assertEquals(getClientId(), "richTree");
- assertEquals(
- getSelection(),
- path,
- SimplifiedFormat.format("Actual Selection ({0}) doesn't
correspond to expected ({1})",
- Arrays.deepToString(getSelection()), Arrays.deepToString(path)));
- assertEquals(
- getNewSelection(),
- path,
- SimplifiedFormat.format("Actual New selection ({0}) doesn't
correspond to expected ({1})",
- Arrays.deepToString(getNewSelection()), Arrays.deepToString(path)));
- if (old != null) {
- assertEquals(
- getOldSelection(),
- old,
- SimplifiedFormat.format("Actual Old selection ({0}) doesn't
correspond to expected ({1})",
- Arrays.deepToString(getOldSelection()),
Arrays.deepToString(old)));
- } else {
- assertEquals(selenium.getText(oldSelection), "[]");
- }
- old = getNewSelection();
- }
+ @Uses({ @Use(field = "selectionType", value =
"selectionTypeAjax"),
+ @Use(field = "sample", strings = { "simpleSwingTreeNode",
"simpleRichFacesTreeDataModel" }) })
+ public void testSubNodesSelectionAjax() {
+ testSubNodesSelection();
}
- protected void expandAll() {
- guardXhr(selenium).click(expandAll);
+ @Test(groups = { "4.2" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-11766")
+ @Uses({ @Use(field = "selectionType", value =
"selectionTypeAjax"),
+ @Use(field = "sample", strings = { "simpleRichFacesTreeNode"
}) })
+ public void testSubNodesSelectionAjaxWithSimpleTreeNode() {
+ testSubNodesSelection();
}
- 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");
+ @Test
+ @Uses({ @Use(field = "selectionType", value =
"eventEnabledSelectionTypes"),
+ @Use(field = "sample", strings = { "simpleSwingTreeNode",
"simpleRichFacesTreeDataModel" }) })
+ public void testSubNodesSelectionEventsAjax() {
+ testSubNodesSelectionEvents();
}
- private Integer[] getSelection() {
- String string = selenium.getText(selection);
- return getIntsFromString(string);
+ @Test(groups = { "4.2" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-11766")
+ @Uses({ @Use(field = "selectionType", value =
"eventEnabledSelectionTypes"),
+ @Use(field = "sample", strings = { "simpleRichFacesTreeNode"
}) })
+ public void testSubNodesSelectionEventsAjaxWithSimpleTreeNode() {
+ testSubNodesSelectionEvents();
}
- private Integer[] getNewSelection() {
- String string = selenium.getText(newSelection);
- return getIntsFromString(string);
- }
-
- private Integer[] getOldSelection() {
- String string = selenium.getText(oldSelection);
- return getIntsFromString(string);
- }
-
- private String getClientId() {
- return selenium.getText(clientId);
- }
}
Modified:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java 2012-01-06
16:36:16 UTC (rev 23133)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java 2012-01-09
14:55:52 UTC (rev 23134)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2012, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
@@ -243,6 +243,7 @@
}
@Test
+ @Use(field = "sample", strings = { "simpleSwingTreeNode",
"simpleRichFacesTreeDataModel" })
@Templates(exclude = "a4jRegion")
public void testSelectionClientSideEvents() {
String[] events = new String[] { "beforeselectionchange",
"begin", "beforedomupdate", "complete",
@@ -252,6 +253,14 @@
testRequestEventsAfter(events);
}
+ @Test(groups = { "4.2" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-11766")
+ @Use(field = "sample", strings = { "simpleRichFacesTreeNode" })
+ @Templates(exclude = "a4jRegion")
+ public void testSelectionClientSideEventsWithSimpleTreeNode() {
+ testSelectionClientSideEvents();
+ }
+
@Test(groups = { "4.Future" })
@IssueTracking("https://issues.jboss.org/browse/RF-11319")
@Templates(value = "a4jRegion")
Modified:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java 2012-01-06
16:36:16 UTC (rev 23133)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java 2012-01-09
14:55:52 UTC (rev 23134)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2012, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
@@ -33,7 +33,7 @@
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.AbstractTestTreeSelection;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -41,15 +41,15 @@
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
*/
-public class TestTreeModelAdaptorSelection extends TestTreeSelection {
-
+public class TestTreeModelAdaptorSelection extends AbstractTestTreeSelection {
+
@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 } });
-
+ 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 } });
+
@Inject
@Use(enumeration = true)
private RecursiveModelRepresentation representation;
@@ -76,23 +76,23 @@
}
@Test
+ @Use(field = "paths", empty = true)
@Override
- @Use(field = "paths", empty = true)
public void testTopLevelSelection() {
super.testTopLevelSelection();
}
@Test
+ @Use(field = "paths", value = "paths*")
@Override
- @Use(field = "paths", value = "paths*")
public void testSubNodesSelection() {
super.testSubNodesSelection();
}
@Test
- @Override
@Uses({ @Use(field = "paths", value = "paths*"),
@Use(field = "selectionType", value =
"eventEnabledSelectionTypes") })
+ @Override
public void testSubNodesSelectionEvents() {
super.testSubNodesSelectionEvents();
}