swtbot: Add some failure messages to test conditions
authorPatrick Tasse <patrick.tasse@gmail.com>
Tue, 15 Sep 2015 19:16:05 +0000 (15:16 -0400)
committerPatrick Tasse <patrick.tasse@gmail.com>
Fri, 2 Oct 2015 12:41:05 +0000 (08:41 -0400)
Change-Id: I725b75e7f66447532b3eacd5bd86518ebfee8c8c
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/56017
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/shared/org/eclipse/tracecompass/tmf/ui/swtbot/tests/shared/ConditionHelpers.java

index 26f944d7fb89183a58412c24cbb200a9ddf9b051..5af7e4fbc357f342bbb0cb76f23857669084d6d1 100644 (file)
@@ -17,6 +17,8 @@ package org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared;
 
 import static org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory.withPartName;
 
+import java.util.Arrays;
+
 import org.eclipse.jface.wizard.IWizardContainer;
 import org.eclipse.jface.wizard.IWizardPage;
 import org.eclipse.jface.wizard.Wizard;
@@ -87,6 +89,12 @@ public final class ConditionHelpers {
                 }
                 return false;
             }
+
+            @Override
+            public String getFailureMessage() {
+                return NLS.bind("No child of tree {0} found with text '{1}'. Child items: {2}",
+                        new String[] { tree.toString(), name, Arrays.toString(tree.getAllItems()) });
+            }
         };
     }
 
@@ -109,6 +117,11 @@ public final class ConditionHelpers {
                 }
                 return false;
             }
+
+            @Override
+            public String getFailureMessage() {
+                return NLS.bind("No child of table {0} found with text '{1}'.", table, name);
+            }
         };
     }
 
@@ -131,6 +144,12 @@ public final class ConditionHelpers {
                 }
                 return false;
             }
+
+            @Override
+            public String getFailureMessage() {
+                return NLS.bind("No child of tree item {0} found with text '{1}'. Child items: {2}",
+                        new String[] { treeItem.toString(), name, Arrays.toString(treeItem.getItems()) });
+            }
         };
     }
 
This page took 0.038713 seconds and 5 git commands to generate.