Author: ljelinko
Date: 2012-02-13 11:18:17 -0500 (Mon, 13 Feb 2012)
New Revision: 38659
Added:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/condition/TreeContainsNode.java
Log:
Created
Added:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/condition/TreeContainsNode.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/condition/TreeContainsNode.java
(rev 0)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/condition/TreeContainsNode.java 2012-02-13
16:18:17 UTC (rev 38659)
@@ -0,0 +1,40 @@
+package org.jboss.tools.ui.bot.ext.condition;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.waits.ICondition;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+
+public class TreeContainsNode implements ICondition {
+
+ private SWTBotTree tree;
+
+ private String[] path;
+
+ public TreeContainsNode(SWTBotTree tree, String... path) {
+ this.tree = tree;
+ this.path = path;
+ }
+
+ @Override
+ public void init(SWTBot bot) {
+
+ }
+
+ @Override
+ public boolean test() throws Exception {
+ try {
+ tree.expandNode(path);
+ System.out.println("TRUE");
+ return true;
+ } catch (WidgetNotFoundException e){
+ System.out.println("FALSE");
+ return false;
+ }
+ }
+
+ @Override
+ public String getFailureMessage() {
+ return "Expected tree node " + path[path.length -1] + " to become
visible ";
+ }
+}
Show replies by date