[jbosstools-commits] JBoss Tools SVN: r42910 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Wed Aug 8 06:33:58 EDT 2012


Author: vpakan at redhat.com
Date: 2012-08-08 06:33:57 -0400 (Wed, 08 Aug 2012)
New Revision: 42910

Modified:
   trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java
Log:
Add method waitForShellWithTextIsFound()

Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java	2012-08-08 10:30:50 UTC (rev 42909)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java	2012-08-08 10:33:57 UTC (rev 42910)
@@ -1110,4 +1110,37 @@
       },
       timeout);
     }
+    /**
+     * Waits until shell with text is found with timeout  
+     * @param text
+     * @param timeout
+     */
+    public void waitForShellWithTextIsFound (final String text, final long timeout) {
+      bot.waitUntil(new ICondition() {
+        
+        @Override
+        public boolean test() throws Exception {
+          boolean shellIsFound = false;
+          try {
+            bot.shell(text);
+            shellIsFound = true;
+          }
+          catch (WidgetNotFoundException wnfe){
+            shellIsFound = false;
+          }
+          return shellIsFound;
+        }
+        
+        @Override
+        public void init(SWTBot bot) {
+        }
+        
+        @Override
+        public String getFailureMessage() {
+          return "Shell with text " + text +
+              " was not available " + timeout + " miliseconds";
+        }
+      },
+      timeout);
+    }
 }
\ No newline at end of file



More information about the jbosstools-commits mailing list