Author: jjamrich
Date: 2011-09-05 04:49:19 -0400 (Mon, 05 Sep 2011)
New Revision: 22678
Removed:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/TooltipAttributes.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/UsageTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipTarget.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TooltipAttributes.java
Log:
RFPL-1439: updated rich:tooltip tests to use unified way to setting attributes
Moved TooltipAttributes class into tooltip's tests package and updated tests for
tooltip to fit new 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-05
08:48:31 UTC (rev 22677)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java 2011-09-05
08:49:19 UTC (rev 22678)
@@ -1,5 +1,7 @@
package org.richfaces.tests.metamer.ftest.attributes;
+import org.richfaces.tests.metamer.ftest.richTooltip.TooltipAttributes;
+
public class AttributeList {
public static Attributes<TooltipAttributes> tooltipAttributes = new
Attributes<TooltipAttributes>();
}
Deleted:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/TooltipAttributes.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/TooltipAttributes.java 2011-09-05
08:48:31 UTC (rev 22677)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/TooltipAttributes.java 2011-09-05
08:49:19 UTC (rev 22678)
@@ -1,42 +0,0 @@
-package org.richfaces.tests.metamer.ftest.attributes;
-
-public enum TooltipAttributes implements AttributeEnum {
- attached,
- data,
- dir,
- direction,
- execute,
- followMouse,
- hideDelay,
- hideEvent,
- horizontalOffset,
- jointPoint,
- lang,
- layout,
- limitRender,
- mode,
- onbeforedomupdate,
- onbeforehide,
- onbeforeshow,
- onbegin,
- onclick,
- oncomplete,
- ondblclick,
- onhide,
- onmousedown,
- onmousemove,
- onmouseout,
- onmouseover,
- onmouseup,
- onshow,
- render,
- showDelay,
- showEvent,
- status,
- style,
- styleClass,
- title,
- verticalOffset,
- zindex,
-
-}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/UsageTest.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/UsageTest.java 2011-09-05
08:48:31 UTC (rev 22677)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/UsageTest.java 2011-09-05
08:49:19 UTC (rev 22678)
@@ -2,8 +2,8 @@
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
import static
org.richfaces.tests.metamer.ftest.attributes.AttributeList.tooltipAttributes;
-import static org.richfaces.tests.metamer.ftest.attributes.TooltipAttributes.direction;
-import static org.richfaces.tests.metamer.ftest.attributes.TooltipAttributes.hideEvent;
+import static org.richfaces.tests.metamer.ftest.richTooltip.TooltipAttributes.direction;
+import static org.richfaces.tests.metamer.ftest.richTooltip.TooltipAttributes.hideEvent;
import java.net.URL;
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipSimple.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipSimple.java 2011-09-05
08:48:31 UTC (rev 22677)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipSimple.java 2011-09-05
08:49:19 UTC (rev 22678)
@@ -36,6 +36,8 @@
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
+import static
org.richfaces.tests.metamer.ftest.attributes.AttributeList.tooltipAttributes;
+import static org.richfaces.tests.metamer.ftest.richTooltip.TooltipAttributes.*;
import java.net.URL;
import org.jboss.test.selenium.css.CssProperty;
@@ -64,7 +66,7 @@
private static final int EVENT_OFFSET = 10;
private static final int PRESET_OFFSET = 5;
- TooltipAttributes attributes = new TooltipAttributes();
+ // TooltipAttributes attributes = new TooltipAttributes();
JQueryLocator panel = pjq("div[id$=panel]");
TooltipModel tooltip = new TooltipModel(jq(".rf-tt"), panel);
Point eventPosition;
@@ -102,13 +104,13 @@
@BeforeMethod
public void setupAttributes() {
- attributes.setShowEvent("mouseover");
- attributes.setHideEvent("mouseout");
+ tooltipAttributes.set(showEvent, "mouseover");
+ tooltipAttributes.set(hideEvent, "mouseout");
}
@Test
public void testLifecycle() {
- attributes.setMode(TooltipMode.ajax);
+ tooltipAttributes.set(TooltipAttributes.mode, TooltipMode.ajax);
retrieveRequestTime.initializeValue();
tooltip.recall();
waitGui.waitForChange(retrieveRequestTime);
@@ -117,9 +119,9 @@
@Test
public void testData() {
- attributes.setData("RichFaces 4");
- attributes.setOncomplete("data = event.data");
- attributes.setMode(TooltipMode.ajax);
+ tooltipAttributes.set(data, "RichFaces 4");
+ tooltipAttributes.set(oncomplete, "data = event.data");
+ tooltipAttributes.set(TooltipAttributes.mode, TooltipMode.ajax);
retrieveRequestTime.initializeValue();
tooltip.recall();
@@ -130,7 +132,7 @@
@Test
public void testRequestEventHandlers() {
- attributes.setMode(TooltipMode.ajax);
+ tooltipAttributes.set(TooltipAttributes.mode, TooltipMode.ajax);
super.testRequestEventsBefore("begin", "beforedomupdate",
"complete");
retrieveRequestTime.initializeValue();
@@ -150,9 +152,9 @@
@Use(field = "verticalOffset", value = "offsets"),
@Use(field = "horizontalOffset", value = "offsets")})
public void testPositioning() {
- attributes.setDirection(direction);
- attributes.setHorizontalOffset(horizontalOffset);
- attributes.setVerticalOffset(verticalOffset);
+ tooltipAttributes.set(TooltipAttributes.direction, direction);
+ tooltipAttributes.set(TooltipAttributes.horizontalOffset, horizontalOffset);
+ tooltipAttributes.set(TooltipAttributes.verticalOffset, verticalOffset);
if (direction == Positioning.auto) {
direction = Positioning.topRight;
@@ -195,7 +197,7 @@
@Test
@Use(field = "followMouse", booleans = {true, false})
public void testFollowMouse() {
- attributes.setFollowMouse(followMouse);
+ tooltipAttributes.set(TooltipAttributes.followMouse, followMouse);
recallTooltipInRightBottomCornerOfPanel(0, 0);
@@ -215,8 +217,8 @@
@Use(field = "presetDelay", ints = {0, 1000, 5000})
public void testHideDelay() {
- attributes.setMode(TooltipMode.ajax);
- attributes.setHideDelay(presetDelay);
+ tooltipAttributes.set(TooltipAttributes.mode, TooltipMode.ajax);
+ tooltipAttributes.set(hideDelay, presetDelay);
new DelayTester(presetDelay) {
@@ -233,7 +235,7 @@
@Test
public void testHideEvent() {
- attributes.setHideEvent("mouseup");
+ tooltipAttributes.set(hideEvent, "mouseup");
tooltip.recall();
@@ -249,7 +251,7 @@
@Test
@Use(field = "layout", enumeration = true)
public void testLayout() {
- attributes.setLayout(layout);
+ tooltipAttributes.set(TooltipAttributes.layout, layout);
String expectedTagName = (layout == TooltipLayout.block) ? "div" :
"span";
@@ -261,9 +263,9 @@
@Test
public void testLimitRender() {
- attributes.setLimitRender(true);
- attributes.setRender("@this renderChecker");
- attributes.setMode(TooltipMode.ajax);
+ tooltipAttributes.set(limitRender, true);
+ tooltipAttributes.set(render, "@this renderChecker");
+ tooltipAttributes.set(TooltipAttributes.mode, TooltipMode.ajax);
retrieveRenderChecker.initializeValue();
retrieveRequestTime.initializeValue();
@@ -276,7 +278,7 @@
@Test
@Use(field = "mode", enumeration = true)
public void testMode() {
- attributes.setMode(mode);
+ tooltipAttributes.set(TooltipAttributes.mode, mode);
retrieveRequestTime.initializeValue();
@@ -301,7 +303,7 @@
@Test
public void testRendered() {
- attributes.setRendered(false);
+ tooltipAttributes.set(TooltipAttributes.rendered, false);
assertFalse(selenium.isElementPresent(tooltip));
}
@@ -311,8 +313,8 @@
@RegressionTest("https://issues.jboss.org/browse/RF-10522")
public void testShowDelay() {
- attributes.setMode(TooltipMode.client);
- attributes.setShowDelay(presetDelay);
+ tooltipAttributes.set(TooltipAttributes.mode, TooltipMode.client);
+ tooltipAttributes.set(showDelay, presetDelay);
new DelayTester(presetDelay) {
@@ -329,7 +331,7 @@
@Test
public void testShowEvent() {
- attributes.setShowEvent("mouseup");
+ tooltipAttributes.set(TooltipAttributes.showEvent, "mouseup");
selenium.mouseUpAt(panel, new Point(5, 5));
waitGui.until(isDisplayed.locator(tooltip));
@@ -337,8 +339,8 @@
@Test
public void testStatus() {
- attributes.setStatus("statusChecker");
- attributes.setMode(TooltipMode.ajax);
+ tooltipAttributes.set(status, "statusChecker");
+ tooltipAttributes.set(TooltipAttributes.mode, TooltipMode.ajax);
retrieveStatusChecker.initializeValue();
tooltip.recall();
@@ -362,7 +364,7 @@
@Test
public void testZindex() {
- attributes.setZindex(10);
+ tooltipAttributes.set(zindex, 10);
String zindex = selenium.getStyle(tooltip, CssProperty.Z_INDEX);
assertEquals(zindex, "10");
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipTarget.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipTarget.java 2011-09-05
08:48:31 UTC (rev 22677)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipTarget.java 2011-09-05
08:49:19 UTC (rev 22678)
@@ -21,10 +21,9 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.richTooltip;
-import static javax.faces.event.PhaseId.APPLY_REQUEST_VALUES;
-import static javax.faces.event.PhaseId.RENDER_RESPONSE;
-import static javax.faces.event.PhaseId.RESTORE_VIEW;
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static
org.richfaces.tests.metamer.ftest.attributes.AttributeList.tooltipAttributes;
+import static org.richfaces.tests.metamer.ftest.richTooltip.TooltipAttributes.*;
import java.net.URL;
@@ -44,7 +43,7 @@
*/
public class TestTooltipTarget extends AbstractMetamerTest {
- private TooltipAttributes attributes = new TooltipAttributes();
+ // private TooltipAttributes attributes = new TooltipAttributes();
private JQueryLocator panel1 = pjq("div[id$=regular-div]");
private JQueryLocator panel2 = pjq("div[id$=jsf-div]");
private JQueryLocator panel3 = pjq("div[id$=panel_body]");
@@ -60,25 +59,25 @@
@BeforeMethod
public void setupAttributes() {
- attributes.setShowEvent("mouseover");
- attributes.setHideEvent("mouseout");
+ tooltipAttributes.set(showEvent, "mouseover");
+ tooltipAttributes.set(hideEvent, "mouseout");
}
@Test
@IssueTracking("https://issues.jboss.org/browse/RF-11370")
public void testTarget() {
// 1. first target
- attributes.setTarget("regular-div");
+ tooltipAttributes.set(target, "regular-div");
tooltip1.recall();
waitGui.until(isDisplayed.locator(tooltip1));
// 2. target
- attributes.setTarget("form:jsf-div");
+ tooltipAttributes.set(target, "form:jsf-div");
tooltip2.recall();
waitGui.until(isDisplayed.locator(tooltip2));
// 3. default target
- attributes.setTarget("form:panel");
+ tooltipAttributes.set(target, "form:panel");
tooltip3.recall();
waitGui.until(isDisplayed.locator(tooltip3));
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TooltipAttributes.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TooltipAttributes.java 2011-09-05
08:48:31 UTC (rev 22677)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TooltipAttributes.java 2011-09-05
08:49:19 UTC (rev 22678)
@@ -1,150 +1,46 @@
-/*******************************************************************************
- * 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.richTooltip;
-import org.richfaces.TooltipLayout;
-import org.richfaces.TooltipMode;
-import org.richfaces.component.Positioning;
-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 TooltipAttributes extends AbstractComponentAttributes {
-
- public void setData(String data) {
- setProperty("data", data);
- }
-
- public void setDir(String dir) {
- setProperty("dir", dir);
- }
-
- public void setDirection(Positioning direction) {
- setProperty("direction", direction);
- }
-
- public void setDisabled(Boolean disabled) {
- setProperty("disabled", disabled);
- }
-
- public void setExecute(String execute) {
- setProperty("execute", execute);
- }
-
- public void setFollowMouse(Boolean followMouse) {
- setProperty("followMouse", followMouse);
- }
-
- public void setHideDelay(Integer hideDelay) {
- setProperty("hideDelay", hideDelay);
- }
-
- public void setHideEvent(String hideEvent) {
- setProperty("hideEvent", hideEvent);
- }
-
- public void setHorizontalOffset(Integer horizontalOffset) {
- setProperty("horizontalOffset", horizontalOffset);
- }
-
- public void setJointPoint(Positioning positioning) {
- setProperty("positioning", positioning);
- }
-
- public void setLang(String lang) {
- setProperty("lang", lang);
- }
-
- public void setLayout(TooltipLayout layout) {
- setProperty("layout", layout);
- }
-
- public void setLimitRender(Boolean limitRender) {
- setProperty("limitRender", limitRender);
- }
-
- public void setMode(TooltipMode mode) {
- setProperty("mode", mode);
- }
-
- public void setOnbeforehide(String onbeforehide) {
- setProperty("onbeforehide", onbeforehide);
- }
-
- public void setOnbeforeshow(String onbeforeshow) {
- setProperty("onbeforeshow", onbeforeshow);
- }
-
- public void setOnhide(String onhide) {
- setProperty("onhide", onhide);
- }
-
- public void setOnshow(String onshow) {
- setProperty("onshow", onshow);
- }
-
- public void setRender(String render) {
- setProperty("render", render);
- }
-
- public void setRendered(Boolean rendered) {
- setProperty("rendered", rendered);
- }
-
- public void setShowDelay(Integer showDelay) {
- setProperty("showDelay", showDelay);
- }
-
- public void setShowEvent(String showEvent) {
- setProperty("showEvent", showEvent);
- }
-
- public void setStatus(String status) {
- setProperty("status", status);
- }
-
- public void setStyle(String style) {
- setProperty("style", style);
- }
-
- public void setStyleClass(String styleClass) {
- setProperty("styleClass", styleClass);
- }
-
- public void setTarget(String target) {
- setProperty("target", target);
- }
-
- public void setTitle(String title) {
- setProperty("title", title);
- }
-
- public void setVerticalOffset(Integer verticalOffset) {
- setProperty("verticalOffset", verticalOffset);
- }
-
- public void setZindex(Integer zindex) {
- setProperty("zindex", zindex);
- }
+public enum TooltipAttributes implements AttributeEnum {
+ attached,
+ data,
+ dir,
+ direction,
+ execute,
+ followMouse,
+ hideDelay,
+ hideEvent,
+ horizontalOffset,
+ jointPoint,
+ lang,
+ layout,
+ limitRender,
+ mode,
+ onbeforedomupdate,
+ onbeforehide,
+ onbeforeshow,
+ onbegin,
+ onclick,
+ oncomplete,
+ ondblclick,
+ onhide,
+ onmousedown,
+ onmousemove,
+ onmouseout,
+ onmouseover,
+ onmouseup,
+ onshow,
+ render,
+ rendered,
+ showDelay,
+ showEvent,
+ status,
+ style,
+ styleClass,
+ title,
+ target,
+ verticalOffset,
+ zindex,
+
}