import org.eclipse.swtbot.swt.finder.waits.Conditions;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
import org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotUtils;
+import org.eclipse.tracecompass.tmf.ui.tests.shared.WaitUtils;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
private static final String PROJECT_NAME = "Test";
private static final String XMLSTUB_ID = "org.eclipse.linuxtools.tmf.core.tests.xmlstub";
- /*
- * FIXME: bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=477508, we
- * shouldn't need so many events.
- */
private static final String TRACE_CONTENT = "<trace>" +
"<event timestamp=\"100\" name=\"event\"><field name=\"field\" value=\"1\" type=\"int\" /></event>" +
"<event timestamp=\"200\" name=\"event1\"><field name=\"field\" value=\"2\" type=\"int\" /></event>" +
SWTBotUtils.switchToTracingPerspective();
/* finish waiting for eclipse to load */
- SWTBotUtils.waitForJobs();
+ WaitUtils.waitForJobs();
}
assertTrue("Trace :" + f.getAbsolutePath() + " does not exist, aborting test", f.exists());
SWTBotUtils.createProject(PROJECT_NAME);
SWTBotUtils.openTrace(PROJECT_NAME, f.getAbsolutePath(), XMLSTUB_ID);
- SWTBotUtils.waitForJobs();
- assertEquals("Incorrect opened trace!", f.getAbsolutePath(), (new File(TmfTraceManager.getInstance().getActiveTrace().getPath())).getAbsolutePath());
+ WaitUtils.waitForJobs();
+ ITmfTrace trace = TmfTraceManager.getInstance().getActiveTrace();
+ assertNotNull(trace);
+ assertEquals("Incorrect opened trace!", f.getAbsolutePath(), (new File(trace.getPath())).getAbsolutePath());
SWTBotView projectExplorerBot = fBot.viewByTitle(PROJECT_EXPLORER);
assertNotNull("Cannot find " + PROJECT_EXPLORER, projectExplorerBot);
projectExplorerBot.show();
SWTBotShell shell = fBot.activeShell();
shellBot.button(FINISH).click();
// finished exporting
- SWTBotUtils.waitForJobs();
+ WaitUtils.waitForJobs();
fBot.waitUntil(Conditions.shellCloses(shell));
fBot = new SWTWorkbenchBot();
exportPackage = new File(EXPORT_LOCATION);
fBot.waitUntil(Conditions.shellCloses(shell));
fBot = new SWTWorkbenchBot();
SWTBotUtils.openEditor(fBot, PROJECT_NAME, new Path(f.getName()));
- assertEquals("Test if import matches", f.getName(), TmfTraceManager.getInstance().getActiveTrace().getName());
- assertFalse("Test if import files don't match", f.getAbsolutePath().equals(TmfTraceManager.getInstance().getActiveTrace().getPath()));
+ trace = TmfTraceManager.getInstance().getActiveTrace();
+ assertNotNull(trace);
+ assertEquals("Test if import matches", f.getName(), trace.getName());
+ assertFalse("Test if import files don't match", f.getAbsolutePath().equals(trace.getPath()));
SWTBotUtils.deleteProject(PROJECT_NAME, fBot);
- SWTBotUtils.waitForJobs();
+ WaitUtils.waitForJobs();
}
}