Author: ppitonak(a)redhat.com
Date: 2011-08-15 08:41:51 -0400 (Mon, 15 Aug 2011)
New Revision: 22631
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/facets.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/AbstractCollapsibleSubTableTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/TestCollapsibleSubTableFacets.java
Log:
tests for rich:collapsibleSubTable facets tests fixed
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/facets.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/facets.xhtml 2011-08-15
09:10:11 UTC (rev 22630)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/facets.xhtml 2011-08-15
12:41:51 UTC (rev 22631)
@@ -1,10 +1,10 @@
<?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:metamer="http://java.sun.com/jsf/composite/metamer"
-
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j">
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j">
- <!--
+<!--
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
@@ -26,132 +26,130 @@
02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-->
- <ui:composition template="/templates/template.xhtml">
- <ui:param name="componentId" value="richDataTable" />
+<ui:composition template="/templates/template.xhtml">
+ <ui:param name="componentId" value="richDataTable" />
- <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="outOfTemplateBefore">
- <br/>
- <h:outputText value="Show data in table: " />
- <h:selectBooleanCheckbox id="noDataCheckbox"
value="#{richSubTableBean.state}">
- <a4j:ajax render="#{nestedComponentId}"/>
- </h:selectBooleanCheckbox>
- <br/><br/>
- </ui:define>
+ <ui:define name="outOfTemplateBefore">
+ <br />
+ <h:outputText value="Show data in table: " />
+ <h:selectBooleanCheckbox id="noDataCheckbox"
value="#{richSubTableBean.state}">
+ <a4j:ajax render="#{nestedComponentId}" />
+ </h:selectBooleanCheckbox>
+ <br />
+ <br />
+ </ui:define>
- <ui:define name="component">
+ <ui:define name="component">
- <rich:dataTable id="richDataTable"
value="#{richSubTableBean.lists}" var="list"
keepSaved="true">
- <f:facet name="header">
- <rich:columnGroup id="columnGroup">
- <rich:column id="columnHeaderEmployees"
colspan="3">
- <h:outputText id="columnHeaderEmployeesText"
value="Employees" />
- </rich:column>
- <rich:column id="columnHeaderName"
breakRowBefore="true">
- <h:outputText id="columnHeaderNameText"
value="Name" />
- </rich:column>
- <rich:column id="columnHeaderTitle">
- <h:outputText id="columnHeaderTitleText"
value="Title" />
- </rich:column>
- <rich:column id="columnHeaderBirthdate">
- <h:outputText id="columnHeaderBirthdateText"
value="Birthdate" />
- </rich:column>
- </rich:columnGroup>
- </f:facet>
+ <rich:dataTable id="richDataTable"
value="#{richSubTableBean.lists}" var="list"
keepSaved="true">
+ <f:facet name="header">
+ <rich:columnGroup id="columnGroup">
+ <rich:column id="columnHeaderEmployees"
colspan="3">
+ <h:outputText id="columnHeaderEmployeesText"
value="Employees" />
+ </rich:column>
+ <rich:column id="columnHeaderName"
breakRowBefore="true">
+ <h:outputText id="columnHeaderNameText"
value="Name" />
+ </rich:column>
+ <rich:column id="columnHeaderTitle">
+ <h:outputText id="columnHeaderTitleText"
value="Title" />
+ </rich:column>
+ <rich:column id="columnHeaderBirthdate">
+ <h:outputText id="columnHeaderBirthdateText"
value="Birthdate" />
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
- <rich:column id="columnSubTable" colspan="3">
- <rich:collapsibleSubTableToggler id="subTableTC"
for="richSubTable"/>
- <h:outputText value="#{list[0].sex == 'MALE' ?
'Men' : 'Women'}" />
- </rich:column>
+ <rich:column id="columnSubTable" colspan="3">
+ <rich:collapsibleSubTableToggler id="subTableTC"
for="richSubTable" />
+ <h:outputText value="#{list[0].sex == 'MALE' ?
'Men' : 'Women'}" />
+ </rich:column>
- <rich:collapsibleSubTable id="richSubTable"
-
expanded="#{richSubTableBean.expanded[list]}"
-
expandMode="#{richSubTableBean.attributes['expandMode'].value}"
-
filterVar="#{richSubTableBean.attributes['filterVar'].value}"
-
first="#{richSubTableBean.attributes['first'].value}"
-
iterationStatusVar="#{richSubTableBean.attributes['iterationStatusVar'].value}"
-
keepSaved="#{richSubTableBean.attributes['keepSaved'].value}"
-
noDataLabel="#{richSubTableBean.attributes['noDataLabel'].value}"
-
onrowclick="#{richSubTableBean.attributes['onrowclick'].value}"
-
onrowdblclick="#{richSubTableBean.attributes['onrowdblclick'].value}"
-
onrowkeydown="#{richSubTableBean.attributes['onrowkeydown'].value}"
-
onrowkeypress="#{richSubTableBean.attributes['onrowkeypress'].value}"
-
onrowkeyup="#{richSubTableBean.attributes['onrowkeyup'].value}"
-
onrowmousedown="#{richSubTableBean.attributes['onrowmousedown'].value}"
-
onrowmousemove="#{richSubTableBean.attributes['onrowmousemove'].value}"
-
onrowmouseout="#{richSubTableBean.attributes['onrowmouseout'].value}"
-
onrowmouseover="#{richSubTableBean.attributes['onrowmouseover'].value}"
-
onrowmouseup="#{richSubTableBean.attributes['onrowmouseup'].value}"
-
rendered="#{richSubTableBean.attributes['rendered'].value}"
-
rowKeyConverter="#{richSubTableBean.attributes['rowKeyConverter'].value}"
-
rows="#{richSubTableBean.attributes['rows'].value}"
-
sortMode="#{richSubTableBean.attributes['sortMode'].value}"
-
sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
-
columnClasses="#{richSubTableBean.attributes['columnClasses'].value}"
-
footerClass="#{richSubTableBean.attributes['footerClass'].value}"
-
headerClass="#{richSubTableBean.attributes['headerClass'].value}"
-
rowClass="#{richSubTableBean.attributes['rowClass'].value}"
-
rowClasses="#{richSubTableBean.attributes['rowClasses'].value}"
-
style="#{richSubTableBean.attributes['style'].value}"
-
styleClass="#{richSubTableBean.attributes['styleClass'].value}"
- value="#{richSubTableBean.state ? list :
null}"
- var="item">
+ <rich:collapsibleSubTable id="richSubTable"
expanded="#{richSubTableBean.expanded[list]}"
+
expandMode="#{richSubTableBean.attributes['expandMode'].value}"
+
filterVar="#{richSubTableBean.attributes['filterVar'].value}"
+ first="#{richSubTableBean.attributes['first'].value}"
+
iterationStatusVar="#{richSubTableBean.attributes['iterationStatusVar'].value}"
+
keepSaved="#{richSubTableBean.attributes['keepSaved'].value}"
+
noDataLabel="#{richSubTableBean.attributes['noDataLabel'].value}"
+
onrowclick="#{richSubTableBean.attributes['onrowclick'].value}"
+
onrowdblclick="#{richSubTableBean.attributes['onrowdblclick'].value}"
+
onrowkeydown="#{richSubTableBean.attributes['onrowkeydown'].value}"
+
onrowkeypress="#{richSubTableBean.attributes['onrowkeypress'].value}"
+
onrowkeyup="#{richSubTableBean.attributes['onrowkeyup'].value}"
+
onrowmousedown="#{richSubTableBean.attributes['onrowmousedown'].value}"
+
onrowmousemove="#{richSubTableBean.attributes['onrowmousemove'].value}"
+
onrowmouseout="#{richSubTableBean.attributes['onrowmouseout'].value}"
+
onrowmouseover="#{richSubTableBean.attributes['onrowmouseover'].value}"
+
onrowmouseup="#{richSubTableBean.attributes['onrowmouseup'].value}"
+
rendered="#{richSubTableBean.attributes['rendered'].value}"
+
rowKeyConverter="#{richSubTableBean.attributes['rowKeyConverter'].value}"
+ rows="#{richSubTableBean.attributes['rows'].value}"
sortMode="#{richSubTableBean.attributes['sortMode'].value}"
+
sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
+
columnClasses="#{richSubTableBean.attributes['columnClasses'].value}"
+
footerClass="#{richSubTableBean.attributes['footerClass'].value}"
+
headerClass="#{richSubTableBean.attributes['headerClass'].value}"
+
rowClass="#{richSubTableBean.attributes['rowClass'].value}"
+
rowClasses="#{richSubTableBean.attributes['rowClasses'].value}"
+ style="#{richSubTableBean.attributes['style'].value}"
+
styleClass="#{richSubTableBean.attributes['styleClass'].value}"
value="#{richSubTableBean.state ? list : null}"
+ var="item">
- <f:facet name="noData">
- <h:outputText id="noData"
value="#{richSubTableBean.facets['noData']}" style="color:
red;"
- rendered="#{not empty
richSubTableBean.facets['noData']}"/>
- </f:facet>
+ <f:facet name="noData">
+ <h:outputText id="noData"
value="#{richSubTableBean.facets['noData']}" style="color:
red;"
+ rendered="#{not empty
richSubTableBean.facets['noData']}" />
+ </f:facet>
- <f:facet name="header">
- <h:outputText id="header"
value="#{richSubTableBean.facets['header']}"
- rendered="#{not empty
richSubTableBean.facets['header']}" />
- </f:facet>
+ <f:facet name="header">
+ <h:outputText id="header"
value="#{richSubTableBean.facets['header']}"
+ rendered="#{not empty
richSubTableBean.facets['header']}" />
+ </f:facet>
- <f:facet name="footer">
- <h:outputText id="footer"
value="#{richSubTableBean.facets['footer']}"
- rendered="#{not empty
richSubTableBean.facets['footer']}" />
- </f:facet>
+ <f:facet name="footer">
+ <h:outputText id="footer"
value="#{richSubTableBean.facets['footer']}"
+ rendered="#{not empty
richSubTableBean.facets['footer']}" />
+ </f:facet>
- <rich:column id="columnName">
- <h:outputText id="name"
value="#{item.name}" />
- </rich:column>
- <rich:column id="columnTitle">
- <h:outputText id="title"
value="#{item.title}" />
- </rich:column>
- <rich:column id="columnBirthdate">
- <h:outputText id="birthdate"
value="#{item.birthdate}">
- <f:convertDateTime pattern="d MMM yyyy"/>
- </h:outputText>
- </rich:column>
+ <rich:column id="columnName">
+ <h:outputText id="name" value="#{item.name}"
/>
+ </rich:column>
+ <rich:column id="columnTitle">
+ <h:outputText id="title" value="#{item.title}"
/>
+ </rich:column>
+ <rich:column id="columnBirthdate">
+ <h:outputText id="birthdate"
value="#{item.birthdate}">
+ <f:convertDateTime pattern="d MMM yyyy" />
+ </h:outputText>
+ </rich:column>
- </rich:collapsibleSubTable>
- </rich:dataTable>
+ </rich:collapsibleSubTable>
+ </rich:dataTable>
- </ui:define>
+ </ui:define>
- <ui:define name="outOfTemplateAfter">
- <a4j:ajax render="#{nestedComponentId}">
- <h:panelGrid columns="2">
- <h:outputLabel value="No Data Facet: " />
- <h:inputText id="noDataInput"
value="#{richSubTableBean.facets['noData']}" />
+ <ui:define name="outOfTemplateAfter">
+ <a4j:ajax render="#{nestedComponentId}">
+ <h:panelGrid columns="2">
+ <h:outputLabel value="No Data Facet: " />
+ <h:inputText id="noDataInput"
value="#{richSubTableBean.facets['noData']}" />
- <h:outputLabel value="Header Facet:" />
- <h:inputText id="headerInput"
value="#{richSubTableBean.facets['header']}" />
+ <h:outputLabel value="Header Facet:" />
+ <h:inputText id="headerInput"
value="#{richSubTableBean.facets['header']}" />
- <h:outputLabel value="Footer Facet:" />
- <h:inputText id="footerInput"
value="#{richSubTableBean.facets['footer']}" />
- </h:panelGrid>
- </a4j:ajax>
+ <h:outputLabel value="Footer Facet:" />
+ <h:inputText id="footerInput"
value="#{richSubTableBean.facets['footer']}" />
+ </h:panelGrid>
+ </a4j:ajax>
- <metamer:attributes value="#{richSubTableBean.attributes}"
id="attributes" />
- </ui:define>
+ <metamer:attributes value="#{richSubTableBean.attributes}"
id="attributes" />
+ </ui:define>
- </ui:composition>
+</ui:composition>
</html>
\ No newline at end of file
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/AbstractCollapsibleSubTableTest.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/AbstractCollapsibleSubTableTest.java 2011-08-15
09:10:11 UTC (rev 22630)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/AbstractCollapsibleSubTableTest.java 2011-08-15
12:41:51 UTC (rev 22631)
@@ -49,7 +49,7 @@
private static final List<Employee> EMPLOYEES = Model.unmarshallEmployees();
CollapsibleSubTableAttributes attributes = new CollapsibleSubTableAttributes();
- DataTable dataTable = new DataTable(pjq("table.rf-dt"));;
+ DataTable dataTable = new DataTable(pjq("table[id$=richDataTable]"));;
DataTableFacets facets = new DataTableFacets();
@Inject
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/TestCollapsibleSubTableFacets.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/TestCollapsibleSubTableFacets.java 2011-08-15
09:10:11 UTC (rev 22630)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/TestCollapsibleSubTableFacets.java 2011-08-15
12:41:51 UTC (rev 22631)
@@ -28,6 +28,7 @@
import java.net.URL;
+import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.waiting.selenium.SeleniumCondition;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.testng.annotations.Test;
@@ -55,12 +56,14 @@
return subtable.hasVisibleRows();
}
});
- // assertTrue(subtable.hasVisibleRows());
attributes.setShowData(false);
assertFalse(subtable.hasVisibleRows());
- assertTrue(subtable.isNoData());
-
+ JQueryLocator noDataFacet = pjq("table[id$=richDataTable] >
tbody.rf-cst:eq(0) > tr.rf-cst-nd > td.rf-cst-nd-c");
+ assertTrue(selenium.isElementPresent(noDataFacet));
+ assertTrue(selenium.isVisible(noDataFacet));
+ assertTrue(selenium.getText(noDataFacet).isEmpty());
+
facets.setNoData(SAMPLE_STRING);
attributes.setShowData(true);
@@ -70,6 +73,7 @@
assertFalse(subtable.hasVisibleRows());
assertTrue(subtable.isNoData());
+ assertEquals(selenium.getText(noDataFacet), SAMPLE_STRING);
}
@Test