Author: jgargula
Date: 2012-01-12 10:18:12 -0500 (Thu, 12 Jan 2012)
New Revision: 37790
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
Log:
Fixed waitForShell method.
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java 2012-01-12
15:06:24 UTC (rev 37789)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java 2012-01-12
15:18:12 UTC (rev 37790)
@@ -224,19 +224,18 @@
if (maxTimeout < 0) {
ATTEMPTS_TIMEOUT = 15;
} else {
- final int result = (int)Math.ceil((double)(maxTimeout * 1000) /
(double)SLEEP_TIME);
- ATTEMPTS_TIMEOUT = result < 1 ? 1 : result;
+ ATTEMPTS_TIMEOUT = (int)Math.ceil((double)(maxTimeout * 1000) /
(double)SLEEP_TIME);
}
- for (int i = 0; i < ATTEMPTS_TIMEOUT; i++) {
- if (maxTimeout != 0) {
- sleep(SLEEP_TIME);
- }
+ for (int i = 0; i <= ATTEMPTS_TIMEOUT; i++) {
for (SWTBotShell shell : shells()) {
if (shellTitle.equals(shell.getText())) {
return shell;
}
}
+ if (i < ATTEMPTS_TIMEOUT) {
+ sleep(SLEEP_TIME);
+ }
}
return null;
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2012-01-12
15:06:24 UTC (rev 37789)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2012-01-12
15:18:12 UTC (rev 37790)
@@ -1004,8 +1004,8 @@
*/
public void closeConfirmPerspectiveSwitchShellIfOpened(
final boolean switchPerspective, final boolean rememberMyDecision) {
- while (bot.waitForShell(IDELabel.Shell.PROGRESS_INFORMATION, 1) != null) {
- // nothing to do, waiting time is included in waitForShell method
+ while (bot.waitForShell(IDELabel.Shell.PROGRESS_INFORMATION, 0) != null) {
+ bot.sleep(Timing.time2S());
}
// Finds confirmation shell and waits for it
Show replies by date