Search in sources :

Example 1 with OnDemandAnalysisStub

use of org.eclipse.tracecompass.tmf.tests.stubs.analysis.ondemand.OnDemandAnalysisStub in project tracecompass by tracecompass.

the class OnDemandAnalysisTest method testGetAnalysisFromTrace.

/**
 * Test getting an analysis via the manager. The expected way of doing
 * things.
 */
@Test
public void testGetAnalysisFromTrace() {
    ITmfTrace trace = fTraceThatApplies;
    assertNotNull(trace);
    Set<IOnDemandAnalysis> set1 = OnDemandAnalysisManager.getInstance().getOndemandAnalyses(trace);
    assertEquals(1, set1.size());
    assertTrue(Iterables.getOnlyElement(set1) instanceof OnDemandAnalysisStub);
    /* Make sure it is still true on a subsequent call */
    Set<IOnDemandAnalysis> set2 = OnDemandAnalysisManager.getInstance().getOndemandAnalyses(trace);
    assertTrue(set1.equals(set2));
}
Also used : ITmfTrace(org.eclipse.tracecompass.tmf.core.trace.ITmfTrace) IOnDemandAnalysis(org.eclipse.tracecompass.tmf.core.analysis.ondemand.IOnDemandAnalysis) OnDemandAnalysisStub(org.eclipse.tracecompass.tmf.tests.stubs.analysis.ondemand.OnDemandAnalysisStub) Test(org.junit.Test)

Aggregations

IOnDemandAnalysis (org.eclipse.tracecompass.tmf.core.analysis.ondemand.IOnDemandAnalysis)1 ITmfTrace (org.eclipse.tracecompass.tmf.core.trace.ITmfTrace)1 OnDemandAnalysisStub (org.eclipse.tracecompass.tmf.tests.stubs.analysis.ondemand.OnDemandAnalysisStub)1 Test (org.junit.Test)1