Search in sources :

Example 31 with TmfExperiment

use of org.eclipse.tracecompass.tmf.core.trace.experiment.TmfExperiment in project tracecompass by tracecompass.

the class TmfTraceManagerTest method testExperimentTimestampInBetween.

/**
 * Test in an experiment when we select a timestamp that is between two
 * traces in the experiment.
 *
 * The experiment's current time should still be updated, since the
 * timestamp is valid in the experiment itself.
 */
@Test
public void testExperimentTimestampInBetween() {
    TmfExperiment exp = createExperiment(trace1, trace2);
    openTrace(exp);
    ITmfTimestamp ts = TmfTimestamp.fromNanos(t1end + ONE_SECOND);
    selectTimestamp(ts);
    /* The experiment's current time should be updated. */
    TmfTimeRange selection = tm.getCurrentTraceContext().getSelectionRange();
    assertEquals(ts, selection.getStartTime());
    assertEquals(ts, selection.getEndTime());
}
Also used : TmfExperiment(org.eclipse.tracecompass.tmf.core.trace.experiment.TmfExperiment) ITmfTimestamp(org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp) TmfTimeRange(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange) Test(org.junit.Test)

Example 32 with TmfExperiment

use of org.eclipse.tracecompass.tmf.core.trace.experiment.TmfExperiment in project tracecompass by tracecompass.

the class TmfTraceManagerTest method testTraceSetWithExperiment.

/**
 * Test the contents of the complete trace set.
 */
@Test
public void testTraceSetWithExperiment() {
    final ITmfTrace localTrace1 = trace1;
    final ITmfTrace localTrace2 = trace2;
    assertNotNull(localTrace1);
    assertNotNull(localTrace2);
    /* Test with a trace */
    Collection<ITmfTrace> expected = Collections.singleton(localTrace1);
    Collection<ITmfTrace> actual = TmfTraceManager.getTraceSetWithExperiment(localTrace1);
    assertEquals(1, actual.size());
    assertEquals(expected, actual);
    /* Test with an experiment */
    TmfExperiment exp = createExperiment(localTrace1, localTrace2);
    assertNotNull(exp);
    expected = ImmutableSet.of(localTrace1, localTrace2, exp);
    actual = TmfTraceManager.getTraceSetWithExperiment(exp);
    assertEquals(3, actual.size());
    assertEquals(expected, actual);
}
Also used : ITmfTrace(org.eclipse.tracecompass.tmf.core.trace.ITmfTrace) TmfExperiment(org.eclipse.tracecompass.tmf.core.trace.experiment.TmfExperiment) Test(org.junit.Test)

Example 33 with TmfExperiment

use of org.eclipse.tracecompass.tmf.core.trace.experiment.TmfExperiment in project tracecompass by tracecompass.

the class TmfTraceManagerTest method testExperimentRangeInBetween.

/**
 * Test selecting a range in-between two disjoint traces in an experiment.
 * The range should still get correctly selected, even if no trace has any
 * events in that range.
 */
@Test
public void testExperimentRangeInBetween() {
    TmfExperiment exp = createExperiment(trace1, trace2);
    openTrace(exp);
    final TmfTimeRange range = new TmfTimeRange(TmfTimestamp.fromNanos(t1end + ONE_SECOND), TmfTimestamp.fromNanos(t2start - ONE_SECOND));
    selectWindowRange(range);
    TmfTimeRange actualRange = tm.getCurrentTraceContext().getWindowRange();
    assertEquals(range, actualRange);
}
Also used : TmfExperiment(org.eclipse.tracecompass.tmf.core.trace.experiment.TmfExperiment) TmfTimeRange(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange) Test(org.junit.Test)

Example 34 with TmfExperiment

use of org.eclipse.tracecompass.tmf.core.trace.experiment.TmfExperiment in project tracecompass by tracecompass.

the class TmfTraceManagerTest method testTraceSetWithNestedExperiment.

