Author: jjamrich
Date: 2011-09-05 04:51:24 -0400 (Mon, 05 Sep 2011)
New Revision: 22682
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRegion/TestRegionSimple.java
Log:
RFPL-1439: update a4j:region tests to use unified way to setting attributes
Since there is only one attribute set, and legacy solution was inner class with
AbstractComponentAttributes implemetation, only switch to enum was done.
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRegion/TestRegionSimple.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRegion/TestRegionSimple.java 2011-09-05
08:51:01 UTC (rev 22681)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRegion/TestRegionSimple.java 2011-09-05
08:51:24 UTC (rev 22682)
@@ -32,6 +32,8 @@
import org.jboss.test.selenium.waiting.retrievers.TextRetriever;
import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.attributes.AttributeEnum;
+import org.richfaces.tests.metamer.ftest.attributes.Attributes;
import org.testng.annotations.Test;
/**
@@ -40,7 +42,7 @@
*/
public class TestRegionSimple extends AbstractMetamerTest {
- RegionAttributes attributes = new RegionAttributes();
+ Attributes<RegionAttributes> attributes = new
Attributes<RegionAttributes>();
JQueryLocator nameInput = pjq("input:text[id$=user2NameInput]");
JQueryLocator emailInput = pjq("input:text[id$=user2EmailInput]");
@@ -80,7 +82,7 @@
assertTrue(selenium.isElementPresent(nameOutput));
assertTrue(selenium.isElementPresent(emailOutput));
- attributes.setRendered(false);
+ attributes.set(RegionAttributes.rendered, false);
assertFalse(selenium.isElementPresent(nameInput));
assertFalse(selenium.isElementPresent(emailInput));
@@ -88,9 +90,7 @@
assertTrue(selenium.isElementPresent(emailOutput));
}
- private class RegionAttributes extends AbstractComponentAttributes {
- public void setRendered(Boolean rendered) {
- setProperty("rendered", rendered);
- }
+ private enum RegionAttributes implements AttributeEnum {
+ rendered
}
}
Show replies by date