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;
* @author ematkho
* @version $Revision: 1.0 $
*/
+@SuppressWarnings("javadoc")
public class StreamInputReaderTest {
private StreamInputReader fixture;
/**
* 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();
}
/**