Author: jjamrich
Date: 2011-09-05 04:51:54 -0400 (Mon, 05 Sep 2011)
New Revision: 22683
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/RepeatAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/TestSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java
Log:
RFPL-1439: update a4j:repeat tests to use unified way to setting attributes
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/RepeatAttributes.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/RepeatAttributes.java 2011-09-05
08:51:24 UTC (rev 22682)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/RepeatAttributes.java 2011-09-05
08:51:54 UTC (rev 22683)
@@ -21,32 +21,16 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.a4jRepeat;
-import org.jboss.test.selenium.locator.JQueryLocator;
-import org.jboss.test.selenium.locator.ExtendedLocator;
-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 RepeatAttributes extends AbstractComponentAttributes {
+public enum RepeatAttributes implements AttributeEnum {
- public RepeatAttributes() {
- }
+ first,
+ rendered,
+ rows
- public RepeatAttributes(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);
- }
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/TestSimple.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/TestSimple.java 2011-09-05
08:51:24 UTC (rev 22682)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/TestSimple.java 2011-09-05
08:51:54 UTC (rev 22683)
@@ -25,6 +25,7 @@
import static java.lang.Math.min;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.testng.Assert.assertEquals;
+import static
org.richfaces.tests.metamer.ftest.attributes.AttributeList.repeatAttributes;
import java.net.URL;
@@ -44,7 +45,6 @@
protected static final int ELEMENTS_TOTAL = 20;
SimpleModel model;
- RepeatAttributes attributes = new RepeatAttributes();
@Inject
@Use(empty = false)
@@ -68,16 +68,16 @@
model = new SimpleModel();
if (first != null) {
- attributes.setFirst(first);
+ repeatAttributes.set(RepeatAttributes.first, first);
}
if (rows != null) {
- attributes.setRows(rows);
+ repeatAttributes.set(RepeatAttributes.rows, rows);
}
}
@Test
public void testRenderedAttribute() {
- attributes.setRendered("false");
+ repeatAttributes.set(RepeatAttributes.rendered, "false");
assertEquals(model.isRendered(), false);
}
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-05
08:51:24 UTC (rev 22682)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java 2011-09-05
08:51:54 UTC (rev 22683)
@@ -3,6 +3,7 @@
import org.richfaces.tests.metamer.ftest.a4jAttachQueue.AttachQueueAttributes;
import org.richfaces.tests.metamer.ftest.a4jPoll.PollAttributes;
import org.richfaces.tests.metamer.ftest.a4jQueue.QueueAttributes;
+import org.richfaces.tests.metamer.ftest.a4jRepeat.RepeatAttributes;
import org.richfaces.tests.metamer.ftest.richTooltip.TooltipAttributes;
import static org.richfaces.tests.metamer.ftest.AbstractMetamerTest.pjq;
@@ -13,5 +14,6 @@
public static Attributes<AttachQueueAttributes> attachQueueAttrs2 = new
Attributes<AttachQueueAttributes>(pjq("table.attributes[id$=attributes2]"));
public static Attributes<QueueAttributes> queueAttributes = new
Attributes<QueueAttributes>(pjq("table.attributes[id$=queueAttributes]"));
public static Attributes<PollAttributes> pollAttributes = new
Attributes<PollAttributes>();
+ public static Attributes<RepeatAttributes> repeatAttributes = new
Attributes<RepeatAttributes>();
}
Show replies by date