btf: fix order of modifiers in BtfEventPropertySource
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests / src / org / eclipse / tracecompass / tmf / ctf / ui / swtbot / tests / AbstractImportAndReadSmokeTest.java
index 465304f05941ecb016386fcd5ab9c0c892a25d9f..16f4de2b25ba2ddf4bfb7f8423d45bfdd3f3a276 100644 (file)
@@ -20,7 +20,6 @@ import java.util.List;
 
 import org.apache.log4j.Logger;
 import org.apache.log4j.varia.NullAppender;
-import org.eclipse.core.runtime.IPath;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.wizard.Wizard;
@@ -39,18 +38,14 @@ import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
 import org.eclipse.tracecompass.tmf.core.signal.TmfTimeSynchSignal;
 import org.eclipse.tracecompass.tmf.core.trace.ITmfContext;
-import org.eclipse.tracecompass.tmf.ctf.core.CtfTmfEvent;
-import org.eclipse.tracecompass.tmf.ctf.core.CtfTmfTrace;
+import org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEvent;
 import org.eclipse.tracecompass.tmf.ctf.core.tests.shared.CtfTmfTestTrace;
+import org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace;
 import org.eclipse.tracecompass.tmf.ui.editors.TmfEventsEditor;
-import org.eclipse.tracecompass.tmf.ui.project.model.TmfTracesFolder;
-import org.eclipse.tracecompass.tmf.ui.swtbot.tests.SWTBotUtil;
-import org.eclipse.tracecompass.tmf.ui.swtbot.tests.conditions.ConditionHelpers;
+import org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.ConditionHelpers;
+import org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotUtils;
 import org.eclipse.tracecompass.tmf.ui.views.histogram.HistogramView;
 import org.eclipse.tracecompass.tmf.ui.views.statistics.TmfStatisticsView;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IPageLayout;
 import org.eclipse.ui.IViewPart;
 import org.eclipse.ui.IViewReference;
 import org.eclipse.ui.PlatformUI;
