ctf: Fix Javadoc for all public methods
[deliverable/tracecompass.git] / org.eclipse.linuxtools.ctf.core.tests / src / org / eclipse / linuxtools / ctf / core / tests / types / EventDeclarationTest.java
index f129c9a9e7c51e20fc11fa3ea83f9af246d73b15..3dcbb9873d6fe35e7091232c28e2668006908115 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.Stream;
-import org.eclipse.linuxtools.ctf.core.trace.StreamInput;
-import org.eclipse.linuxtools.ctf.core.trace.StreamInputReader;
+import org.eclipse.linuxtools.internal.ctf.core.trace.Stream;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -25,17 +21,18 @@ import org.junit.Test;
 /**
  * The class <code>EventDeclarationTest</code> contains tests for the class
  * <code>{@link EventDeclaration}</code>.
- * 
+ *
  * @author ematkho
  * @version $Revision: 1.0 $
  */
+@SuppressWarnings("javadoc")
 public class EventDeclarationTest {
 
     private EventDeclaration fixture;
 
     /**
      * Launch the test.
-     * 
+     *
      * @param args
      *            the command line arguments
      */
@@ -45,8 +42,8 @@ public class EventDeclarationTest {
 
     /**
      * Perform pre-test initialization.
-     * 
-     * @throws CTFReaderException 
+     *
+     * @throws CTFReaderException
      */
     @Before
     public void setUp() throws CTFReaderException {
@@ -95,25 +92,10 @@ 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.getEmptyFile()));
-
-        EventDefinition result = fixture.createDefinition(streamInputReader);
-        assertNotNull(result);
-    }
-
     /**
      * Run the boolean equals(Object) method test.
-     * 
-     * @throws CTFReaderException 
+     *
+     * @throws CTFReaderException
      */
     @Test
     public void testEquals() throws CTFReaderException {
@@ -333,8 +315,8 @@ public class EventDeclarationTest {
 
     /**
      * Test for the EventDefinition class
-     * 
-     * @throws CTFReaderException 
+     *
+     * @throws CTFReaderException
      */
     @Test
     public void testEventDefinition() throws CTFReaderException {
@@ -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.028945 seconds and 5 git commands to generate.