JBoss Rich Faces SVN: r22750 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richPanelMenuGroup and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-09-23 09:29:35 -0400 (Fri, 23 Sep 2011)
New Revision: 22750
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/richPanelMenuGroup/AbstractPanelMenuGroupTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/PanelMenuGroupAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupDOMEventHandlers.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupMode.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupSimple.java
Log:
RFPL-1439: Update PanelMenuGroup tests to using 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:29:03 UTC (rev 22749)
+++ 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)
@@ -26,6 +26,7 @@
import org.richfaces.tests.metamer.ftest.richList.ListAttributes;
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.richTooltip.TooltipAttributes;
public class AttributeList {
@@ -55,5 +56,6 @@
public static Attributes<ListAttributes> listAttributes = new Attributes<ListAttributes>();
public static Attributes<MessageAttributes> messageAttributes = new Attributes<MessageAttributes>();
public static Attributes<PanelMenuAttributes> panelMenuAttributes = new Attributes<PanelMenuAttributes>();
+ public static Attributes<PanelMenuGroupAttributes> panelMenuGroupAttributes = new Attributes<PanelMenuGroupAttributes>();
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/AbstractPanelMenuGroupTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/AbstractPanelMenuGroupTest.java 2011-09-23 13:29:03 UTC (rev 22749)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/AbstractPanelMenuGroupTest.java 2011-09-23 13:29:35 UTC (rev 22750)
@@ -23,6 +23,8 @@
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.richfaces.PanelMenuMode.ajax;
+import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.panelMenuGroupAttributes;
+import static org.richfaces.tests.metamer.ftest.richPanelMenuGroup.PanelMenuGroupAttributes.mode;
import java.net.URL;
@@ -36,7 +38,6 @@
*/
public abstract class AbstractPanelMenuGroupTest extends AbstractMetamerTest {
- PanelMenuGroupAttributes attributes = new PanelMenuGroupAttributes();
PanelMenu menu = new PanelMenu(pjq("div.rf-pm[id$=panelMenu]"));
PanelMenu.Group topGroup = menu.getGroupContains("Group 2");
PanelMenu.Group subGroup = topGroup.getGroupContains("Group 2.3");
@@ -50,7 +51,7 @@
@BeforeMethod
public void setupModes() {
- attributes.setMode(ajax);
+ panelMenuGroupAttributes.set(mode, ajax);
menu.setGroupMode(ajax);
}
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/PanelMenuGroupAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/PanelMenuGroupAttributes.java 2011-09-23 13:29:03 UTC (rev 22749)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/PanelMenuGroupAttributes.java 2011-09-23 13:29:35 UTC (rev 22750)
@@ -21,107 +21,37 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.richPanelMenuGroup;
-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 PanelMenuGroupAttributes extends AbstractComponentAttributes {
- public void setBypassUpdates(Boolean bypassUpdates) {
- setProperty("bypassUpdates", bypassUpdates);
- }
-
- public void setCollapseEvent(String collapseEvent) {
- setProperty("collapseEvent", collapseEvent);
- }
-
- 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 setExpandEvent(String expandEvent) {
- setProperty("expandEvent", expandEvent);
- }
-
- public void setExpanded(Boolean expanded) {
- setProperty("expanded", expanded);
- }
-
- public void setImmediate(Boolean immediate) {
- setProperty("immediate", immediate);
- }
-
- public void setLeftCollapsedIcon(String leftCollapsedIcon) {
- setProperty("leftCollapsedIcon", leftCollapsedIcon);
- }
-
- public void setLeftDisabledIcon(String leftDisabledIcon) {
- setProperty("leftDisabledIcon", leftDisabledIcon);
- }
-
- public void setLeftExpandedIcon(String leftExpandedIcon) {
- setProperty("leftExpandedIcon", leftExpandedIcon);
- }
-
- public void setLimitRender(Boolean limitRender) {
- setProperty("limitRender", limitRender);
- }
-
- public void setMode(PanelMenuMode mode) {
- setProperty("mode", mode);
- }
+public enum PanelMenuGroupAttributes implements AttributeEnum {
- public PanelMenuMode getMode() {
- return PanelMenuMode.valueOf(getProperty("mode"));
- }
+ bypassUpdates,
+ collapseEvent,
+ data,
+ disabled,
+ disabledClass,
+ execute,
+ expandEvent,
+ expanded,
+ immediate,
+ leftCollapsedIcon,
+ leftDisabledIcon,
+ leftExpandedIcon,
+ limitRender,
+ mode,
+ oncomplete,
+ render,
+ rendered,
+ rightCollapsedIcon,
+ rightDisabledIcon,
+ rightExpandedIcon,
+ selectable,
+ status,
+ style,
+ styleClass
- public void setRender(String render) {
- setProperty("render", render);
- }
-
- public void setRendered(Boolean rendered) {
- setProperty("rendered", rendered);
- }
-
- public void setRightCollapsedIcon(String rightCollapsedIcon) {
- setProperty("rightCollapsedIcon", rightCollapsedIcon);
- }
-
- public void setRightDisabledIcon(String rightDisabledIcon) {
- setProperty("rightDisabledIcon", rightDisabledIcon);
- }
-
- public void setRightExpandedIcon(String rightExpandedIcon) {
- setProperty("rightExpandedIcon", rightExpandedIcon);
- }
-
- 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);
- }
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.java 2011-09-23 13:29:03 UTC (rev 22749)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.java 2011-09-23 13:29:35 UTC (rev 22750)
@@ -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.panelMenuGroupAttributes;
+import static org.richfaces.tests.metamer.ftest.richPanelMenuGroup.PanelMenuGroupAttributes.mode;
import java.net.URL;
@@ -65,7 +67,7 @@
@Test
@Use(field = "event", value = "ajaxCollapsionEvents")
public void testClientSideCollapsionEvent() {
- attributes.setMode(ajax);
+ panelMenuGroupAttributes.set(mode, ajax);
menu.setGroupMode(ajax);
super.testRequestEventsBefore(event);
topGroup.toggle();
@@ -75,7 +77,7 @@
@Test
@Use(field = "event", value = "ajaxExpansionEvents")
public void testClientSideExpansionEvent() {
- attributes.setMode(ajax);
+ panelMenuGroupAttributes.set(mode, ajax);
menu.setGroupMode(ajax);
topGroup.toggle();
super.testRequestEventsBefore(event);
@@ -85,7 +87,7 @@
@Test
public void testClientSideExpansionEventsOrderClient() {
- attributes.setMode(client);
+ panelMenuGroupAttributes.set(mode, client);
menu.setGroupMode(client);
super.testRequestEventsBefore(clientExpansionEvents);
topGroup.toggle();
@@ -98,7 +100,7 @@
@Test
@RegressionTest("https://issues.jboss.org/browse/RF-10564")
public void testClientSideCollapsionEventsOrderClient() {
- attributes.setMode(client);
+ panelMenuGroupAttributes.set(mode, client);
menu.setGroupMode(client);
topGroup.toggle();
super.testRequestEventsBefore(clientCollapsionEvents);
@@ -108,7 +110,7 @@
@Test
public void testClientSideExpansionEventsOrderAjax() {
- attributes.setMode(ajax);
+ panelMenuGroupAttributes.set(mode, ajax);
menu.setGroupMode(ajax);
topGroup.toggle();
super.testRequestEventsBefore(ajaxExpansionEvents);
@@ -119,7 +121,7 @@
@Test
public void testClientSideCollapsionEventsOrderAjax() {
- attributes.setMode(ajax);
+ panelMenuGroupAttributes.set(mode, ajax);
menu.setGroupMode(ajax);
super.testRequestEventsBefore(ajaxCollapsionEvents);
topGroup.toggle();
@@ -129,7 +131,7 @@
@Test
@Use(field = "event", value = "serverExpansionEvents")
public void testClientSideExpansionEventsServer() {
- attributes.setMode(server);
+ panelMenuGroupAttributes.set(mode, server);
menu.setGroupMode(server);
topGroup.toggle();
menu.setGroupMode(null);
@@ -141,7 +143,7 @@
@Test
@Use(field = "event", value = "serverCollapsionEvents")
public void testClientSideCollapsionEventsServer() {
- attributes.setMode(server);
+ panelMenuGroupAttributes.set(mode, server);
menu.setGroupMode(null);
testRequestEventsBeforeByAlert(event);
topGroup.toggle();
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupDOMEventHandlers.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupDOMEventHandlers.java 2011-09-23 13:29:03 UTC (rev 22749)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupDOMEventHandlers.java 2011-09-23 13:29:35 UTC (rev 22750)
@@ -28,9 +28,11 @@
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.richfaces.PanelMenuMode.client;
+import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.panelMenuGroupAttributes;
+import static org.richfaces.tests.metamer.ftest.richPanelMenuGroup.PanelMenuGroupAttributes.mode;
import org.jboss.test.selenium.dom.Event;
-import org.richfaces.PanelMenuMode;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
import org.richfaces.tests.metamer.ftest.annotations.Use;
import org.testng.annotations.Test;
@@ -48,7 +50,7 @@
@Test
public void testDOMEventHandler() {
- attributes.setMode(PanelMenuMode.client);
+ panelMenuGroupAttributes.set(mode, client);
super.testFireEvent(event, topGroup);
}
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupMode.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupMode.java 2011-09-23 13:29:03 UTC (rev 22749)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupMode.java 2011-09-23 13:29:35 UTC (rev 22750)
@@ -28,6 +28,7 @@
import static javax.faces.event.PhaseId.RESTORE_VIEW;
import static javax.faces.event.PhaseId.UPDATE_MODEL_VALUES;
import static org.testng.Assert.assertTrue;
+import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.panelMenuGroupAttributes;
import java.util.LinkedList;
@@ -66,12 +67,12 @@
@Test
public void testRequestMode() {
- attributes.setImmediate(immediate);
- attributes.setBypassUpdates(bypassUpdates);
- attributes.setMode(mode);
+ panelMenuGroupAttributes.set(PanelMenuGroupAttributes.immediate, immediate);
+ panelMenuGroupAttributes.set(PanelMenuGroupAttributes.bypassUpdates, bypassUpdates);
+ panelMenuGroupAttributes.set(PanelMenuGroupAttributes.mode, mode);
menu.setGroupMode(mode);
- attributes.setExecute("@this executeChecker");
+ panelMenuGroupAttributes.set(PanelMenuGroupAttributes.execute, "@this executeChecker");
assertTrue(topGroup.isExpanded());
topGroup.toggle();
@@ -95,7 +96,7 @@
@Uses({ @Use(field = "immediate", empty = true), @Use(field = "bypassUpdates", empty = true),
@Use(field = "mode", empty = true), @Use(field = "listener", empty = true) })
public void testClientMode() {
- attributes.setMode(PanelMenuMode.client);
+ panelMenuGroupAttributes.set(PanelMenuGroupAttributes.mode, PanelMenuMode.client);
menu.setGroupMode(PanelMenuMode.client);
assertTrue(topGroup.isExpanded());
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupSimple.java 2011-09-23 13:29:03 UTC (rev 22749)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupSimple.java 2011-09-23 13:29:35 UTC (rev 22750)
@@ -5,6 +5,8 @@
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
+import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.panelMenuGroupAttributes;
+import static org.richfaces.tests.metamer.ftest.richPanelMenuGroup.PanelMenuGroupAttributes.*;
import org.jboss.test.selenium.GuardRequest;
import org.jboss.test.selenium.locator.ElementLocator;
@@ -27,8 +29,8 @@
@Test
public void testData() {
- attributes.setData("RichFaces 4");
- attributes.setOncomplete("data = event.data");
+ panelMenuGroupAttributes.set(data, "RichFaces 4");
+ panelMenuGroupAttributes.set(oncomplete, "data = event.data");
retrieveRequestTime.initializeValue();
topGroup.toggle();
@@ -42,7 +44,7 @@
menu.setGroupMode(null);
assertFalse(topGroup.isDisabled());
- attributes.setDisabled(true);
+ panelMenuGroupAttributes.set(disabled, true);
assertFalse(topGroup.isSelected());
assertTrue(topGroup.isDisabled());
@@ -59,13 +61,13 @@
@Test
public void testDisabledClass() {
- attributes.setDisabled(true);
+ panelMenuGroupAttributes.set(disabled, true);
super.testStyleClass(topGroup, disabledClass);
}
@Test
public void testLeftDisabledIcon() {
- attributes.setDisabled(true);
+ panelMenuGroupAttributes.set(disabled, true);
JQueryLocator input = pjq("select[id$=lefttDisabledIcon]");
ElementLocator<JQueryLocator> icon = leftIcon.getIcon();
ElementLocator<JQueryLocator> image = jq(leftIcon.getIcon().getRawLocator()).getChild(jq("img"));
@@ -80,7 +82,7 @@
ElementLocator<JQueryLocator> image = jq(leftIcon.getIcon().getRawLocator()).getChild(jq("img"));
verifyStandardIcons(input, icon, image, "");
- attributes.setDisabled(true);
+ panelMenuGroupAttributes.set(disabled, true);
assertTrue(leftIcon.isTransparent());
}
@@ -91,14 +93,14 @@
ElementLocator<JQueryLocator> image = jq(leftIcon.getIcon().getRawLocator()).getChild(jq("img"));
verifyStandardIcons(input, icon, image, "");
- attributes.setDisabled(true);
+ panelMenuGroupAttributes.set(disabled, true);
assertTrue(rightIcon.isTransparent());
}
@Test
public void testLimitRender() {
- attributes.setRender("renderChecker");
- attributes.setLimitRender(true);
+ panelMenuGroupAttributes.set(render, "renderChecker");
+ panelMenuGroupAttributes.set(limitRender, true);
retrieveRequestTime.initializeValue();
retrieveRenderChecker.initializeValue();
@@ -111,14 +113,14 @@
public void testRendered() {
assertTrue(topGroup.isVisible());
- attributes.setRendered(false);
+ panelMenuGroupAttributes.set(rendered, false);
assertFalse(topGroup.isVisible());
}
@Test
public void testRightDisabledIcon() {
- attributes.setDisabled(true);
+ panelMenuGroupAttributes.set(disabled, true);
JQueryLocator input = pjq("select[id$=rightDisabledIcon]");
ElementLocator<JQueryLocator> icon = rightIcon.getIcon();
ElementLocator<JQueryLocator> image = jq(rightIcon.getIcon().getRawLocator()).getChild(jq("img"));
@@ -132,7 +134,7 @@
ElementLocator<JQueryLocator> image = jq(rightIcon.getIcon().getRawLocator()).getChild(jq("img"));
verifyStandardIcons(input, icon, image, "");
- attributes.setDisabled(true);
+ panelMenuGroupAttributes.set(disabled, true);
assertTrue(rightIcon.isTransparent());
}
@@ -144,7 +146,7 @@
ElementLocator<JQueryLocator> image = jq(rightIcon.getIcon().getRawLocator()).getChild(jq("img"));
verifyStandardIcons(input, icon, image, "");
- attributes.setDisabled(true);
+ panelMenuGroupAttributes.set(disabled, true);
assertTrue(rightIcon.isTransparent());
}
@@ -152,18 +154,18 @@
public void testSelectable() {
menu.setGroupMode(PanelMenuMode.ajax);
- attributes.setSelectable(false);
+ panelMenuGroupAttributes.set(selectable, false);
topGroup.toggle();
assertFalse(topGroup.isSelected());
- attributes.setSelectable(true);
+ panelMenuGroupAttributes.set(selectable, true);
topGroup.toggle();
assertTrue(topGroup.isSelected());
}
@Test
public void testStatus() {
- attributes.setStatus("statusChecker");
+ panelMenuGroupAttributes.set(status, "statusChecker");
retrieveStatusChecker.initializeValue();
topGroup.toggle();
13 years, 3 months
JBoss Rich Faces SVN: r22749 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: attributes and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-09-23 09:29:03 -0400 (Fri, 23 Sep 2011)
New Revision: 22749
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
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/richPanelMenu/AbstractPanelMenuTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/PanelMenuAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuDOMEvents.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuMode.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuSelection.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuSimple.java
Log:
RFPL-1439: Update panelMenu tests to use unified way to setting attributes
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2011-09-23 13:28:32 UTC (rev 22748)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2011-09-23 13:29:03 UTC (rev 22749)
@@ -68,6 +68,8 @@
import org.richfaces.tests.metamer.TemplatesList;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
import org.richfaces.tests.metamer.ftest.annotations.Templates;
+import org.richfaces.tests.metamer.ftest.attributes.AttributeEnum;
+import org.richfaces.tests.metamer.ftest.attributes.Attributes;
import org.testng.SkipException;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
@@ -264,7 +266,7 @@
* @param attribute
* name of the attribute that will be set (e.g. styleClass, headerClass, itemContentClass)
*/
- protected void testStyleClass(ExtendedLocator<JQueryLocator> element, BasicAttributes attribute) {
+ protected void testStyleClass(ExtendedLocator<JQueryLocator> element, BasicAttributes attribute) {
final String styleClass = "metamer-ftest-class";
basicAttributes.set(attribute, styleClass);
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:28:32 UTC (rev 22748)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java 2011-09-23 13:29:03 UTC (rev 22749)
@@ -25,6 +25,7 @@
import org.richfaces.tests.metamer.ftest.richJQuery.RichJQueryAttributes;
import org.richfaces.tests.metamer.ftest.richList.ListAttributes;
import org.richfaces.tests.metamer.ftest.richMessage.MessageAttributes;
+import org.richfaces.tests.metamer.ftest.richPanelMenu.PanelMenuAttributes;
import org.richfaces.tests.metamer.ftest.richTooltip.TooltipAttributes;
public class AttributeList {
@@ -53,5 +54,6 @@
public static Attributes<RichJQueryAttributes> jQueryAttributes = new Attributes<RichJQueryAttributes>();
public static Attributes<ListAttributes> listAttributes = new Attributes<ListAttributes>();
public static Attributes<MessageAttributes> messageAttributes = new Attributes<MessageAttributes>();
+ public static Attributes<PanelMenuAttributes> panelMenuAttributes = new Attributes<PanelMenuAttributes>();
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/AbstractPanelMenuTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/AbstractPanelMenuTest.java 2011-09-23 13:28:32 UTC (rev 22748)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/AbstractPanelMenuTest.java 2011-09-23 13:29:03 UTC (rev 22749)
@@ -23,6 +23,9 @@
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.richfaces.PanelMenuMode.ajax;
+import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.panelMenuAttributes;
+import static org.richfaces.tests.metamer.ftest.richPanelMenu.PanelMenuAttributes.groupMode;
+import static org.richfaces.tests.metamer.ftest.richPanelMenu.PanelMenuAttributes.itemMode;
import java.net.URL;
@@ -36,7 +39,6 @@
*/
public class AbstractPanelMenuTest extends AbstractMetamerTest {
- PanelMenuAttributes attributes = new PanelMenuAttributes();
PanelMenu menu = new PanelMenu(pjq("div.rf-pm[id$=panelMenu]"));
PanelMenu.Item item3 = menu.getItemContains("Item 3");
PanelMenu.Item item4 = menu.getItemContains("Item 4");
@@ -56,8 +58,8 @@
@BeforeMethod
public void setupModes() {
- attributes.setItemMode(ajax);
- attributes.setGroupMode(ajax);
+ panelMenuAttributes.set(itemMode, ajax);
+ panelMenuAttributes.set(groupMode, ajax);
menu.setItemMode(ajax);
menu.setGroupMode(ajax);
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/PanelMenuAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/PanelMenuAttributes.java 2011-09-23 13:28:32 UTC (rev 22748)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/PanelMenuAttributes.java 2011-09-23 13:29:03 UTC (rev 22749)
@@ -21,167 +21,52 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.richPanelMenu;
-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 PanelMenuAttributes extends AbstractComponentAttributes {
- public void setBubbleSelection(Boolean bubbleSelection) {
- setProperty("bubbleSelection", bubbleSelection);
- }
+public enum PanelMenuAttributes implements AttributeEnum {
+
+ bubbleSelection,
+ collapseEvent,
+ disabled,
+ expandEvent,
+ expandSingle,
+ groupClass,
+ groupCollapsedLeftIcon,
+ groupCollapsedRightIcon,
+ groupDisabledClass,
+ groupDisabledLeftIcon,
+ groupDisabledRightIcon,
+ groupExpandedLeftIcon,
+ groupExpandedRightIcon,
+ groupMode,
+ itemClass,
+ itemDisabledClass,
+ itemDisabledLeftIcon,
+ itemDisabledRightIcon,
+ itemLeftIcon,
+ itemMode,
+ itemRightIcon,
+ rendered,
+ style,
+ styleClass,
+ topGroupClass,
+ topGroupCollapsedLeftIcon,
+ topGroupCollapsedRightIcon,
+ topGroupDisabledClass,
+ topGroupDisabledLeftIcon,
+ topGroupDisabledRightIcon,
+ topGroupExpandedLeftIcon,
+ topGroupExpandedRightIcon,
+ topItemClass,
+ topItemDisabledClass,
+ topItemDisabledLeftIcon,
+ topItemDisabledRightIcon,
+ topItemLeftIcon,
+ topItemRightIcon,
+ width,
- public void setCollapseEvent(String collapseEvent) {
- setProperty("collapseEvent", collapseEvent);
- }
-
- public void setDisabled(Boolean disabled) {
- setProperty("disabled", disabled);
- }
-
- public void setExpandEvent(String expandEvent) {
- setProperty("expandEvent", expandEvent);
- }
-
- public void setExpandSingle(Boolean expandSingle) {
- setProperty("expandSingle", expandSingle);
- }
-
- public void setGroupClass(String groupClass) {
- setProperty("groupClass", groupClass);
- }
-
- public void setGroupCollapsedLeftIcon(String groupCollapsedLeftIcon) {
- setProperty("groupCollapsedLeftIcon", groupCollapsedLeftIcon);
- }
-
- public void setGroupCollapsedRightIcon(String groupCollapsedRightIcon) {
- setProperty("groupCollapsedRightIcon", groupCollapsedRightIcon);
- }
-
- public void setGroupDisabledClass(String groupDisabledClass) {
- setProperty("groupDisabledClass", groupDisabledClass);
- }
-
- public void setGroupDisabledLeftIcon(String groupDisabledLeftIcon) {
- setProperty("groupDisabledLeftIcon", groupDisabledLeftIcon);
- }
-
- public void setGroupDisabledRightIcon(String groupDisabledRightIcon) {
- setProperty("groupDisabledRightIcon", groupDisabledRightIcon);
- }
-
- public void setGroupExpandedLeftIcon(String groupExpandedLeftIcon) {
- setProperty("groupExpandedLeftIcon", groupExpandedLeftIcon);
- }
-
- public void setGroupExpandedRightIcon(String groupExpandedRightIcon) {
- setProperty("groupExpandedRightIcon", groupExpandedRightIcon);
- }
-
- public void setGroupMode(PanelMenuMode groupMode) {
- setProperty("groupMode", groupMode);
- }
-
- public void setItemClass(String itemClass) {
- setProperty("itemClass", itemClass);
- }
-
- public void setItemDisabledClass(String itemDisabledClass) {
- setProperty("itemDisabledClass", itemDisabledClass);
- }
-
- public void setItemDisabledLeftIcon(String itemDisabledLeftIcon) {
- setProperty("itemDisabledLeftIcon", itemDisabledLeftIcon);
- }
-
- public void setItemDisabledRightIcon(String itemDisabledRightIcon) {
- setProperty("itemDisabledRightIcon", itemDisabledRightIcon);
- }
-
- public void setItemLeftIcon(String itemLeftIcon) {
- setProperty("itemLeftIcon", itemLeftIcon);
- }
-
- public void setItemMode(PanelMenuMode itemMode) {
- setProperty("itemMode", itemMode);
- }
-
- public void setItemRightIcon(String itemRightIcon) {
- setProperty("itemRightIcon", itemRightIcon);
- }
-
- public void setRendered(Boolean rendered) {
- setProperty("rendered", rendered);
- }
-
- public void setStyle(String style) {
- setProperty("style", style);
- }
-
- public void setStyleClass(String styleClass) {
- setProperty("styleClass", styleClass);
- }
-
- public void setTopGroupClass(String topGroupClass) {
- setProperty("topGroupClass", topGroupClass);
- }
-
- public void setTopGroupCollapsedLeftIcon(String topGroupCollapsedLeftIcon) {
- setProperty("topGroupCollapsedLeftIcon", topGroupCollapsedLeftIcon);
- }
-
- public void setTopGroupCollapsedRightIcon(String topGroupCollapsedRightIcon) {
- setProperty("topGroupCollapsedRightIcon", topGroupCollapsedRightIcon);
- }
-
- public void setTopGroupDisabledClass(String topGroupDisabledClass) {
- setProperty("topGroupDisabledClass", topGroupDisabledClass);
- }
-
- public void setTopGroupDisabledLeftIcon(String topGroupDisabledLeftIcon) {
- setProperty("topGroupDisabledLeftIcon", topGroupDisabledLeftIcon);
- }
-
- public void setTopGroupDisabledRightIcon(String topGroupDisabledRightIcon) {
- setProperty("topGroupDisabledRightIcon", topGroupDisabledRightIcon);
- }
-
- public void setTopGroupExpandedLeftIcon(String topGroupExpandedLeftIcon) {
- setProperty("topGroupExpandedLeftIcon", topGroupExpandedLeftIcon);
- }
-
- public void setTopGroupExpandedRightIcon(String topGroupExpandedRightIcon) {
- setProperty("topGroupExpandedRightIcon", topGroupExpandedRightIcon);
- }
-
- public void setTopItemClass(String topItemClass) {
- setProperty("topItemClass", topItemClass);
- }
-
- public void setTopItemDisabledClass(String topItemDisabledClass) {
- setProperty("topItemDisabledClass", topItemDisabledClass);
- }
-
- public void setTopItemDisabledLeftIcon(String topItemDisabledLeftIcon) {
- setProperty("topItemDisabledLeftIcon", topItemDisabledLeftIcon);
- }
-
- public void setTopItemDisabledRightIcon(String topItemDisabledRightIcon) {
- setProperty("topItemDisabledRightIcon", topItemDisabledRightIcon);
- }
-
- public void setTopItemLeftIcon(String topItemLeftIcon) {
- setProperty("topItemLeftIcon", topItemLeftIcon);
- }
-
- public void setTopItemRightIcon(String topItemRightIcon) {
- setProperty("topItemRightIcon", topItemRightIcon);
- }
-
- public void setWidth(String width) {
- setProperty("width", width);
- }
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuDOMEvents.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuDOMEvents.java 2011-09-23 13:28:32 UTC (rev 22748)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuDOMEvents.java 2011-09-23 13:29:03 UTC (rev 22749)
@@ -29,6 +29,10 @@
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.richfaces.tests.metamer.ftest.attributes.AttributeList.panelMenuAttributes;
+import static org.richfaces.tests.metamer.ftest.richPanelMenu.PanelMenuAttributes.collapseEvent;
+import static org.richfaces.tests.metamer.ftest.richPanelMenu.PanelMenuAttributes.expandEvent;
+import static org.richfaces.tests.metamer.ftest.richPanelMenu.PanelMenuAttributes.groupMode;
import static org.testng.Assert.assertTrue;
import java.net.URL;
@@ -79,7 +83,7 @@
public void setup() {
waitToggle = waitModel.timeout(5000).interval(500);
if (mode != null) {
- attributes.setGroupMode(mode);
+ panelMenuAttributes.set(groupMode, mode);
menu.setGroupMode(mode);
}
}
@@ -87,7 +91,7 @@
@Test
@Use(field = "mode", enumeration = true)
public void testExpandEvent() {
- attributes.setExpandEvent(event.getEventName());
+ panelMenuAttributes.set(expandEvent, event.getEventName());
assertTrue(group2.isCollapsed());
fireEventNatively(group2.getLabel(), event);
@@ -97,7 +101,7 @@
@Test
@Use(field = "mode", enumeration = true)
public void testCollapseEvent() {
- attributes.setCollapseEvent(event.getEventName());
+ panelMenuAttributes.set(collapseEvent, event.getEventName());
group2.toggle();
assertTrue(group2.isExpanded());
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuMode.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuMode.java 2011-09-23 13:28:32 UTC (rev 22748)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuMode.java 2011-09-23 13:29:03 UTC (rev 22749)
@@ -27,6 +27,9 @@
import static javax.faces.event.PhaseId.RENDER_RESPONSE;
import static javax.faces.event.PhaseId.RESTORE_VIEW;
import static javax.faces.event.PhaseId.UPDATE_MODEL_VALUES;
+import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.panelMenuAttributes;
+import static org.richfaces.tests.metamer.ftest.richPanelMenu.PanelMenuAttributes.groupMode;
+import static org.richfaces.tests.metamer.ftest.richPanelMenu.PanelMenuAttributes.itemMode;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
@@ -52,7 +55,7 @@
@Test
public void testGroupMode() {
- attributes.setGroupMode(mode);
+ panelMenuAttributes.set(groupMode, mode);
menu.setGroupMode(mode);
assertTrue(group1.isCollapsed());
@@ -74,7 +77,7 @@
@Test
public void testItemMode() {
- attributes.setItemMode(mode);
+ panelMenuAttributes.set(itemMode, mode);
menu.setItemMode(mode);
assertFalse(item3.isSelected());
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuSelection.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuSelection.java 2011-09-23 13:28:32 UTC (rev 22748)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuSelection.java 2011-09-23 13:29:03 UTC (rev 22749)
@@ -22,6 +22,7 @@
package org.richfaces.tests.metamer.ftest.richPanelMenu;
import static org.testng.Assert.assertEquals;
+import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.panelMenuAttributes;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
import org.richfaces.tests.metamer.ftest.annotations.Use;
@@ -39,7 +40,7 @@
@Test
public void testBubbleSelection() {
- attributes.setBubbleSelection(bubbleSelection);
+ panelMenuAttributes.set(PanelMenuAttributes.bubbleSelection, bubbleSelection);
assertEquals(getSelectedItems(), 0);
assertEquals(getSelectedGroups(), 0);
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuSimple.java 2011-09-23 13:28:32 UTC (rev 22748)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuSimple.java 2011-09-23 13:29:03 UTC (rev 22749)
@@ -25,9 +25,12 @@
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
import static org.richfaces.tests.metamer.ftest.BasicAttributes.*;
+import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.panelMenuAttributes;
+import static org.richfaces.tests.metamer.ftest.richPanelMenu.PanelMenuAttributes.*;
import org.jboss.test.selenium.css.CssProperty;
import org.richfaces.PanelMenuMode;
+import org.richfaces.tests.metamer.ftest.BasicAttributes;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.richfaces.tests.metamer.ftest.annotations.RegressionTest;
@@ -47,13 +50,13 @@
@Test
@RegressionTest("https://issues.jboss.org/browse/RF-10158")
public void testDisabled() {
- attributes.setGroupMode(PanelMenuMode.client);
- attributes.setDisabled(false);
+ panelMenuAttributes.set(groupMode, PanelMenuMode.client);
+ panelMenuAttributes.set(disabled, false);
assertEquals(selenium.getCount(menu.getAnyDisabledGroup()), 2);
assertEquals(selenium.getCount(menu.getAnyDisabledItem()), 3);
- attributes.setDisabled(true);
+ panelMenuAttributes.set(disabled, true);
assertEquals(selenium.getCount(menu.getAnyDisabledGroup()), 6);
assertEquals(selenium.getCount(menu.getAnyDisabledItem()), 24);
@@ -63,7 +66,7 @@
@Use(field = "expandSingle", booleans = { true, false })
@IssueTracking("https://issues.jboss.org/browse/RF-10626")
public void testExpandSingle() {
- attributes.setExpandSingle(expandSingle);
+ panelMenuAttributes.set(PanelMenuAttributes.expandSingle, expandSingle);
group2.toggle();
assertEquals(getExpandedGroupsCount(), expanded(1));
@@ -74,33 +77,33 @@
@Test
public void testGroupClass() {
- attributes.setGroupMode(PanelMenuMode.client);
- super.testStyleClass(group24, groupClass);
+ panelMenuAttributes.set(groupMode, PanelMenuMode.client);
+ super.testStyleClass(group24, BasicAttributes.groupClass);
}
@Test
public void testGroupDisabledClass() {
- attributes.setGroupMode(PanelMenuMode.client);
- super.testStyleClass(group26, groupDisabledClass);
+ panelMenuAttributes.set(groupMode, PanelMenuMode.client);
+ super.testStyleClass(group26, BasicAttributes.groupDisabledClass);
}
@Test
public void testItemClass() {
- attributes.setGroupMode(PanelMenuMode.client);
- super.testStyleClass(item22, itemClass);
+ panelMenuAttributes.set(groupMode, PanelMenuMode.client);
+ super.testStyleClass(item22, BasicAttributes.itemClass);
}
@Test
public void testItemDisabledClass() {
- attributes.setGroupMode(PanelMenuMode.client);
- super.testStyleClass(item25, itemDisabledClass);
+ panelMenuAttributes.set(groupMode, PanelMenuMode.client);
+ super.testStyleClass(item25, BasicAttributes.itemDisabledClass);
}
@Test
public void testRendered() {
- attributes.setRendered(false);
+ panelMenuAttributes.set(rendered, false);
assertFalse(selenium.isElementPresent(menu));
- attributes.setRendered(true);
+ panelMenuAttributes.set(rendered, true);
assertTrue(selenium.isElementPresent(menu));
}
@@ -116,19 +119,19 @@
@Test
public void testTopGroupClass() {
- super.testStyleClass(group1, topGroupClass);
+ super.testStyleClass(group1, BasicAttributes.topGroupClass);
}
@Test
public void testTopItemClass() {
- super.testStyleClass(item3, topItemClass);
+ super.testStyleClass(item3, BasicAttributes.topItemClass);
}
@Test
@RegressionTest("https://issues.jboss.org/browse/RF-10302")
public void testWidth() {
- attributes.setStyle("");
- attributes.setWidth("300px");
+ panelMenuAttributes.set(PanelMenuAttributes.style, "");
+ panelMenuAttributes.set(width, "300px");
assertEquals(selenium.getStyle(menu, CssProperty.WIDTH), "300px");
}
13 years, 3 months
JBoss Rich Faces SVN: r22748 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richMessage and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-09-23 09:28:32 -0400 (Fri, 23 Sep 2011)
New Revision: 22748
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/MessageAttributes.java
Removed:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/RichMessageAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/RichMessageComponentAttributes.java
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/Attributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/AbstractRichMessageTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/RichMessageTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/RichMessagesTest.java
Log:
RFPL-1439: Update tests for rich:message and messages to use unified way to setting attributes
Plus introduced fix for @for, which is reserver java word, so not allowed to be used as enum item
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:58 UTC (rev 22747)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java 2011-09-23 13:28:32 UTC (rev 22748)
@@ -24,6 +24,7 @@
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.richMessage.MessageAttributes;
import org.richfaces.tests.metamer.ftest.richTooltip.TooltipAttributes;
public class AttributeList {
@@ -51,5 +52,6 @@
public static Attributes<GraphValidatorAttributes> graphValidatorAttributes = new Attributes<GraphValidatorAttributes>();
public static Attributes<RichJQueryAttributes> jQueryAttributes = new Attributes<RichJQueryAttributes>();
public static Attributes<ListAttributes> listAttributes = new Attributes<ListAttributes>();
+ public static Attributes<MessageAttributes> messageAttributes = new Attributes<MessageAttributes>();
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/Attributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/Attributes.java 2011-09-23 13:27:58 UTC (rev 22747)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/Attributes.java 2011-09-23 13:28:32 UTC (rev 22748)
@@ -55,6 +55,17 @@
setProperty(attribute.toString(), string);
}
+ /**
+ * Setter for special cases. For example, 'for' is reserved java word, but valid richfaces attribute as well.
+ * So we use this attribute name in upper case in enum, and then set by special method to avoid overload by
+ * toLowerCase-in over the whole world of richfaces attributes
+ * @param attribute
+ * @param string
+ */
+ public void setLower(T attribute, String string) {
+ setProperty(attribute.toString().toLowerCase(), string);
+ }
+
// TODO jjamrich 2011-09-02: make sure that this resolve to correct string representation of number given as attr
public void set(T attribute, Number no) {
setProperty(attribute.toString(), no);
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/AbstractRichMessageTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/AbstractRichMessageTest.java 2011-09-23 13:27:58 UTC (rev 22747)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/AbstractRichMessageTest.java 2011-09-23 13:28:32 UTC (rev 22748)
@@ -24,6 +24,15 @@
import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardHttp;
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.basicAttributes;
+import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.messageAttributes;
+import static org.richfaces.tests.metamer.ftest.richMessage.MessageAttributes.ajaxRendered;
+import static org.richfaces.tests.metamer.ftest.richMessage.MessageAttributes.dir;
+import static org.richfaces.tests.metamer.ftest.richMessage.MessageAttributes.lang;
+import static org.richfaces.tests.metamer.ftest.richMessage.MessageAttributes.rendered;
+import static org.richfaces.tests.metamer.ftest.richMessage.MessageAttributes.showDetail;
+import static org.richfaces.tests.metamer.ftest.richMessage.MessageAttributes.showSummary;
+import static org.richfaces.tests.metamer.ftest.richMessage.MessageAttributes.style;
+import static org.richfaces.tests.metamer.ftest.richMessage.MessageAttributes.title;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
@@ -54,7 +63,6 @@
private static Logger logger = LoggerFactory.getLogger(AbstractRichMessageTest.class);
- protected RichMessageComponentAttributes attributes = new RichMessageComponentAttributes();
// controls
protected JQueryLocator wrongValuesBtn = pjq("input[type=button][id$=setWrongValuesButton]");
protected JQueryLocator correctValuesBtn = pjq("input[type=button][id$=setCorrectValuesButton]");
@@ -80,17 +88,12 @@
public abstract JQueryLocator getDetailElemLocator();
- public void testHtmlAttribute(ElementLocator<?> element, RichMessageAttributes attribute, String value) {
+ public void testHtmlAttribute(ElementLocator<?> element, MessageAttributes attribute, String value) {
AttributeLocator<?> attr = element.getAttribute(new Attribute(attribute.toString()));
- selenium.type(pjq("input[id$=" + attribute + "Input]"), value);
- if (logger.isDebugEnabled()) {
- logger.debug(" ######## attribute = " + attribute);
- }
-
- selenium.waitForPageToLoad();
-
+ messageAttributes.set(attribute, value);
+
// generate validation message
generateValidationMessages(false);
@@ -167,10 +170,10 @@
}
}
- protected void waitForAttribute(RichMessageAttributes attr) {
+ protected void waitForAttribute(MessageAttributes attr) {
waitGui.until(attributeEquals.locator(
getTestElemLocator().getAttribute(new Attribute(attr.toString())))
- .text(attr.toString()));
+ .text(attr.toString()));
}
// ==================== test methods ====================
@@ -186,7 +189,7 @@
waitGui.until(elementPresent.locator(getTestElemLocator()));
// then disable ajaxRendered
- attributes.setAjaxRendered(Boolean.FALSE);
+ messageAttributes.set(ajaxRendered, Boolean.FALSE);
generateValidationMessages(true);
waitGui.until(isNotDisplayed.locator(getTestElemLocator()));
}
@@ -197,12 +200,12 @@
public void testRendered() {
// with set to false, element with id$=simpleInputMsg shouldn't appear
- attributes.setRendered(Boolean.TRUE);
+ messageAttributes.set(rendered, Boolean.TRUE);
generateValidationMessages(false);
waitGui.until(elementPresent.locator(getTestElemLocator()));
// now disable rendering message
- attributes.setRendered(Boolean.FALSE);
+ messageAttributes.set(rendered, Boolean.FALSE);
generateValidationMessages(false);
waitGui.until(isNotDisplayed.locator(getTestElemLocator()));
}
@@ -213,11 +216,11 @@
public void testShowSummary() {
// span with class=rf-msg-sum should appear when set to true
- attributes.setShowSummary(Boolean.TRUE);
+ messageAttributes.set(showSummary, Boolean.TRUE);
generateValidationMessages(false);
waitModel.until(elementPresent.locator(getSummaryElemLocator()));
- attributes.setShowSummary(Boolean.FALSE);
+ messageAttributes.set(showSummary, Boolean.FALSE);
generateValidationMessages(false);
waitGui.until(isNotDisplayed.locator(getSummaryElemLocator()));
}
@@ -228,29 +231,30 @@
public void testShowDetail() {
// span with class=rf-msg-det should appear when set to true
- attributes.setShowDetail(Boolean.TRUE);
+ messageAttributes.set(showDetail, Boolean.TRUE);
generateValidationMessages(false);
waitGui.until(elementPresent.locator(getDetailElemLocator()));
- attributes.setShowDetail(Boolean.FALSE);
+ messageAttributes.set(showDetail, Boolean.FALSE);
generateValidationMessages(false);
waitGui.until(isNotDisplayed.locator(getDetailElemLocator()));
}
public void testTitle() {
- testHtmlAttribute(getTestElemLocator(), RichMessageAttributes.TITLE, "Title test");
+ testHtmlAttribute(getTestElemLocator(), title, "Title test");
}
public void testDir() {
- testHtmlAttribute(getTestElemLocator(), RichMessageAttributes.DIR, "rtl");
+ testHtmlAttribute(getTestElemLocator(), dir, "rtl");
}
public void testLang() {
- testHtmlAttribute(getTestElemLocator(), RichMessageAttributes.LANG, "US.en");
+ testHtmlAttribute(getTestElemLocator(), lang, "US.en");
}
public void testStyle() {
- testHtmlAttribute(getTestElemLocator(), RichMessageAttributes.STYLE, "color: blue;");
+ // this style test is different from other tests: need generate message before testing
+ testHtmlAttribute(getTestElemLocator(), style, "color: blue;");
}
public void testStyleClass() {
Copied: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/MessageAttributes.java (from rev 22747, modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/RichMessageAttributes.java)
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/MessageAttributes.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/MessageAttributes.java 2011-09-23 13:28:32 UTC (rev 22748)
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richMessage;
+
+import org.richfaces.tests.metamer.ftest.attributes.AttributeEnum;
+
+/**
+ * Component attributes for rich:message
+ *
+ * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
+ * @version $Revision$
+ */
+public enum MessageAttributes implements AttributeEnum {
+
+ ajaxRendered,
+ dir,
+ FOR,
+ globalOnly,
+ lang,
+ rendered,
+ showDetail,
+ showSummary,
+ style,
+ title,
+
+}
Deleted: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/RichMessageAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/RichMessageAttributes.java 2011-09-23 13:27:58 UTC (rev 22747)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/RichMessageAttributes.java 2011-09-23 13:28:32 UTC (rev 22748)
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *******************************************************************************/
-package org.richfaces.tests.metamer.ftest.richMessage;
-
-/**
- * This should be enum for all know attributes.
- * Need to implement an "retriever" method to get
- * values from key such as "class" by "_class" key
- *
- * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
- * @version $Revision$
- */
-public enum RichMessageAttributes {
-
- AJAX_RENDERED("ajaxRendered"),
- RENDERED("rendered"),
- DIR("dir"),
- FOR("for"),
- LANG("lang"),
- TITLE("title"),
- CLASS("class"),
- STYLE("style"),
- STYLE_CLASS("styleClass");
- private String value;
-
- RichMessageAttributes(String val) {
- this.value = val;
- }
-
- @Override
- public String toString() {
- return value;
- }
-}
Deleted: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/RichMessageComponentAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/RichMessageComponentAttributes.java 2011-09-23 13:27:58 UTC (rev 22747)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/RichMessageComponentAttributes.java 2011-09-23 13:28:32 UTC (rev 22748)
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *******************************************************************************/
-package org.richfaces.tests.metamer.ftest.richMessage;
-
-import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
-
-/**
- * Component attributes for rich:message
- *
- * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
- * @version $Revision$
- */
-public class RichMessageComponentAttributes extends AbstractComponentAttributes {
-
- public void setRendered(Boolean rendered) {
- setProperty("rendered", rendered);
- }
-
- public void setAjaxRendered(Boolean rendered) {
- setProperty("ajaxRendered", rendered);
- }
-
- public void setShowDetail(Boolean showDetail) {
- setProperty("showDetail", showDetail);
- }
-
- public void setShowSummary(Boolean showSummary) {
- setProperty("showSummary", showSummary);
- }
-
- public void setFor(String forAttribute) {
- setProperty("for", forAttribute);
- }
-
- public void setGlobalOnly(Boolean globalOnly) {
- setProperty("globalOnly", globalOnly);
- }
-}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/RichMessageTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/RichMessageTest.java 2011-09-23 13:27:58 UTC (rev 22747)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/RichMessageTest.java 2011-09-23 13:28:32 UTC (rev 22748)
@@ -22,6 +22,8 @@
package org.richfaces.tests.metamer.ftest.richMessage;
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.messageAttributes;
+import static org.richfaces.tests.metamer.ftest.richMessage.MessageAttributes.FOR;
import org.jboss.test.selenium.locator.JQueryLocator;
@@ -45,14 +47,14 @@
public void testFor() {
// firstly, remove value from attribute for and generate message
- attributes.setFor("");
+ messageAttributes.setLower(FOR, "");
generateValidationMessages(false);
// assertFalse(selenium.isElementPresent(getTestElemLocator()));
waitGui.until(isNotDisplayed.locator(getTestElemLocator()));
// now set for attribute back to "simpleInput2"
- attributes.setFor("simpleInput2");
+ messageAttributes.setLower(FOR, "simpleInput2");
generateValidationMessages(false);
waitGui.until(elementPresent.locator(getTestElemLocator()));
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/RichMessagesTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/RichMessagesTest.java 2011-09-23 13:27:58 UTC (rev 22747)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/RichMessagesTest.java 2011-09-23 13:28:32 UTC (rev 22748)
@@ -22,6 +22,9 @@
package org.richfaces.tests.metamer.ftest.richMessages;
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.messageAttributes;
+import static org.richfaces.tests.metamer.ftest.richMessage.MessageAttributes.FOR;
+import static org.richfaces.tests.metamer.ftest.richMessage.MessageAttributes.globalOnly;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.richfaces.tests.metamer.ftest.richMessage.AbstractRichMessageTest;
@@ -66,7 +69,7 @@
public void testFor() {
// firstly reset to null
- attributes.setFor("");
+ messageAttributes.setLower(FOR, "");
// generate faces message by btn
selenium.click(generateMsgsBtn);
@@ -75,7 +78,7 @@
waitGui.until(countEquals.count(0).locator(getTestElemLocator().getChild(jq("span[id$=msgs1:form:simpleInput1]"))));
waitGui.until(countEquals.count(0).locator(getTestElemLocator().getChild(jq("span[id$=msgs1:form:simpleInput2]"))));
- attributes.setFor("simpleInput1");
+ messageAttributes.setLower(FOR, "simpleInput1");
// generate faces messages by btn
selenium.click(generateMsgsBtn);
// only messages for simpleInput1 should appear:
@@ -85,7 +88,7 @@
// one type warning
waitModel.until(countEquals.count(1).locator(getWarnMsg()));
- attributes.setFor("simpleInput2");
+ messageAttributes.setLower(FOR, "simpleInput2");
// generate faces messages by btn
selenium.click(generateMsgsBtn);
// only 2 messages for simpleInput2
@@ -107,10 +110,10 @@
*/
public void testGlobalOnly() {
// firstly set for attribute to null
- attributes.setFor("");
+ messageAttributes.setLower(FOR, "");
// then set globalOnly attribute
- attributes.setGlobalOnly(Boolean.FALSE);
+ messageAttributes.set(globalOnly, Boolean.FALSE);
selenium.click(generateMsgsBtn);
13 years, 3 months
JBoss Rich Faces SVN: r22747 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richList and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
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);
}
13 years, 3 months
JBoss Rich Faces SVN: r22746 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richJQuery and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-09-23 09:27:31 -0400 (Fri, 23 Sep 2011)
New Revision: 22746
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/Attributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richJQuery/RichJQueryAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richJQuery/TestSimple.java
Log:
RFPL-1439: Update jQuery test 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:03 UTC (rev 22745)
+++ 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)
@@ -22,6 +22,7 @@
import org.richfaces.tests.metamer.ftest.richDropTarget.DropTargetAttributes;
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.richTooltip.TooltipAttributes;
public class AttributeList {
@@ -47,5 +48,6 @@
public static Attributes<DropTargetAttributes> dropTargetAttributes = new Attributes<DropTargetAttributes>();
public static Attributes<EditorAttributes> editorAttributes = new Attributes<EditorAttributes>();
public static Attributes<GraphValidatorAttributes> graphValidatorAttributes = new Attributes<GraphValidatorAttributes>();
+ public static Attributes<RichJQueryAttributes> jQueryAttributes = new Attributes<RichJQueryAttributes>();
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/Attributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/Attributes.java 2011-09-23 13:27:03 UTC (rev 22745)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/Attributes.java 2011-09-23 13:27:31 UTC (rev 22746)
@@ -68,6 +68,10 @@
setProperty(attribute.toString(), js);
}
+ public void set(T attribute, JQueryLocator locator) {
+ setProperty(attribute.toString(), locator.getRawLocator());
+ }
+
public void set(T attribute, Enum<?> item) {
setProperty(attribute.toString(), item.toString());
}
@@ -76,6 +80,10 @@
setProperty(attribute.toString(), event.getEventName());
}
+ public void reset(T attribute) {
+ setProperty(attribute.toString(), "");
+ }
+
/**
* Retrieve current attribute value
* @param attribute
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richJQuery/RichJQueryAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richJQuery/RichJQueryAttributes.java 2011-09-23 13:27:03 UTC (rev 22745)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richJQuery/RichJQueryAttributes.java 2011-09-23 13:27:31 UTC (rev 22746)
@@ -21,37 +21,19 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.richJQuery;
-import org.jboss.test.selenium.encapsulated.JavaScript;
-import org.jboss.test.selenium.locator.JQueryLocator;
-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 RichJQueryAttributes extends AbstractComponentAttributes {
- public void setAttachType(String attachType) {
- setProperty("attachType", attachType);
- }
+public enum RichJQueryAttributes implements AttributeEnum {
+
+ attachType,
+ event,
+ query,
+ rendered,
+ selector,
+ timing
- public void setEvent(String event) {
- setProperty("event", event);
- }
-
- public void setQuery(JavaScript query) {
- setProperty("query", query);
- }
-
- public void setRendered(boolean rendered) {
- setProperty("rendered", rendered);
- }
-
- public void setSelector(JQueryLocator jQueryLocator) {
- String rawLocator = jQueryLocator == null ? null : jQueryLocator.getRawLocator();
- setProperty("selector", rawLocator);
- }
-
- public void setTiming(String timing) {
- setProperty("timing", timing);
- }
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richJQuery/TestSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richJQuery/TestSimple.java 2011-09-23 13:27:03 UTC (rev 22745)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richJQuery/TestSimple.java 2011-09-23 13:27:31 UTC (rev 22746)
@@ -25,6 +25,8 @@
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.testng.Assert.assertEquals;
+import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.jQueryAttributes;
+import static org.richfaces.tests.metamer.ftest.richJQuery.RichJQueryAttributes.*;
import java.awt.Color;
import java.net.URL;
@@ -45,8 +47,6 @@
JQueryLocator addLiveComponent = jq("input[id$=addComponentButton]");
JQueryLocator liveTestComponent = jq("div.liveTestComponent");
- RichJQueryAttributes attributes = new RichJQueryAttributes();
-
ColorRetriever buttonColorRetriver = new ColorRetriever().locator(button);
@Override
@@ -57,7 +57,7 @@
@Test
public void testDefaultTiming() {
setupDomReadyTypeAttributes();
- attributes.setTiming(null);
+ jQueryAttributes.reset(timing);
assertEquals(buttonColorRetriver.retrieve(), Color.RED);
}
@@ -78,8 +78,8 @@
@Test
public void testAttachTypeOne() {
setupImmediateTypeAttributes();
- attributes.setAttachType("one");
- attributes.setQuery(js("alert('first')"));
+ jQueryAttributes.set(attachType, "one");
+ jQueryAttributes.set(query, js("alert('first')"));
selenium.click(button);
waitGui.until(alertEquals.message("first"));
@@ -113,17 +113,17 @@
}
private void setupImmediateTypeAttributes() {
- attributes.setEvent("click");
- attributes.setQuery(js("$(this).css('color', 'red')"));
- attributes.setSelector(button);
- attributes.setTiming("immediate");
+ jQueryAttributes.set(event, "click");
+ jQueryAttributes.set(query, js("$(this).css('color', 'red')"));
+ jQueryAttributes.set(selector, button);
+ jQueryAttributes.set(timing, "immediate");
}
private void setupDomReadyTypeAttributes() {
- attributes.setEvent(null);
- attributes.setQuery(js("css('color', 'red')"));
- attributes.setSelector(button);
- attributes.setTiming("domready");
+ jQueryAttributes.reset(event);
+ jQueryAttributes.set(query, js("css('color', 'red')"));
+ jQueryAttributes.set(selector, button);
+ jQueryAttributes.set(timing, "domready");
}
}
\ No newline at end of file
13 years, 3 months
JBoss Rich Faces SVN: r22745 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richGraphValidator and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-09-23 09:27:03 -0400 (Fri, 23 Sep 2011)
New Revision: 22745
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/richGraphValidator/GraphValidatorAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richGraphValidator/TestRichGraphValidator.java
Log:
RFPL-1439: Update tests for grapValidator 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:26:37 UTC (rev 22744)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java 2011-09-23 13:27:03 UTC (rev 22745)
@@ -21,6 +21,7 @@
import org.richfaces.tests.metamer.ftest.richDragSource.DragSourceAttributes;
import org.richfaces.tests.metamer.ftest.richDropTarget.DropTargetAttributes;
import org.richfaces.tests.metamer.ftest.richEditor.EditorAttributes;
+import org.richfaces.tests.metamer.ftest.richGraphValidator.GraphValidatorAttributes;
import org.richfaces.tests.metamer.ftest.richTooltip.TooltipAttributes;
public class AttributeList {
@@ -45,5 +46,6 @@
public static Attributes<DragSourceAttributes> dragSourceAttributes = new Attributes<DragSourceAttributes>();
public static Attributes<DropTargetAttributes> dropTargetAttributes = new Attributes<DropTargetAttributes>();
public static Attributes<EditorAttributes> editorAttributes = new Attributes<EditorAttributes>();
+ public static Attributes<GraphValidatorAttributes> graphValidatorAttributes = new Attributes<GraphValidatorAttributes>();
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richGraphValidator/GraphValidatorAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richGraphValidator/GraphValidatorAttributes.java 2011-09-23 13:26:37 UTC (rev 22744)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richGraphValidator/GraphValidatorAttributes.java 2011-09-23 13:27:03 UTC (rev 22745)
@@ -21,7 +21,7 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.richGraphValidator;
-import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
+import org.richfaces.tests.metamer.ftest.attributes.AttributeEnum;
/**
* Component attributes for rich:graphValidator
@@ -29,22 +29,11 @@
* @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
* @version $Revision$
*/
-public class GraphValidatorAttributes extends AbstractComponentAttributes {
+public enum GraphValidatorAttributes implements AttributeEnum {
- public void setRendered(Boolean rendered) {
- setProperty("rendered", rendered);
- }
+ rendered,
+ summary,
+ value,
+ groups
- public void setSummary(String summary) {
- setProperty("summary", summary);
- }
-
- public void setValue(String value) {
- setProperty("value", value);
- }
-
- public void setGroups(String groups) {
- setProperty("groups", groups);
- }
-
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richGraphValidator/TestRichGraphValidator.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richGraphValidator/TestRichGraphValidator.java 2011-09-23 13:26:37 UTC (rev 22744)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richGraphValidator/TestRichGraphValidator.java 2011-09-23 13:27:03 UTC (rev 22745)
@@ -23,10 +23,13 @@
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.graphValidatorAttributes;
+import static org.richfaces.tests.metamer.ftest.richGraphValidator.GraphValidatorAttributes.*;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Date;
+import java.util.GregorianCalendar;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.locator.option.OptionValueLocator;
@@ -51,8 +54,6 @@
private static final int BOOLEAN_INPUTS_GROUP = 3;
private static final int NUMERIC_INPUTS_GROUP = 4;
- private GraphValidatorAttributes attributes = new GraphValidatorAttributes();
-
private JQueryLocator autocomplete = pjq("input[id$=autocompleteInput]");
private JQueryLocator inputSecret = pjq("input[id$=inputSecret]");
private JQueryLocator inputText = pjq("input[id$=inputText]");
@@ -83,7 +84,7 @@
@Test
public void testGroups() {
for (int i=0; i<GROUPS.length; ++i) {
- attributes.setGroups(GROUPS[i]);
+ graphValidatorAttributes.set(groups, GROUPS[i]);
setAllValidatedFields();
@@ -111,7 +112,7 @@
@Test
public void testSummary() {
String msg = "My own validation message!";
- attributes.setSummary(msg);
+ graphValidatorAttributes.set(summary, msg);
setAllValidatedFields();
allFieldsSetToWrong();
@@ -126,7 +127,7 @@
@Test
public void testValue() {
- attributes.setValue("testValue");
+ graphValidatorAttributes.set(value, "testValue");
setAllValidatedFields();
@@ -143,7 +144,7 @@
public void testRendered() {
setAllValidatedFields();
- attributes.setRendered(Boolean.FALSE);
+ graphValidatorAttributes.set(rendered, Boolean.FALSE);
waitGui.until(isNotDisplayed.locator(header));
}
13 years, 3 months
JBoss Rich Faces SVN: r22744 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richEditor and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-09-23 09:26:37 -0400 (Fri, 23 Sep 2011)
New Revision: 22744
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/EditorAttributes.java
Removed:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/RichEditorComponentAttribute.java
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/richEditor/TestRichEditor.java
Log:
RFPL-1439: Update editor 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:26:09 UTC (rev 22743)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java 2011-09-23 13:26:37 UTC (rev 22744)
@@ -1,6 +1,7 @@
package org.richfaces.tests.metamer.ftest.attributes;
import static org.richfaces.tests.metamer.ftest.AbstractMetamerTest.pjq;
+import javassist.expr.NewArray;
import org.jboss.test.selenium.request.RequestType;
import org.richfaces.tests.metamer.ftest.BasicAttributes;
@@ -19,6 +20,7 @@
import org.richfaces.tests.metamer.ftest.richDragIndicator.DragIndicatorAttributes;
import org.richfaces.tests.metamer.ftest.richDragSource.DragSourceAttributes;
import org.richfaces.tests.metamer.ftest.richDropTarget.DropTargetAttributes;
+import org.richfaces.tests.metamer.ftest.richEditor.EditorAttributes;
import org.richfaces.tests.metamer.ftest.richTooltip.TooltipAttributes;
public class AttributeList {
@@ -42,5 +44,6 @@
public static Attributes<DragIndicatorAttributes> dragIndicatorAttributes = new Attributes<DragIndicatorAttributes>();
public static Attributes<DragSourceAttributes> dragSourceAttributes = new Attributes<DragSourceAttributes>();
public static Attributes<DropTargetAttributes> dropTargetAttributes = new Attributes<DropTargetAttributes>();
+ public static Attributes<EditorAttributes> editorAttributes = new Attributes<EditorAttributes>();
}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/EditorAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/EditorAttributes.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/EditorAttributes.java 2011-09-23 13:26:37 UTC (rev 22744)
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richEditor;
+
+import org.richfaces.tests.metamer.ftest.attributes.AttributeEnum;
+
+/**
+ * Rich Editor attributes bean
+ *
+ * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
+ *
+ * @version $Revision$
+ */
+public enum EditorAttributes implements AttributeEnum {
+
+ immediate,
+ lang,
+ height,
+ oninit,
+ readonly,
+ rendered,
+ required,
+ requiredMessage,
+ style,
+ styleClass,
+ toolbar,
+ title,
+ value,
+ width,
+
+}
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/EditorAttributes.java
___________________________________________________________________
Added: svn:executable
+ *
Deleted: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/RichEditorComponentAttribute.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/RichEditorComponentAttribute.java 2011-09-23 13:26:09 UTC (rev 22743)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/RichEditorComponentAttribute.java 2011-09-23 13:26:37 UTC (rev 22744)
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *******************************************************************************/
-package org.richfaces.tests.metamer.ftest.richEditor;
-
-import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
-
-/**
- * Rich Editor attributes bean
- *
- * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
- *
- * @version $Revision$
- */
-public class RichEditorComponentAttribute extends AbstractComponentAttributes {
-
- public void setImmediate(Boolean immediate) {
- setProperty("immediate", immediate);
- }
-
- public void setLang(String lang) {
- setProperty("lang", lang);
- }
-
- public void setHeight(String height) {
- setProperty("height", height);
- }
-
- public void setReadonly(Boolean readonly) {
- setProperty("readonly", readonly);
- }
-
- public void setRendered(Boolean rendered) {
- setProperty("rendered", rendered);
- }
-
- public void setRequired (Boolean required) {
- setProperty("required", required);
- }
-
- public void setRequiredMessage(String requiredMessage) {
- setProperty("requiredMessage", requiredMessage);
- }
-
- public void setStyle(String style) {
- setProperty("style", style);
- }
-
- public void setStyleClass(String styleClass) {
- setProperty("styleClass", styleClass);
- }
-
- public void setToolbar(String toolbar) {
- setProperty("toolbar", toolbar);
- }
-
- public void setTitle(String title) {
- setProperty("title", title);
- }
-
- public void setValue(String value) {
- setProperty("value", value);
- }
-
- public void setWidth(String width) {
- setProperty("width", width);
- }
-
- public void setOnInit(String onInit) {
- setProperty("oninit", onInit);
- }
-
-}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java 2011-09-23 13:26:09 UTC (rev 22743)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java 2011-09-23 13:26:37 UTC (rev 22744)
@@ -8,6 +8,8 @@
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
+import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.editorAttributes;
+import static org.richfaces.tests.metamer.ftest.richEditor.EditorAttributes.*;
import java.net.URL;
@@ -68,8 +70,6 @@
}
}
- private RichEditorComponentAttribute attributes = new RichEditorComponentAttribute();
-
private String text1 = "text1";
private String text2 = "text2";
@@ -154,7 +154,7 @@
public void testHeight() {
String height = "250px";
- attributes.setHeight(height);
+ editorAttributes.set(EditorAttributes.height, height);
// height style is set for area used as editor canvas (not for whole editor component)
String style = selenium.getAttribute(
@@ -165,7 +165,7 @@
@Test
public void testImmediate() {
- attributes.setImmediate(Boolean.TRUE);
+ editorAttributes.set(immediate, Boolean.TRUE);
// set first value
typeTextToEditor(text1);
@@ -189,7 +189,7 @@
@IssueTracking("https://issues.jboss.org/browse/RF-11394")
public void testLang() {
String langVal = "xyz";
- attributes.setLang(langVal);
+ editorAttributes.set(lang, langVal);
// there is lang attribute present in 2 editor's elements
assertTrue(langVal.equals(selenium.getAttribute(editorTextArea.getAttribute(langAttribute))));
@@ -225,7 +225,7 @@
String currentText = getEditorText();
assertTrue(currentText != null && currentText.contains(text1));
- attributes.setReadonly(Boolean.TRUE);
+ editorAttributes.set(readonly, Boolean.TRUE);
// waitModel.until(elementPresent.locator(editor));
typeTextToEditor("test");
@@ -234,7 +234,7 @@
assertFalse(currentText != null && currentText.contains("test"));
// now set read-only back to false
- attributes.setReadonly(Boolean.FALSE);
+ editorAttributes.set(readonly, Boolean.FALSE);
// waitModel.until(elementPresent.locator(editor));
// and type another text
@@ -247,13 +247,13 @@
@Test
public void testRendered() {
- attributes.setRendered(Boolean.FALSE);
+ editorAttributes.set(rendered, Boolean.FALSE);
assertFalse(selenium.isElementPresent(editor), "Editor is rendered even rendered attribute set to false.");
}
@Test
public void testRequired() {
- attributes.setRequired(Boolean.TRUE);
+ editorAttributes.set(required, Boolean.TRUE);
selenium.click(hSubmit);
waitGui.until(textEquals.locator(validationMsgLoc).text(validationMsg1));
@@ -265,12 +265,12 @@
@Test
public void testRequiredMessage() {
- attributes.setRequired(Boolean.TRUE);
- attributes.setRequiredMessage(validationMsg2);
+ editorAttributes.set(required, Boolean.TRUE);
+ editorAttributes.set(requiredMessage, validationMsg2);
selenium.click(hSubmit);
waitGui.until(textEquals.locator(validationMsgLoc).text(validationMsg2));
- attributes.setRequiredMessage(validationMsg1);
+ editorAttributes.set(requiredMessage, validationMsg1);
selenium.click(a4jSubmit);
waitGui.until(textEquals.locator(validationMsgLoc).text(validationMsg1));
}
@@ -281,7 +281,7 @@
final AttributeLocator<?> styleAttr = editor.getAttribute(Attribute.STYLE);
final String style = "background-color: yellow; font-size: 1.5em;";
- attributes.setStyle(style);
+ editorAttributes.set(EditorAttributes.style, style);
waitModel.failWith("Attribute style should contain \"" + style + "\"")
.until(new SeleniumCondition() {
@@ -296,10 +296,10 @@
@Test
public void testStyleClass() {
- final String styleClass = "metamer-ftest-class";
- attributes.setStyleClass(styleClass);
+ final String styleClassVal = "metamer-ftest-class";
+ editorAttributes.set(styleClass, styleClassVal);
- JQueryLocator elementWhichHasntThatClass = jq(editor.getRawLocator() + ":not(.{0})").format(styleClass);
+ JQueryLocator elementWhichHasntThatClass = jq(editor.getRawLocator() + ":not(.{0})").format(styleClassVal);
waitModel.until(elementPresent.locator(editor));
assertTrue(selenium.isElementPresent(editor));
assertFalse(selenium.isElementPresent(elementWhichHasntThatClass));
@@ -308,25 +308,25 @@
@Test
public void testTitle() {
- String title = "RichFaces 4";
+ String titleVal = "RichFaces 4";
AttributeLocator<?> attribute = editor.getAttribute(new Attribute("title"));
// title = null
- assertFalse(title.equals(selenium.getAttribute(attribute)), "Attribute title should not be present.");
+ assertFalse(titleVal.equals(selenium.getAttribute(attribute)), "Attribute title should not be present.");
// set title
- attributes.setTitle(title);
+ editorAttributes.set(title, titleVal);
// wait until attribute present
assertTrue(selenium.isAttributePresent(attribute), "Attribute title should be present.");
// assert correct attribute value: title
- waitModel.until(attributeEquals.locator(attribute).text(title));
+ waitModel.until(attributeEquals.locator(attribute).text(titleVal));
}
@Test
public void testToolbar() {
- attributes.setToolbar("basic");
+ editorAttributes.set(toolbar, "basic");
/* for basic configuration of editor's toolbar there should be only one toolgroup
(toolgroup is group of buttons, while span.toolbar is his container)
@@ -335,11 +335,11 @@
*/
assertEquals(selenium.getCount(editorToolbarGroup), 1);
- attributes.setToolbar("full");
+ editorAttributes.set(toolbar, "full");
assertEquals(selenium.getCount(editorToolbarGroup), 11);
// since config facet has been introduced...
- attributes.setToolbar("custom");
+ editorAttributes.set(toolbar, "custom");
assertEquals(selenium.getCount(editorToolbarGroup), 9);
}
@@ -351,7 +351,7 @@
selenium.click(hSubmit);
// then set value from outside, and check this value in editor
- attributes.setValue(text2);
+ editorAttributes.set(value, text2);
selenium.selectFrame(frameLocator);
String found = selenium.getText(editorArea);
assertTrue(found!=null && found.contains(text2));
@@ -364,7 +364,7 @@
public void testWidth() {
String STYLE_WIDTH = "345px";
- attributes.setWidth(STYLE_WIDTH);
+ editorAttributes.set(width, STYLE_WIDTH);
String styleAttr = selenium.getAttribute(editor.getAttribute(styleAttribute));
assertTrue(styleAttr != null && styleAttr.contains(STYLE_WIDTH), "Style attribute should contain width value");
13 years, 3 months
JBoss Rich Faces SVN: r22743 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richDropTarget and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-09-23 09:26:09 -0400 (Fri, 23 Sep 2011)
New Revision: 22743
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/richDropTarget/DropTargetAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropTarget/TestDropTarget.java
Log:
RFPL-1439: Update DropTargetAttributes 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:25:44 UTC (rev 22742)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java 2011-09-23 13:26:09 UTC (rev 22743)
@@ -18,6 +18,7 @@
import org.richfaces.tests.metamer.ftest.richDataScroller.DataScrollerAttributes;
import org.richfaces.tests.metamer.ftest.richDragIndicator.DragIndicatorAttributes;
import org.richfaces.tests.metamer.ftest.richDragSource.DragSourceAttributes;
+import org.richfaces.tests.metamer.ftest.richDropTarget.DropTargetAttributes;
import org.richfaces.tests.metamer.ftest.richTooltip.TooltipAttributes;
public class AttributeList {
@@ -40,5 +41,6 @@
public static Attributes<DataScrollerAttributes> dataScrollerAttributes = new Attributes<DataScrollerAttributes>();
public static Attributes<DragIndicatorAttributes> dragIndicatorAttributes = new Attributes<DragIndicatorAttributes>();
public static Attributes<DragSourceAttributes> dragSourceAttributes = new Attributes<DragSourceAttributes>();
+ public static Attributes<DropTargetAttributes> dropTargetAttributes = new Attributes<DropTargetAttributes>();
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropTarget/DropTargetAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropTarget/DropTargetAttributes.java 2011-09-23 13:25:44 UTC (rev 22742)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropTarget/DropTargetAttributes.java 2011-09-23 13:26:09 UTC (rev 22743)
@@ -21,46 +21,22 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.richDropTarget;
-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>
* @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
*/
-public class DropTargetAttributes extends AbstractComponentAttributes {
- public void setAcceptedTypes(String acceptedTypes) {
- setProperty("acceptedTypes", acceptedTypes);
- }
+public enum DropTargetAttributes implements AttributeEnum {
- public void setBypassUpdates(Boolean bypassUpdates) {
- setProperty("bypassUpdates", bypassUpdates);
- }
-
- public void setExecute(String execute) {
- setProperty("execute", execute);
- }
-
- public void setImmediate(Boolean immediate) {
- setProperty("immediate", immediate);
- }
-
- public void setOnbeforedomupdate(String onbeforedomupdate) {
- setProperty("onbeforedomupdate", onbeforedomupdate);
- }
-
- public void setOnbegin(String onbegin) {
- setProperty("onbegin", onbegin);
- }
-
- public void setOncomplete(String oncomplete) {
- setProperty("oncomplete", oncomplete);
- }
-
- public void setRender(String render) {
- setProperty("render", render);
- }
-
- public void setRendered(Boolean rendered) {
- setProperty("rendered", rendered);
- }
+ acceptedTypes,
+ bypassUpdates,
+ execute,
+ immediate,
+ onbeforedomupdate,
+ onbegin,
+ oncomplete,
+ render,
+ rendered
+
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropTarget/TestDropTarget.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropTarget/TestDropTarget.java 2011-09-23 13:25:44 UTC (rev 22742)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropTarget/TestDropTarget.java 2011-09-23 13:26:09 UTC (rev 22743)
@@ -36,6 +36,8 @@
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
+import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.dropTargetAttributes;
+import static org.richfaces.tests.metamer.ftest.richDropTarget.DropTargetAttributes.*;
import java.net.URL;
@@ -66,8 +68,6 @@
JQueryLocator dragValue = jq("span[id$=:dragValue]");
JQueryLocator dropValue = jq("span[id$=:dropValue]");
- private DropTargetAttributes attributes = new DropTargetAttributes();
-
@Override
public URL getTestUrl() {
return buildUrl(contextPath, "faces/components/richDropTarget/simple.xhtml");
@@ -75,13 +75,13 @@
@Test
public void testAcceptedTypes() {
- attributes.setAcceptedTypes("drg2");
+ dropTargetAttributes.set(acceptedTypes, "drg2");
testAcception(drg1, REJECTING);
testAcception(drg2, ACCEPTING);
testAcception(drg3, REJECTING);
- attributes.setAcceptedTypes("drg1, drg3");
+ dropTargetAttributes.set(acceptedTypes, "drg1, drg3");
testAcception(drg1, ACCEPTING);
testAcception(drg2, REJECTING);
@@ -90,7 +90,7 @@
@Test
public void testRender() {
- attributes.setRender("droppable1 droppable2 renderChecker");
+ dropTargetAttributes.set(render, "droppable1 droppable2 renderChecker");
testAcception(drg1, ACCEPTING);
@@ -103,7 +103,7 @@
@Test
public void testRendered() {
- attributes.setRendered(false);
+ dropTargetAttributes.set(rendered, false);
selenium.getPageExtensions().install();
selenium.getRequestInterceptor().clearRequestTypeDone();
@@ -149,7 +149,7 @@
@Test
public void testExecute() {
- attributes.setExecute("executeChecker");
+ dropTargetAttributes.set(execute, "executeChecker");
testAcception(drg1, ACCEPTING);
guardedDrop(RequestType.XHR);
@@ -162,7 +162,7 @@
@Test
@RegressionTest("https://issues.jboss.org/browse/RF-10535")
public void testImmediate() {
- attributes.setImmediate(true);
+ dropTargetAttributes.set(immediate, true);
testAcception(drg1, ACCEPTING);
guardedDrop(RequestType.XHR);
@@ -182,7 +182,7 @@
@Test
@RegressionTest("https://issues.jboss.org/browse/RF-10535")
public void testBypassUpdates() {
- attributes.setBypassUpdates(true);
+ dropTargetAttributes.set(bypassUpdates, true);
testAcception(drg1, ACCEPTING);
guardedDrop(RequestType.XHR);
@@ -193,9 +193,9 @@
@Test
public void testEvents() {
- attributes.setOnbeforedomupdate("metamerEvents += \"beforedomupdate \"");
- attributes.setOnbegin("metamerEvents += \"begin \"");
- attributes.setOncomplete("metamerEvents += \"complete \"");
+ dropTargetAttributes.set(onbeforedomupdate, "metamerEvents += \"beforedomupdate \"");
+ dropTargetAttributes.set(onbegin, "metamerEvents += \"begin \"");
+ dropTargetAttributes.set(oncomplete, "metamerEvents += \"complete \"");
selenium.getEval(new JavaScript("window.metamerEvents = \"\";"));
testAcception(drg1, ACCEPTING);
13 years, 3 months
JBoss Rich Faces SVN: r22742 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richDragSource and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-09-23 09:25:44 -0400 (Fri, 23 Sep 2011)
New Revision: 22742
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/richDragSource/DragSourceAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDragSource/TestDragSource.java
Log:
RFPL-1439: Updated DragSourceAttributes 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:25:20 UTC (rev 22741)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java 2011-09-23 13:25:44 UTC (rev 22742)
@@ -17,6 +17,7 @@
import org.richfaces.tests.metamer.ftest.richComponentControl.ComponentControlAttributes;
import org.richfaces.tests.metamer.ftest.richDataScroller.DataScrollerAttributes;
import org.richfaces.tests.metamer.ftest.richDragIndicator.DragIndicatorAttributes;
+import org.richfaces.tests.metamer.ftest.richDragSource.DragSourceAttributes;
import org.richfaces.tests.metamer.ftest.richTooltip.TooltipAttributes;
public class AttributeList {
@@ -38,5 +39,6 @@
public static Attributes<ComponentControlAttributes> componentControllAttributes = new Attributes<ComponentControlAttributes>();
public static Attributes<DataScrollerAttributes> dataScrollerAttributes = new Attributes<DataScrollerAttributes>();
public static Attributes<DragIndicatorAttributes> dragIndicatorAttributes = new Attributes<DragIndicatorAttributes>();
+ public static Attributes<DragSourceAttributes> dragSourceAttributes = new Attributes<DragSourceAttributes>();
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDragSource/DragSourceAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDragSource/DragSourceAttributes.java 2011-09-23 13:25:20 UTC (rev 22741)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDragSource/DragSourceAttributes.java 2011-09-23 13:25:44 UTC (rev 22742)
@@ -21,22 +21,16 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.richDragSource;
-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 DragSourceAttributes extends AbstractComponentAttributes {
- public void setDragIndicator(String dragIndicator) {
- setProperty("dragIndicator", dragIndicator);
- }
-
- public void setType(String type) {
- setProperty("type", type);
- }
-
- public void setRendered(Boolean rendered) {
- setProperty("rendered", rendered);
- }
+public enum DragSourceAttributes implements AttributeEnum {
+
+ dragIndicator,
+ type,
+ rendered
+
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDragSource/TestDragSource.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDragSource/TestDragSource.java 2011-09-23 13:25:20 UTC (rev 22741)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDragSource/TestDragSource.java 2011-09-23 13:25:44 UTC (rev 22742)
@@ -25,6 +25,8 @@
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
+import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.dragSourceAttributes;
+import static org.richfaces.tests.metamer.ftest.richDragSource.DragSourceAttributes.*;
import java.net.URL;
@@ -41,8 +43,6 @@
*/
public class TestDragSource extends AbstractDragNDropTest {
- DragSourceAttributes attributes = new DragSourceAttributes();
-
@Override
public URL getTestUrl() {
return buildUrl(contextPath, "faces/components/richDragSource/simple.xhtml");
@@ -52,7 +52,7 @@
public void testDefaultIndicator() {
indicator = new Indicator("defaultIndicator", drg1.getNthOccurence(2));
indicator.setDefaultIndicator(true);
- attributes.setDragIndicator("");
+ dragSourceAttributes.set(dragIndicator, "");
drag = new Drag(drg1, drop1);
drag.setDragIndicator(indicator);
@@ -63,7 +63,7 @@
@Test
public void testCustomIndicator() {
indicator = new Indicator("ind", jq("div.rf-ind[id$=indicator2]"));
- attributes.setDragIndicator("indicator2");
+ dragSourceAttributes.set(dragIndicator, "indicator2");
drag = new Drag(drg1, drop1);
drag.setDragIndicator(indicator);
@@ -73,7 +73,7 @@
@Test
public void testRendered() {
- attributes.setRendered(false);
+ dragSourceAttributes.set(rendered, false);
selenium.getPageExtensions().install();
selenium.getRequestInterceptor().clearRequestTypeDone();
@@ -92,7 +92,7 @@
@Test
public void testType() {
- attributes.setType("drg3");
+ dragSourceAttributes.set(type, "drg3");
drag = new Drag(drg1, drop2);
drag.setDragIndicator(indicator);
enterAndVerify(drop2, IndicatorState.ACCEPTING);
13 years, 3 months
JBoss Rich Faces SVN: r22741 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richDragIndicator and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-09-23 09:25:20 -0400 (Fri, 23 Sep 2011)
New Revision: 22741
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/richDragIndicator/DragIndicatorAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDragIndicator/TestDragIndicator.java
Log:
RFPL-1439: Update dragIndicatorAttributes 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:24:56 UTC (rev 22740)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java 2011-09-23 13:25:20 UTC (rev 22741)
@@ -16,6 +16,7 @@
import org.richfaces.tests.metamer.ftest.richColumn.ColumnAttributes;
import org.richfaces.tests.metamer.ftest.richComponentControl.ComponentControlAttributes;
import org.richfaces.tests.metamer.ftest.richDataScroller.DataScrollerAttributes;
+import org.richfaces.tests.metamer.ftest.richDragIndicator.DragIndicatorAttributes;
import org.richfaces.tests.metamer.ftest.richTooltip.TooltipAttributes;
public class AttributeList {
@@ -36,5 +37,6 @@
public static Attributes<ColumnAttributes> columnAttributes = new Attributes<ColumnAttributes>();
public static Attributes<ComponentControlAttributes> componentControllAttributes = new Attributes<ComponentControlAttributes>();
public static Attributes<DataScrollerAttributes> dataScrollerAttributes = new Attributes<DataScrollerAttributes>();
+ public static Attributes<DragIndicatorAttributes> dragIndicatorAttributes = new Attributes<DragIndicatorAttributes>();
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDragIndicator/DragIndicatorAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDragIndicator/DragIndicatorAttributes.java 2011-09-23 13:24:56 UTC (rev 22740)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDragIndicator/DragIndicatorAttributes.java 2011-09-23 13:25:20 UTC (rev 22741)
@@ -21,26 +21,17 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.richDragIndicator;
-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 DragIndicatorAttributes extends AbstractComponentAttributes {
- public void setAcceptClass(String acceptClass) {
- setProperty("acceptClass", acceptClass);
- }
-
- public void setDraggingClass(String draggingClass) {
- setProperty("draggingClass", draggingClass);
- }
-
- public void setRejectClass(String rejectClass) {
- setProperty("rejectClass", rejectClass);
- }
-
- public void setRendered(Boolean rendered) {
- setProperty("rendered", rendered);
- }
+public enum DragIndicatorAttributes implements AttributeEnum {
+
+ acceptClass,
+ draggingClass,
+ rejectClass,
+ rendered
+
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDragIndicator/TestDragIndicator.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDragIndicator/TestDragIndicator.java 2011-09-23 13:24:56 UTC (rev 22740)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDragIndicator/TestDragIndicator.java 2011-09-23 13:25:20 UTC (rev 22741)
@@ -24,6 +24,8 @@
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
+import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.dragIndicatorAttributes;
+import static org.richfaces.tests.metamer.ftest.richDragIndicator.DragIndicatorAttributes.*;
import java.net.URL;
@@ -43,8 +45,6 @@
private static final String REJECT_CLASS = "sample-reject-class";
private static final String DRAGGING_CLASS = "sample-dragging-class";
- private DragIndicatorAttributes attributes = new DragIndicatorAttributes();
-
@Override
public URL getTestUrl() {
return buildUrl(contextPath, "faces/components/richDragIndicator/simple.xhtml");
@@ -52,9 +52,9 @@
@BeforeMethod
public void setup() {
- attributes.setDraggingClass(DRAGGING_CLASS);
- attributes.setAcceptClass(ACCEPT_CLASS);
- attributes.setRejectClass(REJECT_CLASS);
+ dragIndicatorAttributes.set(draggingClass, DRAGGING_CLASS);
+ dragIndicatorAttributes.set(acceptClass, ACCEPT_CLASS);
+ dragIndicatorAttributes.set(rejectClass, REJECT_CLASS);
indicator.setDraggingClass(DRAGGING_CLASS);
indicator.setAcceptClass(ACCEPT_CLASS);
indicator.setRejectClass(REJECT_CLASS);
@@ -62,7 +62,7 @@
@Test
public void testRendered() {
- attributes.setRendered(false);
+ dragIndicatorAttributes.set(rendered, false);
selenium.getPageExtensions().install();
selenium.getRequestInterceptor().clearRequestTypeDone();
13 years, 3 months