Author: jjamrich
Date: 2011-09-23 09:30:07 -0400 (Fri, 23 Sep 2011)
New Revision: 22751
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/richPanelMenuItem/PanelMenuItemAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemClientSideHandlers.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemDOMEventHandlers.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemMode.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemSimple.java
Log:
RFPL-1439: Update PanelMenuItem tests to use inified 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:29:35 UTC (rev 22750)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java 2011-09-23
13:30:07 UTC (rev 22751)
@@ -27,6 +27,7 @@
import org.richfaces.tests.metamer.ftest.richMessage.MessageAttributes;
import org.richfaces.tests.metamer.ftest.richPanelMenu.PanelMenuAttributes;
import org.richfaces.tests.metamer.ftest.richPanelMenuGroup.PanelMenuGroupAttributes;
+import org.richfaces.tests.metamer.ftest.richPanelMenuItem.PanelMenuItemAttributes;
import org.richfaces.tests.metamer.ftest.richTooltip.TooltipAttributes;
public class AttributeList {
@@ -57,5 +58,6 @@
public static Attributes<MessageAttributes> messageAttributes = new
Attributes<MessageAttributes>();
public static Attributes<PanelMenuAttributes> panelMenuAttributes = new
Attributes<PanelMenuAttributes>();
public static Attributes<PanelMenuGroupAttributes> panelMenuGroupAttributes =
new Attributes<PanelMenuGroupAttributes>();
+ public static Attributes<PanelMenuItemAttributes> panelMenuItemAttributes = new
Attributes<PanelMenuItemAttributes>();
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/PanelMenuItemAttributes.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/PanelMenuItemAttributes.java 2011-09-23
13:29:35 UTC (rev 22750)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/PanelMenuItemAttributes.java 2011-09-23
13:30:07 UTC (rev 22751)
@@ -21,95 +21,34 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.richPanelMenuItem;
-import org.richfaces.PanelMenuMode;
-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 PanelMenuItemAttributes extends AbstractComponentAttributes {
- public void setBypassUpdates(Boolean bypassUpdates) {
- setProperty("bypassUpdates", bypassUpdates);
- }
-
- public void setData(String data) {
- setProperty("data", data);
- }
-
- public void setDisabled(Boolean disabled) {
- setProperty("disabled", disabled);
- }
-
- public void setDisabledClass(String disabledClass) {
- setProperty("disabledClass", disabledClass);
- }
-
- public void setExecute(String execute) {
- setProperty("execute", execute);
- }
-
- public void setImmediate(Boolean immediate) {
- setProperty("immediate", immediate);
- }
-
- public void setLeftDisabledIcon(String leftDisabledIcon) {
- setProperty("leftDisabledIcon", leftDisabledIcon);
- }
-
- public void setLeftIcon(String leftIcon) {
- setProperty("leftIcon", leftIcon);
- }
-
- public void setLeftIconClass(String leftIconClass) {
- setProperty("leftIconClass", leftIconClass);
- }
-
- public void setLimitRender(Boolean limitRender) {
- setProperty("limitRender", limitRender);
- }
-
- public void setMode(PanelMenuMode mode) {
- setProperty("mode", mode);
- }
-
- public PanelMenuMode getMode() {
- return PanelMenuMode.valueOf(getProperty("mode"));
- }
-
- public void setRender(String render) {
- setProperty("render", render);
- }
-
- public void setRendered(Boolean rendered) {
- setProperty("rendered", rendered);
- }
-
- public void setRightDisabledIcon(String rightDisabledIcon) {
- setProperty("rightDisabledIcon", rightDisabledIcon);
- }
-
- public void setRightIcon(String rightIcon) {
- setProperty("rightIcon", rightIcon);
- }
-
- public void setRightIconClass(String rightIconClass) {
- setProperty("rightIconClass", rightIconClass);
- }
-
- public void setSelectable(Boolean selectable) {
- setProperty("selectable", selectable);
- }
-
- public void setStatus(String status) {
- setProperty("status", status);
- }
-
- public void setStyle(String style) {
- setProperty("style", style);
- }
-
- public void setStyleClass(String styleClass) {
- setProperty("styleClass", styleClass);
- }
+public enum PanelMenuItemAttributes implements AttributeEnum {
+
+ bypassUpdates,
+ data,
+ disabled,
+ disabledClass,
+ execute,
+ immediate,
+ leftDisabledIcon,
+ leftIcon,
+ leftIconClass,
+ limitRender,
+ mode,
+ oncomplete,
+ render,
+ rendered,
+ rightDisabledIcon,
+ rightIcon,
+ rightIconClass,
+ selectable,
+ status,
+ style,
+ styleClass,
+
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemClientSideHandlers.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemClientSideHandlers.java 2011-09-23
13:29:35 UTC (rev 22750)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemClientSideHandlers.java 2011-09-23
13:30:07 UTC (rev 22751)
@@ -25,6 +25,8 @@
import static org.richfaces.PanelMenuMode.ajax;
import static org.richfaces.PanelMenuMode.client;
import static org.richfaces.PanelMenuMode.server;
+import static
org.richfaces.tests.metamer.ftest.attributes.AttributeList.panelMenuItemAttributes;
+import static
org.richfaces.tests.metamer.ftest.richPanelMenuItem.PanelMenuItemAttributes.mode;
import java.net.URL;
@@ -43,7 +45,6 @@
@RegressionTest("https://issues.jboss.org/browse/RF-10486")
public class TestPanelMenuItemClientSideHandlers extends AbstractMetamerTest {
- PanelMenuItemAttributes attributes = new PanelMenuItemAttributes();
PanelMenu menu = new PanelMenu(pjq("div.rf-pm[id$=panelMenu]"));
PanelMenu.Item item = menu.getGroup(1).getItem(2);
@@ -62,7 +63,7 @@
@Test
@Use(field = "event", value = "ajaxEvents")
public void testClientSideEvent() {
- attributes.setMode(ajax);
+ panelMenuItemAttributes.set(mode, ajax);
menu.setItemMode(ajax);
super.testRequestEventsBefore(event);
item.select();
@@ -71,7 +72,7 @@
@Test
public void testClientSideEventsOrderClient() {
- attributes.setMode(client);
+ panelMenuItemAttributes.set(mode, client);
menu.setItemMode(client);
super.testRequestEventsBefore(clientEvents);
item.select();
@@ -80,7 +81,7 @@
@Test
public void testClientSideEventsOrderAjax() {
- attributes.setMode(ajax);
+ panelMenuItemAttributes.set(mode, ajax);
menu.setItemMode(ajax);
super.testRequestEventsBefore(ajaxEvents);
item.select();
@@ -90,7 +91,7 @@
@Test
@IssueTracking("https://issues.jboss.org/browse/RF-10844")
public void testClientSideEventsOrderServer() {
- attributes.setMode(server);
+ panelMenuItemAttributes.set(mode, server);
menu.setItemMode(server);
super.testRequestEventsBefore(serverEvents);
item.select();
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemDOMEventHandlers.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemDOMEventHandlers.java 2011-09-23
13:29:35 UTC (rev 22750)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemDOMEventHandlers.java 2011-09-23
13:30:07 UTC (rev 22751)
@@ -21,8 +21,16 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.richPanelMenuItem;
+import static org.jboss.test.selenium.dom.Event.CLICK;
+import static org.jboss.test.selenium.dom.Event.DBLCLICK;
+import static org.jboss.test.selenium.dom.Event.MOUSEDOWN;
+import static org.jboss.test.selenium.dom.Event.MOUSEMOVE;
+import static org.jboss.test.selenium.dom.Event.MOUSEOUT;
+import static org.jboss.test.selenium.dom.Event.MOUSEOVER;
+import static org.jboss.test.selenium.dom.Event.MOUSEUP;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
-import static org.jboss.test.selenium.dom.Event.*;
+import static
org.richfaces.tests.metamer.ftest.attributes.AttributeList.panelMenuItemAttributes;
+import static
org.richfaces.tests.metamer.ftest.richPanelMenuItem.PanelMenuItemAttributes.mode;
import java.net.URL;
@@ -40,7 +48,6 @@
*/
public class TestPanelMenuItemDOMEventHandlers extends AbstractMetamerTest {
- PanelMenuItemAttributes attributes = new PanelMenuItemAttributes();
PanelMenu menu = new PanelMenu(pjq("div.rf-pm[id$=panelMenu]"));
PanelMenu.Item item = menu.getGroup(1).getItem(2);
@@ -56,7 +63,7 @@
@Test
public void testDOMEventHandler() {
- attributes.setMode(PanelMenuMode.client);
+ panelMenuItemAttributes.set(mode, PanelMenuMode.client);
super.testFireEvent(event, item);
}
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemMode.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemMode.java 2011-09-23
13:29:35 UTC (rev 22750)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemMode.java 2011-09-23
13:30:07 UTC (rev 22751)
@@ -28,6 +28,7 @@
import static javax.faces.event.PhaseId.RESTORE_VIEW;
import static javax.faces.event.PhaseId.UPDATE_MODEL_VALUES;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static
org.richfaces.tests.metamer.ftest.attributes.AttributeList.panelMenuItemAttributes;
import java.net.URL;
import java.util.LinkedList;
@@ -47,7 +48,6 @@
*/
public class TestPanelMenuItemMode extends AbstractMetamerTest {
- PanelMenuItemAttributes attributes = new PanelMenuItemAttributes();
PanelMenu menu = new PanelMenu(pjq("div.rf-pm[id$=panelMenu]"));
PanelMenu.Item item = menu.getGroup(1).getItem(2);
@@ -76,12 +76,12 @@
@Test
public void testMode() {
- attributes.setImmediate(immediate);
- attributes.setBypassUpdates(bypassUpdates);
- attributes.setMode(mode);
+ panelMenuItemAttributes.set(PanelMenuItemAttributes.immediate, immediate);
+ panelMenuItemAttributes.set(PanelMenuItemAttributes.bypassUpdates,
bypassUpdates);
+ panelMenuItemAttributes.set(PanelMenuItemAttributes.mode, mode);
menu.setItemMode(mode);
- attributes.setExecute("@this executeChecker");
+ panelMenuItemAttributes.set(PanelMenuItemAttributes.execute, "@this
executeChecker");
item.select();
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemSimple.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemSimple.java 2011-09-23
13:29:35 UTC (rev 22750)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemSimple.java 2011-09-23
13:30:07 UTC (rev 22751)
@@ -5,6 +5,16 @@
import static org.richfaces.tests.metamer.ftest.BasicAttributes.disabledClass;
import static org.richfaces.tests.metamer.ftest.BasicAttributes.leftIconClass;
import static org.richfaces.tests.metamer.ftest.BasicAttributes.rightIconClass;
+import static
org.richfaces.tests.metamer.ftest.attributes.AttributeList.panelMenuItemAttributes;
+import static
org.richfaces.tests.metamer.ftest.richPanelMenuItem.PanelMenuItemAttributes.data;
+import static
org.richfaces.tests.metamer.ftest.richPanelMenuItem.PanelMenuItemAttributes.disabled;
+import static
org.richfaces.tests.metamer.ftest.richPanelMenuItem.PanelMenuItemAttributes.limitRender;
+import static
org.richfaces.tests.metamer.ftest.richPanelMenuItem.PanelMenuItemAttributes.mode;
+import static
org.richfaces.tests.metamer.ftest.richPanelMenuItem.PanelMenuItemAttributes.oncomplete;
+import static
org.richfaces.tests.metamer.ftest.richPanelMenuItem.PanelMenuItemAttributes.render;
+import static
org.richfaces.tests.metamer.ftest.richPanelMenuItem.PanelMenuItemAttributes.rendered;
+import static
org.richfaces.tests.metamer.ftest.richPanelMenuItem.PanelMenuItemAttributes.selectable;
+import static
org.richfaces.tests.metamer.ftest.richPanelMenuItem.PanelMenuItemAttributes.status;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
@@ -33,7 +43,6 @@
private static String chevronDown = "chevronDown";
private static String chevronDownClass = "rf-ico-chevron-down";
- PanelMenuItemAttributes attributes = new PanelMenuItemAttributes();
PanelMenu menu = new PanelMenu(pjq("div.rf-pm[id$=panelMenu]"));
PanelMenu.Item item = menu.getGroup(1).getItemContains("Item 1.2");
PanelMenu.Icon leftIcon = item.getLeftIcon();
@@ -46,14 +55,14 @@
@BeforeMethod
public void setupMode() {
- attributes.setMode(PanelMenuMode.ajax);
+ panelMenuItemAttributes.set(mode, PanelMenuMode.ajax);
menu.setItemMode(PanelMenuMode.ajax);
}
@Test
public void testData() {
- attributes.setData("RichFaces 4");
- attributes.setOncomplete("data = event.data");
+ panelMenuItemAttributes.set(data, "RichFaces 4");
+ panelMenuItemAttributes.set(oncomplete, "data = event.data");
retrieveRequestTime.initializeValue();
item.select();
@@ -67,7 +76,7 @@
menu.setItemMode(null);
assertFalse(item.isDisabled());
- attributes.setDisabled(true);
+ panelMenuItemAttributes.set(disabled, true);
assertFalse(item.isSelected());
assertTrue(item.isDisabled());
@@ -84,13 +93,13 @@
@Test
public void testDisabledClass() {
- attributes.setDisabled(true);
+ panelMenuItemAttributes.set(disabled, true);
super.testStyleClass(item, disabledClass);
}
@Test
public void testLeftDisabledIcon() {
- attributes.setDisabled(true);
+ panelMenuItemAttributes.set(disabled, true);
JQueryLocator input = pjq("select[id$=leftDisabledIcon]");
ElementLocator<JQueryLocator> icon = leftIcon.getIcon();
ElementLocator<JQueryLocator> image =
jq(leftIcon.getIcon().getRawLocator()).getChild(jq("img"));
@@ -104,7 +113,7 @@
ElementLocator<JQueryLocator> image =
jq(leftIcon.getIcon().getRawLocator()).getChild(jq("img"));
verifyStandardIcons(input, icon, image, "");
- attributes.setDisabled(true);
+ panelMenuItemAttributes.set(disabled, true);
assertTrue(leftIcon.isTransparent());
}
@@ -115,8 +124,8 @@
@Test
public void testLimitRender() {
- attributes.setRender("renderChecker");
- attributes.setLimitRender(true);
+ panelMenuItemAttributes.set(render, "renderChecker");
+ panelMenuItemAttributes.set(limitRender, true);
retrieveRequestTime.initializeValue();
retrieveRenderChecker.initializeValue();
@@ -129,14 +138,14 @@
public void testRendered() {
assertTrue(item.isVisible());
- attributes.setRendered(false);
+ panelMenuItemAttributes.set(rendered, false);
assertFalse(item.isVisible());
}
@Test
public void testRightDisabledIcon() {
- attributes.setDisabled(true);
+ panelMenuItemAttributes.set(disabled, true);
JQueryLocator input = pjq("select[id$=rightDisabledIcon]");
ElementLocator<JQueryLocator> icon = rightIcon.getIcon();
ElementLocator<JQueryLocator> image =
jq(rightIcon.getIcon().getRawLocator()).getChild(jq("img"));
@@ -151,7 +160,7 @@
ElementLocator<JQueryLocator> image =
jq(rightIcon.getIcon().getRawLocator()).getChild(jq("img"));
verifyStandardIcons(input, icon, image, "");
- attributes.setDisabled(true);
+ panelMenuItemAttributes.set(disabled, true);
assertTrue(rightIcon.isTransparent());
}
@@ -164,7 +173,7 @@
@Test
public void testSelectable() {
menu.setItemMode(null);
- attributes.setSelectable(false);
+ panelMenuItemAttributes.set(selectable, false);
new GuardRequest(RequestType.NONE) {
public void command() {
@@ -174,7 +183,7 @@
assertFalse(item.isSelected());
- attributes.setSelectable(true);
+ panelMenuItemAttributes.set(selectable, true);
new GuardRequest(RequestType.XHR) {
public void command() {
@@ -187,7 +196,7 @@
@Test
public void testStatus() {
- attributes.setStatus("statusChecker");
+ panelMenuItemAttributes.set(status, "statusChecker");
retrieveStatusChecker.initializeValue();
item.select();