[jbosstools-commits] JBoss Tools SVN: r42665 - 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
Mon Jul 23 04:55:02 EDT 2012


Author: vpakan at redhat.com
Date: 2012-07-23 04:55:00 -0400 (Mon, 23 Jul 2012)
New Revision: 42665

Modified:
   trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java
Log:
Handle errors from "widget".toString() method.

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-07-20 17:55:49 UTC (rev 42664)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java	2012-07-23 08:55:00 UTC (rev 42665)
@@ -667,7 +667,13 @@
   public static void displayAllBotWidgets (SWTBot bot){
     List<?> widgets = bot.widgets(new SWTUtilExt.AlwaysMatchMatcher<Widget>());
     for (Object object : widgets){
-      System.out.println(object + 
+      String objectToString;
+      try{
+        objectToString = object.toString(); 
+      } catch (Throwable t){
+        objectToString = "<null>";
+      }
+      System.out.println(objectToString  +  
         " Text: " + SWTUtilExt.invokeMethod(object, "getText") +
         " Tooltip: " + SWTUtilExt.invokeMethod(object, "getToolTipText"));
     }



More information about the jbosstools-commits mailing list