use of org.eclipse.tracecompass.tmf.core.signal.TmfTraceClosedSignal in project tracecompass by tracecompass.
the class TmfEventsEditor method dispose.
@Override
public void dispose() {
if (getSite() != null) {
getSite().getPage().removePartListener(this);
}
ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
removePropertyListener(this);
if (fTrace != null) {
broadcast(new TmfTraceClosedSignal(this, fTrace));
if (fEventsTable != null) {
saveState();
}
}
super.dispose();
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfTraceClosedSignal in project tracecompass by tracecompass.
the class Uml2SDTestFacility method disposeExperiment.
/**
* Disposes the experiment.
*/
public void disposeExperiment() {
TmfExperiment experiment = fExperiment;
if (experiment == null) {
throw new IllegalStateException();
}
experiment.broadcast(new TmfTraceClosedSignal(this, experiment));
experiment.dispose();
delay(IUml2SDTestConstants.GUI_REFESH_DELAY);
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfTraceClosedSignal in project tracecompass by tracecompass.
the class TimeGraphViewTest method after.
/**
* Clean up after a test, reset the views and reset the states of the
* timegraph by pressing reset on all the resets of the legend
*/
@After
public void after() {
// reset all
fViewBot.toolbarButton(SHOW_LEGEND).click();
SWTBotShell legendShell = fBot.shell(LEGEND_NAME);
SWTBot legendBot = legendShell.bot();
for (int i = 0; i < StubPresentationProvider.STATES.length; i++) {
SWTBotButton resetButton = legendBot.button(i);
if (resetButton.isEnabled()) {
resetButton.click();
}
}
legendBot.button(OK_BUTTON).click();
TmfTraceStub trace = fTrace;
assertNotNull(trace);
UIThreadRunnable.syncExec(() -> TmfSignalManager.dispatchSignal(new TmfTraceClosedSignal(this, trace)));
fBot.waitUntil(Conditions.shellCloses(legendShell));
fViewBot.close();
fBot.waitUntil(ConditionHelpers.viewIsClosed(fViewBot));
fTrace.dispose();
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfTraceClosedSignal in project tracecompass by tracecompass.
the class XYChartViewTest method after.
/**
* Clean up after a test, reset the views.
*/
@After
public void after() {
TmfTraceStub trace = fTrace;
assertNotNull(trace);
UIThreadRunnable.syncExec(() -> TmfSignalManager.dispatchSignal(new TmfTraceClosedSignal(this, trace)));
fViewBot.close();
fBot.waitUntil(ConditionHelpers.viewIsClosed(fViewBot));
fTrace.dispose();
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfTraceClosedSignal in project tracecompass by tracecompass.
the class XmlDataProviderManagerTest method testExperiment.
/**
* Test getting the XML data provider for an experiment, with an analysis that
* applies to an experiment
*/
@Test
public void testExperiment() {
ITmfTrace trace = null;
ITmfTrace trace2 = null;
ITmfTrace experiment = null;
try {
// Initialize the trace and module
trace = XmlUtilsTest.initializeTrace(TEST_TRACE);
trace2 = XmlUtilsTest.initializeTrace(TEST_TRACE2);
ITmfTrace[] traces = { trace, trace2 };
experiment = new TmfExperiment(ITmfEvent.class, "Xml Experiment", traces, TmfExperiment.DEFAULT_INDEX_PAGE_SIZE, null);
TmfTraceOpenedSignal signal = new TmfTraceOpenedSignal(this, experiment, null);
((TmfTrace) trace).traceOpened(signal);
((TmfTrace) trace2).traceOpened(signal);
((TmfTrace) experiment).traceOpened(signal);
// The data provider manager uses opened traces from the manager
TmfTraceManager.getInstance().traceOpened(signal);
Iterable<@NonNull DataDrivenAnalysisModule> modules = TmfTraceUtils.getAnalysisModulesOfClass(experiment, DataDrivenAnalysisModule.class);
modules.forEach(module -> {
module.schedule();
assertTrue(module.waitForCompletion());
});
// Get the view element from the file
Element viewElement = TmfXmlUtils.getElementInFile(TmfXmlTestFiles.EXPERIMENT.getPath().toOSString(), TmfXmlStrings.TIME_GRAPH_VIEW, EXPERIMENT_VIEW_ID);
assertNotNull(viewElement);
ITimeGraphDataProvider<@NonNull TimeGraphEntryModel> timeGraphProvider = XmlDataProviderManager.getInstance().getTimeGraphProvider(experiment, viewElement);
assertNotNull(timeGraphProvider);
assertFalse(timeGraphProvider instanceof TmfTimeGraphCompositeDataProvider);
} finally {
if (trace != null) {
trace.dispose();
}
if (trace2 != null) {
trace2.dispose();
}
if (experiment != null) {
experiment.dispose();
TmfTraceManager.getInstance().traceClosed(new TmfTraceClosedSignal(this, experiment));
}
}
}
Aggregations