Author: ljelinko
Date: 2012-05-18 03:43:03 -0400 (Fri, 18 May 2012)
New Revision: 41139
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java
Log:
Added handling of running server during restart.
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java 2012-05-18
00:43:59 UTC (rev 41138)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java 2012-05-18
07:43:03 UTC (rev 41139)
@@ -14,7 +14,6 @@
import org.jboss.tools.ui.bot.ext.condition.TaskDuration;
import org.jboss.tools.ui.bot.ext.gen.ActionItem.View.ServerServers;
import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
-import org.jboss.tools.ui.bot.ext.logging.WidgetsLogger;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
public class ServersView extends ViewBase {
@@ -100,8 +99,9 @@
ContextMenuHelper.prepareTreeItemForContextMenu(tree, server);
new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, "Restart",
false)).click();
+ handleServerAlreadyRunning(bot);
- bot.waitWhile(new NonSystemJobRunsCondition(), TaskDuration.NORMAL.getTimeout());
+ bot.waitWhile(new NonSystemJobRunsCondition(), TaskDuration.VERY_LONG.getTimeout());
bot.waitUntil(new ICondition() {
@Override
@@ -117,7 +117,7 @@
public String getFailureMessage() {
return "The server does not have status 'Started'";
}
- });
+ }, TaskDuration.LONG.getTimeout());
}
/**
@@ -153,12 +153,7 @@
log.error(ex);
}
}
- try {
- bot.shell("Server already running on localhost");
- throw new RuntimeException("Another server is running on localhost");
- } catch (WidgetNotFoundException e) {
- // ok, nothing to do
- }
+ handleServerAlreadyRunning(bot);
util.waitForNonIgnoredJobs(Timing.time(600 * 1000));
util.waitForAll(Timing.time3S());
}
@@ -167,6 +162,14 @@
"\nThis server is not defined within Servers view");
}
}
+ private void handleServerAlreadyRunning(SWTBot bot) {
+ try {
+ bot.shell("Server already running on localhost");
+ throw new RuntimeException("Another server is running on localhost");
+ } catch (WidgetNotFoundException e) {
+ // ok, nothing to do
+ }
+ }
public SWTBotTreeItem findServerByName(SWTBotTree tree, String name) {
for (SWTBotTreeItem i : tree.getAllItems()) {
Show replies by date