Author: vpakan(a)redhat.com
Date: 2010-11-24 03:59:38 -0500 (Wed, 24 Nov 2010)
New Revision: 26869
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
Log:
Check Perspective existence correctly.
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 2010-11-24
08:37:08 UTC (rev 26868)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2010-11-24
08:59:38 UTC (rev 26869)
@@ -201,13 +201,16 @@
SWTBotMenu menu2 = menu1.menu(IDELabel.Menu.OPEN_PERSPECTIVE);
bot.sleep(Timing.time1S());
menu2.menu(IDELabel.Menu.OTHER).click();
- bot.sleep(Timing.time1S());
- try {
- bot.table().select(perspectiveLabel);
- } catch (WidgetNotFoundException e) {
- log.warn("WARN - Perspecive with label " + perspectiveLabel + " not
found, try + (default)");
- bot.table().select(perspectiveLabel + (" (default)"));
+ bot.sleep(Timing.time1S());
+ SWTBotTable table = bot.table();
+ if (isItemInTableColumn(table, perspectiveLabel, 0)){
+ table.select(perspectiveLabel);
}
+ else{
+ log.warn("WARN - Perspecive with label '" + perspectiveLabel +
"' was not found, trying label '"
+ + perspectiveLabel + " (default)'");
+ table.select(perspectiveLabel + (" (default)"));
+ }
bot.sleep(Timing.time1S());
// Another approach
SWTBotShell openPerpectiveShell = bot.shell("Open Perspective");
@@ -398,7 +401,7 @@
*/
public void assertSameContent(String pluginId, String projectName,
String... path) {
- File file = util.getResourceFile(pluginId, path);
+ File file = SWTUtilExt.getResourceFile(pluginId, path);
String resourceContent = SWTTestExt.util.readTextFile(file);
openAsText(projectName, path);
@@ -439,7 +442,7 @@
SWTBotEclipseEditor editor;
editor = bot.editorByTitle(path[path.length - 1]).toTextEditor();
editor.selectRange(0, 0, editor.getLineCount());
- File file = util.getResourceFile(pluginId, path);
+ File file = SWTUtilExt.getResourceFile(pluginId, path);
String content = util.readTextFile(file);
editor.setText(content);
if (save)
@@ -457,7 +460,7 @@
String pluginId, String... path) {
SWTBotEclipseEditor edit = editor.toTextEditor();
edit.selectRange(0, 0, edit.getText().length());
- File file = util.getResourceFile(pluginId, path);
+ File file = SWTUtilExt.getResourceFile(pluginId, path);
String content = util.readTextFile(file);
edit.setText(content);
if (save)
Show replies by date