use of org.eclipse.tracecompass.tmf.core.event.TmfEvent in project tracecompass by tracecompass.
the class TmfEventTest method testEqualsTransivity.
@Test
public void testEqualsTransivity() {
final ITmfEvent event1 = new TmfEvent(fEvent1);
final ITmfEvent event2 = new TmfEvent(fEvent1);
final ITmfEvent event3 = new TmfEvent(fEvent1);
assertTrue("equals", event1.equals(event2));
assertTrue("equals", event2.equals(event3));
assertTrue("equals", event1.equals(event3));
}
use of org.eclipse.tracecompass.tmf.core.event.TmfEvent in project tracecompass by tracecompass.
the class TmfEventFieldTest method testNonEqualsValue.
/**
* Test with same fields, but different values (should not be equal)
*/
@Test
public void testNonEqualsValue() {
final String fieldName = "myfield";
final Object value1 = new String("test-string");
final Object value2 = new TmfEvent(null, ITmfContext.UNKNOWN_RANK, null, null, null);
final TmfEventField[] fields = { fField1, fField2 };
final TmfEventField field1 = new TmfEventField(fieldName, value1, fields);
final TmfEventField field2 = new TmfEventField(fieldName, value2, fields);
assertNotEquals(field1, field2);
assertNotEquals(field2, field1);
}
use of org.eclipse.tracecompass.tmf.core.event.TmfEvent in project tracecompass by tracecompass.
the class TmfEventTest method testConstructorWithTrace.
@Test
public void testConstructorWithTrace() {
final ITmfTrace trace = fTrace;
final ITmfEvent event = new TmfEvent(trace, 0, fTimestamp1, fType, fContent1);
assertNotNull("getTrace", event.getTrace());
assertEquals("getRank", 0, event.getRank());
assertEquals("getTimestamp", fTimestamp1, event.getTimestamp());
assertEquals("getType", fType, event.getType());
assertEquals("getContent", fContent1, event.getContent());
trace.dispose();
}
use of org.eclipse.tracecompass.tmf.core.event.TmfEvent in project tracecompass by tracecompass.
the class TmfEventTest method testNonEqualContents.
@Test
public void testNonEqualContents() {
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, fTimestamp1, fType, fContent2);
assertFalse("equals", event1.equals(event2));
assertFalse("equals", event2.equals(event1));
event2 = new TmfEvent(null, 0, fTimestamp1, fType, null);
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 testNonEqualRanks.
@Test
public void testNonEqualRanks() {
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, 1, fTimestamp1, fType, fContent1);
assertFalse("equals", event1.equals(event2));
assertFalse("equals", event2.equals(event1));
}
Aggregations