Author: jjamrich
Date: 2011-09-23 09:24:06 -0400 (Fri, 23 Sep 2011)
New Revision: 22738
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnModelTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnSortingTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/ColumnAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/TestColumnSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumnGroup/TestColumnGroupHeaderFooter.java
Log:
RFPL-1439: Update CollapsibleSubTableToggler tests to use unified way to setting
attributes
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java 2011-09-23
13:23:37 UTC (rev 22737)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java 2011-09-23
13:24:06 UTC (rev 22738)
@@ -13,6 +13,7 @@
import org.richfaces.tests.metamer.ftest.abstractions.DataTableFacets;
import org.richfaces.tests.metamer.ftest.richAutocomplete.AutocompleteAttributes;
import
org.richfaces.tests.metamer.ftest.richCollapsibleSubTableToggler.CollapsibleSubTableTogglerAttributes;
+import org.richfaces.tests.metamer.ftest.richColumn.ColumnAttributes;
import org.richfaces.tests.metamer.ftest.richTooltip.TooltipAttributes;
public class AttributeList {
@@ -30,5 +31,6 @@
public static Attributes<AutocompleteAttributes> autocompleteAttributes = new
Attributes<AutocompleteAttributes>();
public static Attributes<CollapsibleSubTableTogglerAttributes>
collapsibleSubTableTogglerAttributes =
new Attributes<CollapsibleSubTableTogglerAttributes>();
+ public static Attributes<ColumnAttributes> columnAttributes = new
Attributes<ColumnAttributes>();
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnModelTest.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnModelTest.java 2011-09-23
13:23:37 UTC (rev 22737)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnModelTest.java 2011-09-23
13:24:06 UTC (rev 22738)
@@ -34,7 +34,6 @@
*/
public abstract class AbstractColumnModelTest extends AbstractMetamerTest {
- protected ColumnAttributes attributes = new ColumnAttributes();
protected ColumnModel model = new ColumnModel("richDataTable",
pjq("table.rf-dt[id$=richDataTable]"));
List<Capital> capitals;
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnSortingTest.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnSortingTest.java 2011-09-23
13:23:37 UTC (rev 22737)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnSortingTest.java 2011-09-23
13:24:06 UTC (rev 22738)
@@ -22,6 +22,7 @@
package org.richfaces.tests.metamer.ftest.richColumn;
import static org.testng.Assert.assertEquals;
+import static
org.richfaces.tests.metamer.ftest.attributes.AttributeList.columnAttributes;
import java.util.Collections;
@@ -43,8 +44,8 @@
SortOrder sortOrder;
public void testSortingWithSortOrder() {
- attributes.setRequestType(RequestType.XHR);
- attributes.setSortOrder(sortOrder);
+ columnAttributes.set(ColumnAttributes.requestType, RequestType.XHR);
+ columnAttributes.set(ColumnAttributes.sortOrder, sortOrder);
switch (sortOrder) {
case ascending:
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/ColumnAttributes.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/ColumnAttributes.java 2011-09-23
13:23:37 UTC (rev 22737)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/ColumnAttributes.java 2011-09-23
13:24:06 UTC (rev 22738)
@@ -21,31 +21,19 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.richColumn;
-import org.richfaces.component.SortOrder;
-import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
+import org.richfaces.tests.metamer.ftest.attributes.AttributeEnum;
/**
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
*/
-public class ColumnAttributes extends AbstractComponentAttributes {
- public void setBreakRowBefore(Boolean breakRowBefore) {
- setProperty("breakRowBefore", breakRowBefore);
- }
+public enum ColumnAttributes implements AttributeEnum {
+
+ breakRowBefore,
+ colspan,
+ rendered,
+ requestType,
+ rowspan,
+ sortOrder
- public void setColspan(Integer colspan) {
- setProperty("colspan", colspan);
- }
-
- public void setRendered(Boolean rendered) {
- setProperty("rendered", rendered);
- }
-
- public void setRowspan(Integer rowspan) {
- setProperty("rowspan", rowspan);
- }
-
- public void setSortOrder(SortOrder sortOrder) {
- setProperty("sortOrder", sortOrder);
- }
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/TestColumnSimple.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/TestColumnSimple.java 2011-09-23
13:23:37 UTC (rev 22737)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/TestColumnSimple.java 2011-09-23
13:24:06 UTC (rev 22738)
@@ -25,6 +25,8 @@
import static org.jboss.test.selenium.locator.Attribute.ROWSPAN;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.testng.Assert.assertEquals;
+import static
org.richfaces.tests.metamer.ftest.attributes.AttributeList.columnAttributes;
+import static org.richfaces.tests.metamer.ftest.richColumn.ColumnAttributes.*;
import java.net.URL;
@@ -57,7 +59,7 @@
@Test
public void testBreakRowBefore() {
- attributes.setBreakRowBefore(false);
+ columnAttributes.set(breakRowBefore, false);
assertEquals(headerCount(1), 3);
assertEquals(headerCount(2), 1);
@@ -69,7 +71,7 @@
@Test
public void testColspan() {
- attributes.setColspan(1);
+ columnAttributes.set(colspan, 1);
assertEquals(headerCount(1), 1);
assertEquals(headerCount(2), 2);
@@ -82,7 +84,7 @@
@Test
public void testRowspanTo1() {
- attributes.setRowspan(1);
+ columnAttributes.set(rowspan, 1);
assertEquals(headerCount(1), 1);
assertEquals(headerCount(2), 2);
@@ -94,7 +96,7 @@
@Test
public void testRowspanTo3() {
- attributes.setRowspan(3);
+ columnAttributes.set(rowspan, 3);
assertEquals(headerCount(1), 1);
assertEquals(headerCount(2), 2);
@@ -107,7 +109,7 @@
@Test
public void testRendered() {
- attributes.setRendered(false);
+ columnAttributes.set(rendered, false);
assertEquals(headerCount(1), 1);
assertEquals(headerCount(2), 2);
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumnGroup/TestColumnGroupHeaderFooter.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumnGroup/TestColumnGroupHeaderFooter.java 2011-09-23
13:23:37 UTC (rev 22737)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumnGroup/TestColumnGroupHeaderFooter.java 2011-09-23
13:24:06 UTC (rev 22738)
@@ -25,6 +25,8 @@
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
+import static
org.richfaces.tests.metamer.ftest.attributes.AttributeList.columnAttributes;
+import static org.richfaces.tests.metamer.ftest.richColumn.ColumnAttributes.rendered;
import java.net.URL;
@@ -59,7 +61,7 @@
assertEquals(model.getFooterRowCellCount(3), 1);
assertEquals(selenium.getAttribute(model.getFooterCell(2,
1).getAttribute(ROWSPAN)), "2");
- attributes.setRendered(false);
+ columnAttributes.set(rendered, false);
assertEquals(model.getBodyRowCount(), bodyRowCount);
assertEquals(model.getHeaderRowCount(), 0);