@@ -87,25 +82,25 @@ public abstract class AbstractImportAndReadSmokeTest {
     @BeforeClass
     public static void init() {
         assumeTrue(fTrace.exists());
-        SWTBotUtil.failIfUIThread();
+        SWTBotUtils.failIfUIThread();
 
         /* set up for swtbot */
         SWTBotPreferences.TIMEOUT = 50000; /* 50 second timeout */
         fLogger.addAppender(new NullAppender());
         fBot = new SWTWorkbenchBot();
 
-        SWTBotUtil.closeView("welcome", fBot);
+        SWTBotUtils.closeView("welcome", fBot);
 
-        SWTBotUtil.switchToTracingPerspective();
+        SWTBotUtils.switchToTracingPerspective();
         /* finish waiting for eclipse to load */
-        SWTBotUtil.waitForJobs();
+        SWTBotUtils.waitForJobs();
     }
 
     /**
      * Creates a tracing projects
      */
     protected void createProject() {
-        SWTBotUtil.focusMainWindow(fBot.shells());
+        SWTBotUtils.focusMainWindow(fBot.shells());
         fBot.menu("File").menu("New").menu("Project...").click();
 
         fBot.shell("New Project").setFocus();
@@ -133,71 +128,7 @@ public abstract class AbstractImportAndReadSmokeTest {
         text.setText(getProjectName());
 
         fBot.button("Finish").click();
-        SWTBotUtil.waitForJobs();
-    }
-
-    /**
-     * Opens and get the TmfEventsEditor
-     *
-     * @param elementPath
-     *            the trace element path (relative to Traces folder)
-     * @return TmfEventsEditor
-     */
-    protected TmfEventsEditor openEditor(IPath elementPath) {
-        final SWTBotView projectExplorerBot = fBot.viewById(IPageLayout.ID_PROJECT_EXPLORER);
-        projectExplorerBot.setFocus();
-
-        final SWTBotTree tree = fBot.tree();
-        final SWTBotTreeItem treeItem = tree.getTreeItem(getProjectName());
-        treeItem.expand();
-
-        String nodeName = getFullNodeName(treeItem, TmfTracesFolder.TRACES_FOLDER_NAME);
-        fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(nodeName, treeItem));
-        SWTBotTreeItem tracesNode = treeItem.getNode(nodeName);
-        tracesNode.expand();
-
-        SWTBotTreeItem currentNode = tracesNode;
-        for (String segment : elementPath.segments()) {
-            String fullNodeName = getFullNodeName(currentNode, segment);
-            fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(fullNodeName, currentNode));
-            SWTBotTreeItem newNode = currentNode.getNode(fullNodeName);
-            newNode.select();
-            newNode.doubleClick();
-            currentNode = newNode;
-        }
-
-        SWTBotUtil.delay(1000);
-        SWTBotUtil.waitForJobs();
-        final String expectedTitle = elementPath.toString();
-
-        final IEditorPart iep[] = new IEditorPart[1];
-        UIThreadRunnable.syncExec(new VoidResult() {
-            @Override
-            public void run() {
-                IEditorReference[] ieds = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences();
-                assertNotNull(ieds);
-                iep[0] = null;
-                for (IEditorReference ied : ieds) {
-                    if (ied.getTitle().equals(expectedTitle)) {
-                        iep[0] = ied.getEditor(true);
-                        break;
-                    }
-                }
-            }
-        });
-        assertNotNull(iep[0]);
-        return (TmfEventsEditor) iep[0];
-    }
-
-    private static String getFullNodeName(final SWTBotTreeItem treeItem, String prefix) {
-        List<String> nodes = treeItem.getNodes();
-        String nodeName = "";
-        for (String node : nodes) {
-            if (node.startsWith(prefix)) {
-                nodeName = node;
-            }
-        }
-        return nodeName;
+        SWTBotUtils.waitForJobs();
     }
 
     /**
@@ -208,7 +139,7 @@ public abstract class AbstractImportAndReadSmokeTest {
         final SWTBotButton finishButton = fBot.button("Finish");
         finishButton.click();
         fBot.waitUntil(Conditions.shellCloses(shell));
-        SWTBotUtil.waitForJobs();
+        SWTBotUtils.waitForJobs();
     }
 
     /**
@@ -249,8 +180,8 @@ public abstract class AbstractImportAndReadSmokeTest {
             }
         });
 
-        SWTBotUtil.waitForJobs();
-        SWTBotUtil.delay(1000);
+        SWTBotUtils.waitForJobs();
+        SWTBotUtils.delay(1000);
 
         final CtfTmfEvent desiredEvent2 = getEvent(10000);
         SWTBotView hvBot = fBot.viewById(HistogramView.ID);
@@ -264,18 +195,18 @@ public abstract class AbstractImportAndReadSmokeTest {
         final TmfTimeSynchSignal signal = new TmfTimeSynchSignal(hv, desiredEvent1.getTimestamp());
         final TmfTimeSynchSignal signal2 = new TmfTimeSynchSignal(hv, desiredEvent2.getTimestamp());
         hv.updateTimeRange(100000);
-        SWTBotUtil.waitForJobs();
+        SWTBotUtils.waitForJobs();
         hv.currentTimeUpdated(signal);
         hv.broadcast(signal);
-        SWTBotUtil.waitForJobs();
-        SWTBotUtil.delay(1000);
+        SWTBotUtils.waitForJobs();
+        SWTBotUtils.delay(1000);
 
         hv.updateTimeRange(1000000000);
-        SWTBotUtil.waitForJobs();
+        SWTBotUtils.waitForJobs();
         hv.currentTimeUpdated(signal2);
         hv.broadcast(signal2);
-        SWTBotUtil.waitForJobs();
-        SWTBotUtil.delay(1000);
+        SWTBotUtils.waitForJobs();
+        SWTBotUtils.delay(1000);
         assertNotNull(hv);
     }
 
This page took 0.036654 seconds and 5 git commands to generate.