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());
}
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);
}
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);
}
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);
}
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);
}
Aggregations