use of org.eclipse.tracecompass.tmf.core.trace.TmfContext in project tracecompass by tracecompass.
the class TimeOffsetTest method testClearOffset.
@Test
public void testClearOffset() throws TmfTraceException {
ITmfTimestampTransform tt = TimestampTransformFactory.createWithOffset(ONE_MS);
TimestampTransformFactory.setTimestampTransform(fResource, tt);
TimestampTransformFactory.setTimestampTransform(fResource, null);
ITmfTrace trace = createAndIndexTrace();
final TmfContext context = (TmfContext) trace.seekEvent(0);
ITmfEvent event = trace.getNext(context);
assertEquals("Event timestamp", 1, event.getTimestamp().getValue());
event = trace.getNext(context);
assertEquals("Event timestamp", 2, event.getTimestamp().getValue());
trace.dispose();
}
use of org.eclipse.tracecompass.tmf.core.trace.TmfContext in project tracecompass by tracecompass.
the class TmfContextTest method testIncreaseRank.
@Test
public void testIncreaseRank() {
final TmfContext context1 = new TmfContext(fContext1);
context1.increaseRank();
assertEquals("getRank", fRank1 + 1, context1.getRank());
context1.increaseRank();
assertEquals("getRank", fRank1 + 2, context1.getRank());
context1.setRank(ITmfContext.UNKNOWN_RANK);
context1.increaseRank();
assertEquals("getRank", ITmfContext.UNKNOWN_RANK, context1.getRank());
context1.increaseRank();
assertEquals("getRank", ITmfContext.UNKNOWN_RANK, context1.getRank());
}
use of org.eclipse.tracecompass.tmf.core.trace.TmfContext in project tracecompass by tracecompass.
the class TmfContextTest method testTmfContextCopy.
@Test
public void testTmfContextCopy() {
final TmfContext context1 = new TmfContext(fContext1);
final TmfContext context2 = new TmfContext(fContext2);
assertEquals("getLocation", fLocation1, context1.getLocation());
assertEquals("getLocation", fLocation2, context2.getLocation());
assertEquals("getRank", fRank1, context1.getRank());
assertEquals("getRank", fRank2, context2.getRank());
}
use of org.eclipse.tracecompass.tmf.core.trace.TmfContext in project tracecompass by tracecompass.
the class TmfContextTest method testEqualsTransivity.
@Test
public void testEqualsTransivity() {
final TmfContext context1 = new TmfContext(fContext1);
final TmfContext context2 = new TmfContext(context1);
final TmfContext context3 = new TmfContext(context2);
assertTrue("equals", context1.equals(context2));
assertTrue("equals", context2.equals(context3));
assertTrue("equals", context1.equals(context3));
}
use of org.eclipse.tracecompass.tmf.core.trace.TmfContext in project tracecompass by tracecompass.
the class TmfContextTest method testEqualsSymmetry.
@Test
public void testEqualsSymmetry() {
final TmfContext context1 = new TmfContext(fContext1);
final TmfContext context2 = new TmfContext(fContext2);
assertTrue("equals", context1.equals(fContext1));
assertTrue("equals", fContext1.equals(context1));
assertTrue("equals", context2.equals(fContext2));
assertTrue("equals", fContext2.equals(context2));
}
Aggregations