use of org.eclipse.tracecompass.tmf.core.event.TmfEvent in project tracecompass by tracecompass.
the class TmfEventTest method testNonEqualTypes.
@Test
public void testNonEqualTypes() {
final ITmfEvent event1 = new TmfEvent(null, 0, fTimestamp1, fType, fContent1);
ITmfEvent event2 = new TmfEvent(null, 0, fTimestamp1, fType, fContent1);
assertTrue("equals", event1.equals(event2));
assertTrue("equals", event2.equals(event1));
final String typeId = "OtherTestType";
final String[] labels = new String[] { fLabel2, fLabel1 };
final TmfEventType newType = new TmfEventType(typeId, TmfEventField.makeRoot(labels));
event2 = new TmfEvent(null, 0, fTimestamp1, newType, fContent1);
assertFalse("equals", event1.equals(event2));
assertFalse("equals", event2.equals(event1));
event2 = new TmfEvent(null, 0, fTimestamp1, null, fContent1);
assertFalse("equals", event1.equals(event2));
assertFalse("equals", event2.equals(event1));
}
use of org.eclipse.tracecompass.tmf.core.event.TmfEvent in project tracecompass by tracecompass.
the class TmfEventTest method testNonEqualTimestamps.
@Test
public void testNonEqualTimestamps() {
final ITmfEvent event1 = new TmfEvent(null, 0, fTimestamp1, fType, fContent1);
ITmfEvent event2 = new TmfEvent(null, 0, fTimestamp1, fType, fContent1);
assertTrue("equals", event1.equals(event2));
assertTrue("equals", event2.equals(event1));
event2 = new TmfEvent(null, 0, fTimestamp2, fType, fContent1);
assertFalse("equals", event1.equals(event2));
assertFalse("equals", event2.equals(event1));
event2 = new TmfEvent(null, 0, null, fType, fContent1);
assertFalse("equals", event1.equals(event2));
assertFalse("equals", event2.equals(event1));
}
use of org.eclipse.tracecompass.tmf.core.event.TmfEvent in project tracecompass by tracecompass.
the class TmfEventTest method testTmfEventCopy.
@Test
public void testTmfEventCopy() {
final ITmfEvent event = new TmfEvent(fEvent1);
assertNotNull("getTrace", event.getTrace());
assertEquals("getRank", 0, event.getRank());
assertEquals("getTimestamp", fTimestamp1, event.getTimestamp());
assertEquals("getType", fType, event.getType());
assertEquals("getContent", fContent1, event.getContent());
}
use of org.eclipse.tracecompass.tmf.core.event.TmfEvent in project tracecompass by tracecompass.
the class TmfEventTest method testNoRankConstructor.
@Test
public void testNoRankConstructor() {
final ITmfEvent event = new TmfEvent(fTrace, ITmfContext.UNKNOWN_RANK, fTimestamp1, fType, fContent1);
assertNotNull("getTrace", event.getTrace());
assertEquals("getRank", ITmfContext.UNKNOWN_RANK, event.getRank());
assertEquals("getTimestamp", fTimestamp1, event.getTimestamp());
assertEquals("getType", fType, event.getType());
assertEquals("getContent", fContent1, event.getContent());
}
use of org.eclipse.tracecompass.tmf.core.event.TmfEvent in project tracecompass by tracecompass.
the class TmfEventTest method testDefaultConstructor.
// ------------------------------------------------------------------------
// Constructors
// ------------------------------------------------------------------------
@Test
public void testDefaultConstructor() {
final ITmfEvent event = new TmfEvent(fTrace, ITmfContext.UNKNOWN_RANK, null, null, null);
assertNotNull("getTrace", event.getTrace());
assertEquals("getRank", ITmfContext.UNKNOWN_RANK, event.getRank());
assertEquals("getTimestamp", TmfTimestamp.ZERO, event.getTimestamp());
assertNull("getType", event.getType());
assertNull("getContent", event.getContent());
}
Aggregations