Revert "Revert "ctf: Fix slow test due to expected timeout""
authorMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Thu, 3 Mar 2016 23:25:58 +0000 (18:25 -0500)
committerMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Fri, 4 Mar 2016 14:29:40 +0000 (09:29 -0500)
This reverts commit 1ae81c23b427deeec3266e4755e9122ddcd0cf81.

This almost worked before but it needed to use withMnemonic not
withLabel!

Original message:
The test was looking for a possible checkbox (in 4.6) but when it it was
not there (4.5) it had to wait 50 secs for it to time out. Instead we
can set a very short timeout because it will instantly either be there
or not.

Change-Id: I84f6db70a323611b1adb93c6d9b55801bbeb7444
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/67782
Reviewed-by: Hudson CI
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
ctf/org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests/META-INF/MANIFEST.MF
ctf/org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ctf/ui/swtbot/tests/StandardImportAndReadSmokeTest.java

index 078b84bd12cddb912247f69e4a70caa270338358..27f6e4acc8c239e55f9db4f572201dc795dab124 100644 (file)
@@ -27,6 +27,7 @@ Import-Package: org.apache.log4j,
  org.eclipse.swtbot.swt.finder.exceptions,
  org.eclipse.swtbot.swt.finder.finders,
  org.eclipse.swtbot.swt.finder.junit,
+ org.eclipse.swtbot.swt.finder.matchers,
  org.eclipse.swtbot.swt.finder.results,
  org.eclipse.swtbot.swt.finder.utils,
  org.eclipse.swtbot.swt.finder.waits,
index 8aabb21db37d62e49ac8627dc6ec8c1b7b8a4c4f..7e6275e912315c80bef2450f6db66ea12d8b40ee 100644 (file)
@@ -13,6 +13,7 @@
 
 package org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests;
 
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withMnemonic;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
@@ -40,7 +41,6 @@ import org.eclipse.core.runtime.URIUtil;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.wizard.WizardDialog;
 import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
 import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
 import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
 import org.eclipse.swtbot.swt.finder.results.VoidResult;
@@ -54,6 +54,7 @@ import org.eclipse.swtbot.swt.finder.widgets.SWTBotTableItem;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.eclipse.swtbot.swt.finder.widgets.TimeoutException;
 import org.eclipse.tracecompass.internal.tmf.ui.project.wizards.importtrace.ImportTraceWizard;
 import org.eclipse.tracecompass.internal.tmf.ui.project.wizards.importtrace.ImportTraceWizardPage;
 import org.eclipse.tracecompass.internal.tmf.ui.project.wizards.importtrace.Messages;
@@ -521,8 +522,10 @@ public class StandardImportAndReadSmokeTest extends AbstractImportAndReadSmokeTe
         fBot.button("Next >").click();
         fBot.button("&Deselect All").click();
         try {
-            fBot.checkBox("Resolve and export linked resources").select();
-        } catch (WidgetNotFoundException e) {
+            String resolveLinkedResLabel = "Resolve and export linked resources";
+            fBot.waitUntil(Conditions.waitForWidget(withMnemonic(resolveLinkedResLabel)), 100);
+            fBot.checkBox(resolveLinkedResLabel).select();
+        } catch (TimeoutException e) {
             // Ignore, doesn't exist pre-4.6M5
         }
 
This page took 0.026591 seconds and 5 git commands to generate.