ctf: Fix API inconsistencies
[deliverable/tracecompass.git] / org.eclipse.linuxtools.ctf.core.tests / src / org / eclipse / linuxtools / ctf / core / tests / types / EventDeclarationTest.java
index af3cd0a7dc93611dbe2e27f993aaff203b3f6521..9ad01f217fa20fe7f418beda0b8889f62b5ae6f3 100644 (file)
@@ -6,8 +6,6 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-import java.nio.channels.FileChannel;
-
 import org.eclipse.linuxtools.ctf.core.event.EventDeclaration;
 import org.eclipse.linuxtools.ctf.core.event.EventDefinition;
 import org.eclipse.linuxtools.ctf.core.event.types.StructDeclaration;
@@ -15,9 +13,7 @@ import org.eclipse.linuxtools.ctf.core.tests.TestParams;
 import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
 import org.eclipse.linuxtools.ctf.core.trace.CTFTrace;
 import org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader;
-import org.eclipse.linuxtools.ctf.core.trace.StreamInputReader;
-import org.eclipse.linuxtools.internal.ctf.core.trace.Stream;
-import org.eclipse.linuxtools.internal.ctf.core.trace.StreamInput;
+import org.eclipse.linuxtools.ctf.core.trace.Stream;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -29,6 +25,7 @@ import org.junit.Test;
  * @author ematkho
  * @version $Revision: 1.0 $
  */
+@SuppressWarnings("javadoc")
 public class EventDeclarationTest {
 
     private EventDeclaration fixture;
@@ -95,21 +92,6 @@ public class EventDeclarationTest {
         assertFalse(result);
     }
 
-    /**
-     * Run the EventDefinition createDefinition(StreamInputReader) method test.
-     *
-     * @throws CTFReaderException
-     */
-    @Test
-    public void testCreateDefinition() throws CTFReaderException {
-        StreamInputReader streamInputReader = new StreamInputReader(
-                new StreamInput(new Stream(TestParams.createTrace()),
-                        (FileChannel) null, TestParams.getTraceFile()));
-
-        EventDefinition result = fixture.createDefinition(streamInputReader);
-        assertNotNull(result);
-    }
-
     /**
      * Run the boolean equals(Object) method test.
      *
@@ -356,8 +338,43 @@ public class EventDeclarationTest {
         assertNotNull(ed.lookupDefinition("fields")); //$NON-NLS-1$
         assertNull(ed.lookupDefinition("other")); //$NON-NLS-1$
         assertNotNull(ed.toString());
-        ed.context = ed.getFields();
+        ed.setContext( ed.getFields());
         assertNotNull(ed.toString());
+    }
+
+    EventDeclaration e1;
+    EventDeclaration e2;
+
 
+    @Test
+    public void testEquals1(){
+        e1 = new EventDeclaration();
+        assertFalse(e1.equals(null));
+    }
+
+    @Test
+    public void testEquals2(){
+        e1 = EventDeclaration.getLostEventDeclaration();
+        assertFalse(e1.equals(new Long(23L)));
+    }
+
+    @Test
+    public void testEquals3(){
+        e1 = EventDeclaration.getLostEventDeclaration();
+        assertEquals(e1,e1);
+    }
+
+    @Test
+    public void testEquals4(){
+        e1 = EventDeclaration.getLostEventDeclaration();
+        e2 = EventDeclaration.getLostEventDeclaration();
+        assertEquals(e1,e2);
+    }
+
+    @Test
+    public void testEquals5(){
+        e1 = EventDeclaration.getLostEventDeclaration();
+        e2 = new EventDeclaration();
+        assertFalse(e1.equals(e2));
     }
 }
This page took 0.024229 seconds and 5 git commands to generate.