Search in sources :

Example 6 with TmfTraceClosedSignal

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();
}
Also used : TmfTraceClosedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfTraceClosedSignal)

Example 7 with TmfTraceClosedSignal

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);
}
Also used : TmfExperiment(org.eclipse.tracecompass.tmf.core.trace.experiment.TmfExperiment) TmfTraceClosedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfTraceClosedSignal)

Example 8 with TmfTraceClosedSignal

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();
}
Also used : SWTBotButton(org.eclipse.swtbot.swt.finder.widgets.SWTBotButton) SWTBot(org.eclipse.swtbot.swt.finder.SWTBot) SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell) TmfTraceStub(org.eclipse.tracecompass.tmf.tests.stubs.trace.TmfTraceStub) TmfTraceClosedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfTraceClosedSignal) Point(org.eclipse.swt.graphics.Point) After(org.junit.After)

Example 9 with TmfTraceClosedSignal

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();
}
Also used : TmfTraceStub(org.eclipse.tracecompass.tmf.tests.stubs.trace.TmfTraceStub) TmfTraceClosedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfTraceClosedSignal) After(org.junit.After)

Example 10 with TmfTraceClosedSignal

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));
        }
    }
}
Also used : Element(org.w3c.dom.Element) ITmfEvent(org.eclipse.tracecompass.tmf.core.event.ITmfEvent) TmfTraceClosedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfTraceClosedSignal) ITmfTrace(org.eclipse.tracecompass.tmf.core.trace.ITmfTrace) TmfTimeGraphCompositeDataProvider(org.eclipse.tracecompass.internal.tmf.core.model.timegraph.TmfTimeGraphCompositeDataProvider) TmfTrace(org.eclipse.tracecompass.tmf.core.trace.TmfTrace) ITmfTrace(org.eclipse.tracecompass.tmf.core.trace.ITmfTrace) TmfExperiment(org.eclipse.tracecompass.tmf.core.trace.experiment.TmfExperiment) TimeGraphEntryModel(org.eclipse.tracecompass.tmf.core.model.timegraph.TimeGraphEntryModel) TmfTraceOpenedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfTraceOpenedSignal) DataDrivenAnalysisModule(org.eclipse.tracecompass.internal.tmf.analysis.xml.core.fsm.module.DataDrivenAnalysisModule) Test(org.junit.Test)

Aggregations

TmfTraceClosedSignal (org.eclipse.tracecompass.tmf.core.signal.TmfTraceClosedSignal)16 ITmfTrace (org.eclipse.tracecompass.tmf.core.trace.ITmfTrace)10 Test (org.junit.Test)10 Element (org.w3c.dom.Element)10 TimeGraphEntryModel (org.eclipse.tracecompass.tmf.core.model.timegraph.TimeGraphEntryModel)7 TmfTraceOpenedSignal (org.eclipse.tracecompass.tmf.core.signal.TmfTraceOpenedSignal)5 TmfTrace (org.eclipse.tracecompass.tmf.core.trace.TmfTrace)4 TmfExperiment (org.eclipse.tracecompass.tmf.core.trace.experiment.TmfExperiment)4 ITmfTreeDataModel (org.eclipse.tracecompass.tmf.core.model.tree.ITmfTreeDataModel)3 AnalysisCompilationData (org.eclipse.tracecompass.internal.tmf.analysis.xml.core.fsm.compile.AnalysisCompilationData)2 DataDrivenAnalysisModule (org.eclipse.tracecompass.internal.tmf.analysis.xml.core.fsm.module.DataDrivenAnalysisModule)2 ITmfStateSystem (org.eclipse.tracecompass.statesystem.core.ITmfStateSystem)2 ITmfAnalysisModuleWithStateSystems (org.eclipse.tracecompass.tmf.core.statesystem.ITmfAnalysisModuleWithStateSystems)2 TmfTraceStub (org.eclipse.tracecompass.tmf.tests.stubs.trace.TmfTraceStub)2 After (org.junit.After)2 HashMultiset (com.google.common.collect.HashMultiset)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 Iterables (com.google.common.collect.Iterables)1 Multiset (com.google.common.collect.Multiset)1 File (java.io.File)1