import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
-import org.eclipse.tracecompass.ctf.core.CTFReaderException;
+import org.eclipse.tracecompass.ctf.core.CTFException;
import org.eclipse.tracecompass.ctf.core.event.EventDefinition;
+import org.eclipse.tracecompass.ctf.core.event.IEventDeclaration;
+import org.eclipse.tracecompass.ctf.core.event.LostEventDeclaration;
import org.eclipse.tracecompass.ctf.core.event.types.StructDeclaration;
import org.eclipse.tracecompass.ctf.core.tests.shared.CtfTestTrace;
import org.eclipse.tracecompass.ctf.core.trace.CTFStream;
/**
* Perform pre-test initialization.
*
- * @throws CTFReaderException
+ * @throws CTFException
*/
@Before
- public void setUp() throws CTFReaderException {
+ public void setUp() throws CTFException {
assumeTrue(testTrace.exists());
fixture = new EventDeclaration();
fixture.setContext(new StructDeclaration(1L));
/**
* Run the boolean equals(Object) method test.
*
- * @throws CTFReaderException
+ * @throws CTFException
*/
@Test
- public void testEquals() throws CTFReaderException {
+ public void testEquals() throws CTFException {
EventDeclaration obj = new EventDeclaration();
obj.setContext(new StructDeclaration(1L));
obj.setId(1L);
/**
* Test for the EventDefinition class
*
- * @throws CTFReaderException
+ * @throws CTFException
*/
@Test
- public void testEventDefinition() throws CTFReaderException {
+ public void testEventDefinition() throws CTFException {
CTFTrace trace = testTrace.getTrace();
EventDefinition ed = null;
try (CTFTraceReader tr = new CTFTraceReader(trace);) {
assertNotNull(ed.toString());
}
- EventDeclaration e1;
- EventDeclaration e2;
+ IEventDeclaration e1;
+ IEventDeclaration e2;
@Test
public void testEquals1() {
@Test
public void testEquals2() {
- e1 = EventDeclaration.getLostEventDeclaration();
+ e1 = LostEventDeclaration.INSTANCE;
assertFalse(e1.equals(new Long(23L)));
}
@Test
public void testEquals3() {
- e1 = EventDeclaration.getLostEventDeclaration();
+ e1 = LostEventDeclaration.INSTANCE;
assertEquals(e1, e1);
}
@Test
public void testEquals4() {
- e1 = EventDeclaration.getLostEventDeclaration();
- e2 = EventDeclaration.getLostEventDeclaration();
+ e1 = LostEventDeclaration.INSTANCE;
+ e2 = LostEventDeclaration.INSTANCE;
assertEquals(e1, e2);
}
@Test
public void testEquals5() {
- e1 = EventDeclaration.getLostEventDeclaration();
+ e1 = LostEventDeclaration.INSTANCE;
e2 = new EventDeclaration();
assertFalse(e1.equals(e2));
}