Author: vpakan(a)redhat.com
Date: 2011-08-16 07:35:12 -0400 (Tue, 16 Aug 2011)
New Revision: 33968
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/SWTUtilExt.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/TextEditingActionsTest.java
Log:
Fix formating of displayed errors in Errors view.
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 2011-08-16
10:31:53 UTC (rev 33967)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2011-08-16
11:35:12 UTC (rev 33968)
@@ -27,6 +27,7 @@
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Tree;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory;
import org.eclipse.swtbot.eclipse.finder.waits.Conditions;
@@ -1287,10 +1288,12 @@
}
return sb.toString();
}
- public static String getFormattedTreeNodeText (SWTBotTree tree, SWTBotTreeItem item){
+ public static String getFormattedTreeNodeText (SWTBotTreeItem item){
StringBuilder stringBuilder = new StringBuilder("");
if (item != null){
+ SWTBotTree tree =
+ new SWTBotTree((Tree)SWTUtilExt.invokeMethodReturnObject(item.widget,
"getParent"));
for (int column = 0 ; column < tree.columnCount(); column++){
if (column > 0){
stringBuilder.append(" - ");
@@ -1309,7 +1312,7 @@
}
- public static String getFormattedTreeNodesText (SWTBotTree tree, SWTBotTreeItem[]
items){
+ public static String getFormattedTreeNodesText (SWTBotTreeItem[] items){
StringBuilder stringBuilder = new StringBuilder("");
if (items != null){
@@ -1317,7 +1320,7 @@
if (stringBuilder.length() > 0){
stringBuilder.append("\n");
}
- stringBuilder.append(SWTEclipseExt.getFormattedTreeNodeText(tree,item));
+ stringBuilder.append(SWTEclipseExt.getFormattedTreeNodeText(item));
}
}
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 2011-08-16
10:31:53 UTC (rev 33967)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java 2011-08-16
11:35:12 UTC (rev 33968)
@@ -769,6 +769,28 @@
return result;
}
/**
+ * Invoke method on object and returns result as Object
+ * @param object
+ * @param method
+ * @return
+ */
+ public static Object invokeMethodReturnObject (Object object, String method){
+
+ String result = "<null>";
+
+ try {
+ return SWTUtils.invokeMethod(object, method);
+ } catch (NoSuchMethodException e) {
+ result = "<null>";
+ } catch (IllegalAccessException e) {
+ result = "<null>";
+ } catch (InvocationTargetException e) {
+ result = "<null>";
+ }
+
+ return result;
+ }
+ /**
* Returns location of file within plugin
* @param pluginId
* @param fileName
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/TextEditingActionsTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/TextEditingActionsTest.java 2011-08-16
10:31:53 UTC (rev 33967)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/TextEditingActionsTest.java 2011-08-16
11:35:12 UTC (rev 33968)
@@ -299,7 +299,7 @@
assertTrue("There were these errors when editing page "
+ TextEditingActionsTest.TEST_PAGE_NAME
+ ": "
- + SWTEclipseExt.getFormattedTreeNodesText(bot.tree(), errors),
+ + SWTEclipseExt.getFormattedTreeNodesText(errors),
errors == null || errors.length == 0);
}
}