Author: jjamrich
Date: 2011-09-23 09:27:58 -0400 (Fri, 23 Sep 2011)
New Revision: 22747
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/richList/AbstractListTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/ListAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/TestSimple.java
Log:
RFPL-1439: Update tests for rich:list 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:27:31 UTC (rev 22746)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java 2011-09-23
13:27:58 UTC (rev 22747)
@@ -23,6 +23,7 @@
import org.richfaces.tests.metamer.ftest.richEditor.EditorAttributes;
import org.richfaces.tests.metamer.ftest.richGraphValidator.GraphValidatorAttributes;
import org.richfaces.tests.metamer.ftest.richJQuery.RichJQueryAttributes;
+import org.richfaces.tests.metamer.ftest.richList.ListAttributes;
import org.richfaces.tests.metamer.ftest.richTooltip.TooltipAttributes;
public class AttributeList {
@@ -49,5 +50,6 @@
public static Attributes<EditorAttributes> editorAttributes = new
Attributes<EditorAttributes>();
public static Attributes<GraphValidatorAttributes> graphValidatorAttributes =
new Attributes<GraphValidatorAttributes>();
public static Attributes<RichJQueryAttributes> jQueryAttributes = new
Attributes<RichJQueryAttributes>();
+ public static Attributes<ListAttributes> listAttributes = new
Attributes<ListAttributes>();
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/AbstractListTest.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/AbstractListTest.java 2011-09-23
13:27:31 UTC (rev 22746)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/AbstractListTest.java 2011-09-23
13:27:58 UTC (rev 22747)
@@ -14,6 +14,7 @@
import static org.jboss.test.selenium.dom.Event.MOUSEUP;
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
import static org.testng.Assert.assertEquals;
+import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.listAttributes;
import java.util.List;
@@ -35,7 +36,6 @@
ELEMENTS_TOTAL + 1 };
ListModel list;
- ListAttributes attributes = new ListAttributes();
@Inject
@Use(empty = true)
@@ -59,7 +59,7 @@
@BeforeMethod(alwaysRun = true)
public void prepareAttributes() {
list = new ListModel(jq("*[id$=richList]"));
- attributes.setType(type);
+ listAttributes.set(ListAttributes.type, type);
list.setType(type);
if (rows == null) {
@@ -67,10 +67,10 @@
}
if (first != null) {
- attributes.setFirst(first);
+ listAttributes.set(ListAttributes.first, first);
}
if (rows != null) {
- attributes.setRows(rows);
+ listAttributes.set(ListAttributes.rows, rows);
}
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/ListAttributes.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/ListAttributes.java 2011-09-23
13:27:31 UTC (rev 22746)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/ListAttributes.java 2011-09-23
13:27:58 UTC (rev 22747)
@@ -21,70 +21,23 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.richList;
-import org.jboss.test.selenium.locator.ExtendedLocator;
-import org.jboss.test.selenium.locator.JQueryLocator;
-import org.richfaces.component.ListType;
-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 ListAttributes extends AbstractComponentAttributes {
+public enum ListAttributes implements AttributeEnum {
- public ListAttributes() {
- }
-
- public ListAttributes(ExtendedLocator<JQueryLocator> root) {
- super(root);
- }
-
- public void setFirst(int first) {
- setProperty("first", first);
- }
-
- public void setRendered(String rendered) {
- setProperty("rendered", rendered);
- }
-
- public void setRows(int rows) {
- setProperty("rows", rows);
- }
-
- public void setDir(String dir) {
- setProperty("dir", dir);
- }
-
- public void setFirst(Integer first) {
- setProperty("first", first);
- }
-
- public void setLang(String lang) {
- setProperty("lang", lang);
- }
-
- public void setRowClass(String rowClass) {
- setProperty("rowClass", rowClass);
- }
-
- public void setRows(Integer rows) {
- setProperty("rows", rows);
- }
-
- public void setStyle(String style) {
- setProperty("style", style);
- }
-
- public void setStyleClass(String styleClass) {
- setProperty("styleClass", styleClass);
- }
-
- public void setTitle(String title) {
- setProperty("title", title);
- }
-
- public void setType(ListType type) {
- setProperty("type", type);
- }
-
+ dir,
+ first,
+ lang,
+ rendered,
+ rows,
+ rowClass,
+ style,
+ styleClass,
+ title,
+ type
+
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/TestSimple.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/TestSimple.java 2011-09-23
13:27:31 UTC (rev 22746)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/TestSimple.java 2011-09-23
13:27:58 UTC (rev 22747)
@@ -24,6 +24,7 @@
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.testng.Assert.assertEquals;
import static org.richfaces.tests.metamer.ftest.BasicAttributes.rowClass;
+import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.listAttributes;
import java.net.URL;
@@ -43,7 +44,7 @@
@Test
public void testRenderedAttribute() {
- attributes.setRendered("false");
+ listAttributes.set(ListAttributes.rendered, "false");
assertEquals(list.isRendered(), false);
}