ctf: Fix API inconsistencies
[deliverable/tracecompass.git] / org.eclipse.linuxtools.ctf.core.tests / src / org / eclipse / linuxtools / ctf / core / tests / trace / StreamInputReaderTest.java
index bcc7da2ffdc889dd75755af9cd713028e05ad680..5e850b77dc62c8682a59a90940c9084d9ce5baef 100644 (file)
@@ -13,9 +13,9 @@ import org.eclipse.linuxtools.ctf.core.event.types.StructDefinition;
 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.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.eclipse.linuxtools.internal.ctf.core.trace.StreamInput;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -27,6 +27,7 @@ import org.junit.Test;
  * @author ematkho
  * @version $Revision: 1.0 $
  */
+@SuppressWarnings("javadoc")
 public class StreamInputReaderTest {
 
     private StreamInputReader fixture;
@@ -142,12 +143,30 @@ public class StreamInputReaderTest {
 
     /**
      * Run the void goToLastEvent() method test.
-     *
-     * @throws CTFReaderException
      */
     @Test
-    public void testGoToLastEvent() throws CTFReaderException {
+    public void testGoToLastEvent1() {
+        final long endTimestamp = goToEnd();
+        final long endTime = 4287422460315L;
+        assertEquals(endTime , endTimestamp  );
+    }
+
+    /**
+     * Run the void goToLastEvent() method test.
+     */
+    @Test
+    public void testGoToLastEvent2() {
+        long timestamp = -1;
+        while(fixture.readNextEvent()) {
+            timestamp = fixture.getCurrentEvent().getTimestamp();
+        }
+        long endTimestamp = goToEnd();
+        assertEquals(0 , timestamp- endTimestamp );
+    }
+
+    private long goToEnd() {
         fixture.goToLastEvent();
+        return fixture.getCurrentEvent().getTimestamp();
     }
 
     /**
This page took 0.041531 seconds and 5 git commands to generate.