/**
 * Test the contents of the complete trace set with a nested experiment.
 */
@Test
public void testTraceSetWithNestedExperiment() {
    final ITmfTrace localTrace1 = trace1;
    final ITmfTrace localTrace2 = trace2;
    final ITmfTrace localTrace3 = trace3;
    assertNotNull(localTrace1);
    assertNotNull(localTrace2);
    assertNotNull(localTrace3);
    TmfExperiment nestedExp = createExperiment(localTrace2, localTrace3);
    TmfExperiment exp = createExperiment(localTrace1, nestedExp);
    Collection<ITmfTrace> expected = ImmutableSet.of(exp, localTrace1, nestedExp, localTrace2, localTrace3);
    Collection<ITmfTrace> actual = TmfTraceManager.getTraceSetWithExperiment(exp);
    assertEquals(expected, actual);
}
Also used : ITmfTrace(org.eclipse.tracecompass.tmf.core.trace.ITmfTrace) TmfExperiment(org.eclipse.tracecompass.tmf.core.trace.experiment.TmfExperiment) Test(org.junit.Test)

Example 35 with TmfExperiment

use of org.eclipse.tracecompass.tmf.core.trace.experiment.TmfExperiment in project tracecompass by tracecompass.

the class TmfTraceManagerTest method testTraceSetExperiment.

/**
 * Test the contents of a trace set with an experiment.
 */
@Test
public void testTraceSetExperiment() {
    final ITmfTrace localTrace1 = trace1;
    final ITmfTrace localTrace2 = trace2;
    assertNotNull(localTrace1);
    assertNotNull(localTrace2);
    TmfExperiment exp = createExperiment(localTrace1, localTrace2);
    openTrace(localTrace1);
    openTrace(exp);
    Collection<ITmfTrace> expected = ImmutableSet.of(localTrace1, localTrace2);
    Collection<ITmfTrace> actual = tm.getActiveTraceSet();
    assertEquals(2, actual.size());
    assertEquals(expected, actual);
}
Also used : ITmfTrace(org.eclipse.tracecompass.tmf.core.trace.ITmfTrace) TmfExperiment(org.eclipse.tracecompass.tmf.core.trace.experiment.TmfExperiment) Test(org.junit.Test)

Aggregations

TmfExperiment (org.eclipse.tracecompass.tmf.core.trace.experiment.TmfExperiment)55 ITmfTrace (org.eclipse.tracecompass.tmf.core.trace.ITmfTrace)33 Test (org.junit.Test)31 ITmfEvent (org.eclipse.tracecompass.tmf.core.event.ITmfEvent)11 TmfTraceOpenedSignal (org.eclipse.tracecompass.tmf.core.signal.TmfTraceOpenedSignal)9 TmfTimeRange (org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange)8 IAnalysisModule (org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule)7 AnalysisManagerTest (org.eclipse.tracecompass.tmf.core.tests.analysis.AnalysisManagerTest)7 CtfTmfTrace (org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace)7 Nullable (org.eclipse.jdt.annotation.Nullable)5 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)4 NonNull (org.eclipse.jdt.annotation.NonNull)3 KernelAnalysisModule (org.eclipse.tracecompass.analysis.os.linux.core.kernel.KernelAnalysisModule)3 TmfTraceClosedSignal (org.eclipse.tracecompass.tmf.core.signal.TmfTraceClosedSignal)3 TmfTraceSelectedSignal (org.eclipse.tracecompass.tmf.core.signal.TmfTraceSelectedSignal)3 ITmfTimestampTransform (org.eclipse.tracecompass.tmf.core.synchronization.ITmfTimestampTransform)3 SynchronizationAlgorithm (org.eclipse.tracecompass.tmf.core.synchronization.SynchronizationAlgorithm)3 ITmfTimestamp (org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp)3 CtfTmfEvent (org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEvent)3 Before (org.junit.Before)3