Author: ppitonak(a)redhat.com
Date: 2011-04-04 12:12:14 -0400 (Mon, 04 Apr 2011)
New Revision: 22364
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jQueue/TestGlobalQueue.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipSimple.java
Log:
tests updated
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jQueue/TestGlobalQueue.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jQueue/TestGlobalQueue.java 2011-04-04
13:23:24 UTC (rev 22363)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jQueue/TestGlobalQueue.java 2011-04-04
16:12:14 UTC (rev 22364)
@@ -24,6 +24,8 @@
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.testng.Assert.assertEquals;
+import com.thoughtworks.selenium.SeleniumException;
+
import java.net.URL;
import org.jboss.cheiron.halt.XHRHalter;
@@ -31,11 +33,10 @@
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.richfaces.tests.metamer.ftest.annotations.RegressionTest;
import org.richfaces.tests.metamer.ftest.annotations.Use;
import org.testng.annotations.Test;
-import com.thoughtworks.selenium.SeleniumException;
-
/**
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
@@ -110,7 +111,7 @@
* </p>
*/
@Test
- @IssueTracking("https://issues.jboss.org/browse/RFPL-1194")
+ @RegressionTest("https://issues.jboss.org/browse/RFPL-1194")
public void testMultipleRequestsWithNoDelay() {
attributes.setRequestDelay(0);
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-04-04
13:23:24 UTC (rev 22363)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipSimple.java 2011-04-04
16:12:14 UTC (rev 22364)
@@ -64,44 +64,33 @@
private static final int EVENT_OFFSET = 10;
private static final int PRESET_OFFSET = 5;
-
TooltipAttributes attributes = new TooltipAttributes();
JQueryLocator panel = pjq("div[id$=panel]");
TooltipModel tooltip = new TooltipModel(jq(".rf-tt"), panel);
-
Point eventPosition;
-
@Inject
@Use(empty = true)
Positioning direction;
-
- Integer[] offsets = new Integer[] { 0, PRESET_OFFSET, -PRESET_OFFSET };
-
+ Integer[] offsets = new Integer[]{0, PRESET_OFFSET, -PRESET_OFFSET};
@Inject
@Use(ints = 0)
Integer verticalOffset;
-
@Inject
@Use(ints = 0)
Integer horizontalOffset;
-
@Inject
@Use(empty = true)
Event domEvent;
- Event[] domEvents = { CLICK, DBLCLICK, MOUSEDOWN, MOUSEMOVE, MOUSEOUT, MOUSEOVER,
MOUSEUP };
-
+ Event[] domEvents = {CLICK, DBLCLICK, MOUSEDOWN, MOUSEMOVE, MOUSEOUT, MOUSEOVER,
MOUSEUP};
@Inject
@Use(empty = true)
Boolean followMouse = true;
-
@Inject
@Use(empty = true)
Integer presetDelay;
-
@Inject
@Use(empty = true)
TooltipLayout layout;
-
@Inject
@Use(empty = true)
TooltipMode mode;
@@ -156,8 +145,10 @@
}
@Test
- @Uses({ @Use(field = "direction", enumeration = true), @Use(field =
"verticalOffset", value = "offsets"),
- @Use(field = "horizontalOffset", value = "offsets") })
+ @Uses({
+ @Use(field = "direction", enumeration = true),
+ @Use(field = "verticalOffset", value = "offsets"),
+ @Use(field = "horizontalOffset", value = "offsets")})
public void testPositioning() {
attributes.setDirection(direction);
attributes.setHorizontalOffset(horizontalOffset);
@@ -179,7 +170,7 @@
break;
case LEFT:
assertEquals(tooltipPosition.getX() + tooltipDimension.getWidth(),
eventPosition.getX()
- - horizontalOffset);
+ - horizontalOffset);
default:
}
}
@@ -191,14 +182,14 @@
break;
case TOP:
assertEquals(tooltipPosition.getY() + tooltipDimension.getHeight(),
eventPosition.getY()
- - verticalOffset);
+ - verticalOffset);
default:
}
}
}
@Test
- @Use(field = "followMouse", booleans = { true, false })
+ @Use(field = "followMouse", booleans = {true, false})
public void testFollowMouse() {
attributes.setFollowMouse(followMouse);
@@ -217,13 +208,14 @@
}
@Test
- @Use(field = "presetDelay", ints = { 0, 1000, 5000 })
+ @Use(field = "presetDelay", ints = {0, 1000, 5000})
public void testHideDelay() {
attributes.setMode(TooltipMode.ajax);
attributes.setHideDelay(presetDelay);
new DelayTester(presetDelay) {
+
public void beforeAction() {
tooltip.recall();
}
@@ -285,7 +277,9 @@
retrieveRequestTime.initializeValue();
tooltip.recall();
- assertEquals(retrieveRequestTime.isValueChanged(), mode == TooltipMode.ajax);
+ if (mode == TooltipMode.ajax) {
+ waitGui.waitForChange(retrieveRequestTime);
+ }
retrieveRequestTime.initializeValue();
tooltip.hide();
@@ -309,7 +303,7 @@
}
@Test
- @Use(field = "presetDelay", ints = { 0, 1000, 5000 })
+ @Use(field = "presetDelay", ints = {0, 1000, 5000})
@RegressionTest("https://issues.jboss.org/browse/RF-10522")
public void testShowDelay() {
@@ -317,6 +311,7 @@
attributes.setShowDelay(presetDelay);
new DelayTester(presetDelay) {
+
public void action() {
tooltip.recall();
waitGui.timeout(presetDelay + 2000).until(isDisplayed.locator(tooltip));
@@ -374,10 +369,10 @@
final Dimension panelDimension = selenium.getElementDimension(panel);
eventPosition = new Point(panelPosition.getX() + panelDimension.getWidth() -
EVENT_OFFSET, panelPosition.getY()
- + panelDimension.getHeight() - EVENT_OFFSET);
+ + panelDimension.getHeight() - EVENT_OFFSET);
tooltip.recall(panelDimension.getWidth() - EVENT_OFFSET + offsetX,
panelDimension.getHeight() - EVENT_OFFSET
- + offsetY);
+ + offsetY);
}
private HorizontalAlignment getHorizontalAlignment() {
@@ -405,11 +400,12 @@
}
private enum HorizontalAlignment {
+
LEFT, RIGHT
}
private enum VerticalAlignment {
+
TOP, BOTTOM
}
-
}