use of org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEventFactory in project tracecompass by tracecompass.
the class CtfTmfCpuAspectTest method test.
/**
* Test the cpu aspect
*/
@Test
public void test() {
CtfCpuAspect fixture = new CtfCpuAspect();
CtfTmfTrace trace = fTrace;
assertNotNull(trace);
CtfTmfEventFactory fabrica = CtfTmfEventFactory.instance();
/*
* Evaluate field, no stream
*/
CtfTmfEvent e = fabrica.createEvent(trace, fEvents.get(0), "");
assertEquals(Integer.valueOf(2), fixture.resolve(e));
/*
* Evaluate stream and field
*/
e = fabrica.createEvent(trace, fEvents.get(1), "");
assertEquals(Integer.valueOf(3), fixture.resolve(e));
/*
* Evaluate context
*/
e = fabrica.createEvent(trace, fEvents.get(2), "");
assertNull(fixture.resolve(e));
/*
* Evaluate an empty event
*/
e = fabrica.createEvent(trace, fEvents.get(3), "");
assertNull(fixture.resolve(e));
/*
* Evaluate stream and no field, default LTTng behaviour
*/
e = fabrica.createEvent(trace, fEvents.get(4), "");
assertEquals(Integer.valueOf(6), fixture.resolve(e));
/*
* Evaluate non-ctf event
*/
assertNull(fixture.resolve(new TmfEvent(trace, 0, TmfTimestamp.BIG_BANG, null, null)));
}
Aggregations