lttng.swtbot: Add test for closing and opening histogram
[deliverable/tracecompass.git] / lttng / org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests / src / org / eclipse / tracecompass / lttng2 / kernel / ui / swtbot / tests / ImportAndReadKernelSmokeTest.java
index 8ebf6e0c971c5b09ba6b65043787a06808b60c48..c6524c9f7fea23db0bc252f79fb652f33b8a78a2 100644 (file)
@@ -43,6 +43,7 @@ import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IEditorReference;
 import org.eclipse.ui.IViewPart;
 import org.eclipse.ui.IViewReference;
+import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
 import org.hamcrest.Matcher;
 import org.junit.Test;
@@ -100,6 +101,17 @@ public class ImportAndReadKernelSmokeTest extends KernelTestBase {
         HistogramView hv = (HistogramView) vp;
         final TmfSelectionRangeUpdatedSignal signal = new TmfSelectionRangeUpdatedSignal(hv, fDesired1.getTimestamp());
         final TmfSelectionRangeUpdatedSignal signal2 = new TmfSelectionRangeUpdatedSignal(hv, fDesired2.getTimestamp());
+        hvBot.close();
+        hv = (HistogramView) UIThreadRunnable.syncExec(() -> {
+            try {
+                return (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(HistogramView.ID));
+            } catch (PartInitException e) {
+                // Do nothing, returning null fails
+            }
+            return null;
+        });
+        assertNotNull(hv);
+        hvBot = (new SWTWorkbenchBot()).viewById(HistogramView.ID);
         hv.updateTimeRange(100000);
         WaitUtils.waitForJobs();
         hv.selectionRangeUpdated(signal);
This page took 0.027259 seconds and 5 git commands to generate.