Make the TmfLocation final and get rid of clone()
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core.tests / src / org / eclipse / linuxtools / tmf / core / tests / ctfadaptor / CtfIteratorTest.java
index b327c9c2650e7964052e0e8f91890da08d59a4d2..6de0a3935cc12e451238ca6388ce97802e0461e0 100644 (file)
@@ -1,3 +1,16 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Matthew Khouzam - Initial generation with CodePro tools
+ *   Alexandre Montplaisir - Clean up, consolidate redundant tests
+ *******************************************************************************/
+
 package org.eclipse.linuxtools.tmf.core.tests.ctfadaptor;
 
 import static org.junit.Assert.assertEquals;
@@ -7,6 +20,7 @@ import static org.junit.Assert.assertTrue;
 
 import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator;
 import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfLocation;
+import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfLocationData;
 import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfEvent;
 import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace;
 import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
@@ -15,62 +29,94 @@ import org.junit.Before;
 import org.junit.Test;
 
 /**
- * The class <code>CtfIteratorTest</code> contains tests for the class <code>{@link CtfIterator}</code>.
+ * The class <code>CtfIteratorTest</code> contains tests for the class
+ * <code>{@link CtfIterator}</code>.
  *
- * @generatedBy CodePro at 03/05/12 2:29 PM
  * @author ematkho
- * @version $Revision: 1.0 $
+ * @version 1.0
  */
-@SuppressWarnings("static-method")
 public class CtfIteratorTest {
+
+    private CtfIterator fixture;
+
     /**
-     * Run the CtfIterator(CtfTmfTrace) constructor test.
+     * Launch the test.
      *
-     * @throws Exception
+     * @param args
+     *            the command line arguments
+     */
+    public static void main(String[] args) {
+        new org.junit.runner.JUnitCore().run(CtfIteratorTest.class);
+    }
+
+    /**
+     * Perform pre-test initialization.
      *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
+     * @throws TmfTraceException
+     *             If the test trace is not found
+     */
+    @Before
+    public void setUp() throws TmfTraceException {
+        fixture = new CtfIterator(createTrace());
+        CtfLocation ctfLocation = new CtfLocation(new CtfLocationData(1, 0));
+        fixture.setLocation(ctfLocation);
+        fixture.increaseRank();
+    }
+
+    /**
+     * Perform post-test clean-up.
+     */
+    @After
+    public void tearDown() {
+        fixture.dispose();
+    }
+
+
+    private static CtfTmfTrace createTrace() throws TmfTraceException {
+        return TestParams.createTrace();
+    }
+
+    /**
+     * Run the CtfIterator(CtfTmfTrace) constructor on a non init'ed trace.
+     *
+     * @throws TmfTraceException
+     *             If the test trace is not found
      */
     @Test
-    public void testCtfIterator_1()
-        throws Exception {
+    public void testCtfIterator_noinit() throws TmfTraceException {
         CtfTmfTrace trace = createTrace();
         CtfIterator result = new CtfIterator(trace);
         assertNotNull(result);
     }
 
     /**
-     * Run the CtfIterator(CtfTmfTrace) constructor test.
-     *
-     * @throws Exception
+     * Run the CtfIterator(CtfTmfTrace) constructor on an init'ed trace.
      *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
+     * @throws TmfTraceException
+     *             If the test trace is not found
      */
     @Test
-    public void testCtfIterator_2()
-        throws Exception {
+    public void testCtfIterator_init() throws TmfTraceException {
         CtfTmfTrace trace = createTrace();
         trace.init("test"); //$NON-NLS-1$
-
         CtfIterator result = new CtfIterator(trace);
 
         assertNotNull(result);
     }
 
     /**
-     * Run the CtfIterator(CtfTmfTrace,long,long) constructor test.
+     * Run the CtfIterator(CtfTmfTrace,long,long) constructor test, which
+     * specifies an initial position for the iterator.
      *
-     * @throws Exception
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
+     * @throws TmfTraceException
+     *             If the test trace is not found
      */
     @Test
-    public void testCtfIterator_3()
-        throws Exception {
+    public void testCtfIterator_position() throws TmfTraceException {
         CtfTmfTrace trace = createTrace();
         long timestampValue = 1L;
         long rank = 1L;
-
-        CtfIterator result = new CtfIterator(trace, timestampValue, rank);
+        CtfIterator result = new CtfIterator(trace, new CtfLocationData(timestampValue, 0), rank);
 
         assertNotNull(result);
     }
@@ -78,61 +124,18 @@ public class CtfIteratorTest {
 
     /**
      * Run the boolean advance() method test.
-     *
-     * @throws Exception
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
-     */
-    @Test
-    public void testAdvance_1()
-        throws Exception {
-        CtfIterator fixture = new CtfIterator(createTrace());
-        CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
-        ctfLocation.setLocation(Long.valueOf(1));
-        fixture.setLocation(ctfLocation);
-        fixture.increaseRank();
-
-        boolean result = fixture.advance();
-        assertTrue(result);
-    }
-
-    /**
-     * Run the boolean advance() method test.
-     *
-     * @throws Exception
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
      */
     @Test
-    public void testAdvance_2()
-        throws Exception {
-        CtfIterator fixture = new CtfIterator(createTrace());
-        CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
-        ctfLocation.setLocation(Long.valueOf(1));
-        fixture.setLocation(ctfLocation);
-        fixture.increaseRank();
-
+    public void testAdvance() {
         boolean result = fixture.advance();
-
         assertTrue(result);
     }
 
     /**
      * Run the CtfIterator clone() method test.
-     *
-     * @throws Exception
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
      */
     @Test
-    public void testClone_1()
-        throws Exception {
-        CtfIterator fixture = new CtfIterator(createTrace());
-        CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
-        ctfLocation.setLocation(Long.valueOf(1));
-        fixture.setLocation(ctfLocation);
-        fixture.increaseRank();
-
+    public void testClone() {
         CtfIterator result = fixture.clone();
         assertNotNull(result);
     }
@@ -140,161 +143,41 @@ public class CtfIteratorTest {
     /**
      * Run the int compareTo(CtfIterator) method test.
      *
-     * @throws Exception
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
-     */
-
-    @Test
-    public void testCompareTo_1()
-        throws Exception {
-        CtfIterator fixture = new CtfIterator(createTrace());
-        CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
-        ctfLocation.setLocation(Long.valueOf(1));
-        fixture.setLocation(ctfLocation);
-        fixture.increaseRank();
-        CtfIterator o = new CtfIterator(createTrace());
-
-        int result = fixture.compareTo(o);
-
-        assertEquals(1L, result);
-    }
-
-    /**
-     * @return
      * @throws TmfTraceException
-     */
-    private CtfTmfTrace createTrace() throws TmfTraceException {
-        return TestParams.createTrace();
-    }
-
-    /**
-     * Run the int compareTo(CtfIterator) method test.
-     *
-     * @throws Exception
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
+     *             If the test trace is not found
      */
     @Test
-    public void testCompareTo_2()
-        throws Exception {
-        CtfIterator fixture = new CtfIterator(createTrace());
-        CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
-        ctfLocation.setLocation(Long.valueOf(1));
-        fixture.setLocation(ctfLocation);
-        fixture.increaseRank();
+    public void testCompareTo() throws TmfTraceException {
         CtfIterator o = new CtfIterator(createTrace());
-
         int result = fixture.compareTo(o);
 
-        assertEquals(1, result);
-    }
-
-    /**
-     * Run the int compareTo(CtfIterator) method test.
-     *
-     * @throws Exception
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
-     */
-    @Test
-    public void testCompareTo_3()
-        throws Exception {
-        CtfIterator fixture = new CtfIterator(createTrace());
-        CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
-        ctfLocation.setLocation(Long.valueOf(1));
-        fixture.setLocation(ctfLocation);
-        fixture.increaseRank();
-        CtfIterator o = new CtfIterator(createTrace());
-
-        int result = fixture.compareTo(o);
-        assertEquals(1, result);
-    }
-
-    /**
-     * Run the void dispose() method test.
-     *
-     * @throws Exception
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
-     */
-    @Test
-    public void testDispose_1()
-        throws Exception {
-        CtfIterator fixture = new CtfIterator(createTrace());
-        CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
-        ctfLocation.setLocation(Long.valueOf(1));
-        fixture.setLocation(ctfLocation);
-        fixture.increaseRank();
-
-        fixture.dispose();
+        assertEquals(1L, result);
     }
 
     /**
-     * Run the boolean equals(Object) method test.
-     *
-     * @throws Exception
+     * Run the boolean equals(Object) method test. Compare with another iterator
+     * on the same trace.
      *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
+     * @throws TmfTraceException
+     *             If the test trace is not found
      */
     @Test
-    public void testEquals_1()
-        throws Exception {
-        CtfIterator fixture = new CtfIterator(createTrace());
-        CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
-        ctfLocation.setLocation(Long.valueOf(1));
-        fixture.setLocation(ctfLocation);
-        fixture.increaseRank();
+    public void testEquals_other() throws TmfTraceException {
         CtfIterator obj = new CtfIterator(createTrace());
-        CtfLocation ctfLocation1 = new CtfLocation(Long.valueOf(1));
-        ctfLocation1.setLocation(Long.valueOf(1));
+        CtfLocation ctfLocation1 = new CtfLocation(new CtfLocationData(1, 0));
         obj.setLocation(ctfLocation1);
         obj.increaseRank();
 
         boolean result = fixture.equals(obj);
-
         assertTrue(result);
     }
 
     /**
-     * Run the boolean equals(Object) method test.
-     *
-     * @throws Exception
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
+     * Run the boolean equals(Object) method test. Compare with an empty object.
      */
     @Test
-    public void testEquals_2()
-        throws Exception {
-        CtfIterator fixture = new CtfIterator(createTrace());
-        CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
-        ctfLocation.setLocation(Long.valueOf(1));
-        fixture.setLocation(ctfLocation);
-        fixture.increaseRank();
-        Object obj = new Object();
-
-        boolean result = fixture.equals(obj);
-
-        assertFalse(result);
-    }
-
-    /**
-     * Run the boolean equals(Object) method test.
-     *
-     * @throws Exception
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
-     */
-    @Test
-    public void testEquals_3()
-        throws Exception {
-        CtfIterator fixture = new CtfIterator(createTrace());
-        CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
-        ctfLocation.setLocation(Long.valueOf(1));
-        fixture.setLocation(ctfLocation);
-        fixture.increaseRank();
+    public void testEquals_empty() {
         Object obj = new Object();
-
         boolean result = fixture.equals(obj);
 
         assertFalse(result);
@@ -302,209 +185,54 @@ public class CtfIteratorTest {
 
     /**
      * Run the CtfTmfTrace getCtfTmfTrace() method test.
-     *
-     * @throws Exception
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
      */
     @Test
-    public void testGetCtfTmfTrace_1()
-        throws Exception {
-        CtfIterator fixture = new CtfIterator(createTrace());
-        CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
-        ctfLocation.setLocation(Long.valueOf(1));
-        fixture.setLocation(ctfLocation);
-        fixture.increaseRank();
-
+    public void testGetCtfTmfTrace() {
         CtfTmfTrace result = fixture.getCtfTmfTrace();
-
-        // add additional test code here
-        // An unexpected exception was thrown in user code while executing this test:
-        //    java.lang.NullPointerException
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
-        //       at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
         assertNotNull(result);
     }
 
     /**
      * Run the CtfTmfEvent getCurrentEvent() method test.
-     *
-     * @throws Exception
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
      */
     @Test
-    public void testGetCurrentEvent_1()
-        throws Exception {
-        CtfIterator fixture = new CtfIterator(createTrace());
-        CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
-        ctfLocation.setLocation(Long.valueOf(1));
-        fixture.setLocation(ctfLocation);
-        fixture.increaseRank();
-
+    public void testGetCurrentEvent() {
         CtfTmfEvent result = fixture.getCurrentEvent();
-
-        // add additional test code here
-        // An unexpected exception was thrown in user code while executing this test:
-        //    java.lang.NullPointerException
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
-        //       at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
-        assertNotNull(result);
-    }
-
-    /**
-     * Run the CtfTmfEvent getCurrentEvent() method test.
-     *
-     * @throws Exception
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
-     */
-    @Test
-    public void testGetCurrentEvent_2()
-        throws Exception {
-        CtfIterator fixture = new CtfIterator(createTrace());
-        CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
-        ctfLocation.setLocation(Long.valueOf(1));
-        fixture.setLocation(ctfLocation);
-        fixture.increaseRank();
-
-        CtfTmfEvent result = fixture.getCurrentEvent();
-
-        // add additional test code here
-        // An unexpected exception was thrown in user code while executing this test:
-        //    java.lang.NullPointerException
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
-        //       at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
         assertNotNull(result);
     }
 
     /**
      * Run the CtfLocation getLocation() method test.
-     *
-     * @throws Exception
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
      */
     @Test
-    public void testGetLocation_1()
-        throws Exception {
-        CtfIterator fixture = new CtfIterator(createTrace());
-        CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
-        ctfLocation.setLocation(Long.valueOf(1));
-        fixture.setLocation(ctfLocation);
-        fixture.increaseRank();
-
+    public void testGetLocation() {
         CtfLocation result = fixture.getLocation();
-
-        // add additional test code here
-        // An unexpected exception was thrown in user code while executing this test:
-        //    java.lang.NullPointerException
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
-        //       at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
         assertNotNull(result);
     }
 
     /**
      * Run the long getRank() method test.
-     *
-     * @throws Exception
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
      */
     @Test
-    public void testGetRank_1()
-        throws Exception {
-        CtfIterator fixture = new CtfIterator(createTrace());
-        CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
-        ctfLocation.setLocation(Long.valueOf(1));
-        fixture.setLocation(ctfLocation);
-        fixture.increaseRank();
-
+    public void testGetRank() {
         long result = fixture.getRank();
-
-        // add additional test code here
-        // An unexpected exception was thrown in user code while executing this test:
-        //    java.lang.NullPointerException
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
-        //       at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
         assertEquals(1L, result);
     }
 
     /**
      * Run the boolean hasValidRank() method test.
-     *
-     * @throws Exception
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
      */
     @Test
-    public void testHasValidRank_1()
-        throws Exception {
-        CtfIterator fixture = new CtfIterator(createTrace());
-        CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
-        ctfLocation.setLocation(Long.valueOf(1));
-        fixture.setLocation(ctfLocation);
-        fixture.increaseRank();
-
+    public void testHasValidRank() {
         boolean result = fixture.hasValidRank();
-
-        // add additional test code here
-        // An unexpected exception was thrown in user code while executing this test:
-        //    java.lang.NullPointerException
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
-        //       at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
-        assertTrue(result);
-    }
-
-    /**
-     * Run the boolean hasValidRank() method test.
-     *
-     * @throws Exception
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
-     */
-    @Test
-    public void testHasValidRank_2()
-        throws Exception {
-        CtfIterator fixture = new CtfIterator(createTrace());
-        CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
-        ctfLocation.setLocation(Long.valueOf(1));
-        fixture.setLocation(ctfLocation);
-        fixture.increaseRank();
-
-        boolean result = fixture.hasValidRank();
-
-        // add additional test code here
-        // An unexpected exception was thrown in user code while executing this test:
-        //    java.lang.NullPointerException
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
-        //       at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
         assertTrue(result);
     }
 
     /**
      * Run the int hashCode() method test.
-     *
-     * @throws Exception
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
      */
     @Test
-    public void testHashCode_1()
-        throws Exception {
-        CtfIterator fixture = new CtfIterator(createTrace());
-        CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
-        ctfLocation.setLocation(Long.valueOf(1));
-        fixture.setLocation(ctfLocation);
-        fixture.increaseRank();
-
+    public void testHashCode() {
         int result = fixture.hashCode();
         int result2 = fixture.hashCode();
         assertEquals(result, result2);
@@ -512,260 +240,28 @@ public class CtfIteratorTest {
 
     /**
      * Run the void increaseRank() method test.
-     *
-     * @throws Exception
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
-     */
-    @Test
-    public void testIncreaseRank_1()
-        throws Exception {
-        CtfIterator fixture = new CtfIterator(createTrace());
-        CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
-        ctfLocation.setLocation(Long.valueOf(1));
-        fixture.setLocation(ctfLocation);
-        fixture.increaseRank();
-
-        fixture.increaseRank();
-
-        // add additional test code here
-        // An unexpected exception was thrown in user code while executing this test:
-        //    java.lang.NullPointerException
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
-        //       at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
-    }
-
-    /**
-     * Run the boolean seek(long) method test.
-     *
-     * @throws Exception
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
      */
     @Test
-    public void testSeek_1()
-        throws Exception {
-        CtfIterator fixture = new CtfIterator(createTrace());
-        CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
-        ctfLocation.setLocation(Long.valueOf(1));
-        fixture.setLocation(ctfLocation);
+    public void testIncreaseRank() {
         fixture.increaseRank();
-        long timestamp = 1L;
-
-        boolean result = fixture.seek(timestamp);
-
-        // add additional test code here
-        // An unexpected exception was thrown in user code while executing this test:
-        //    java.lang.NullPointerException
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
-        //       at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
-        assertTrue(result);
     }
 
     /**
      * Run the boolean seek(long) method test.
-     *
-     * @throws Exception
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
      */
     @Test
-    public void testSeek_2()
-        throws Exception {
-        CtfIterator fixture = new CtfIterator(createTrace());
-        CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
-        ctfLocation.setLocation(Long.valueOf(1));
-        fixture.setLocation(ctfLocation);
-        fixture.increaseRank();
+    public void testSeek() {
         long timestamp = 1L;
-
         boolean result = fixture.seek(timestamp);
-
-        // add additional test code here
-        // An unexpected exception was thrown in user code while executing this test:
-        //    java.lang.NullPointerException
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
-        //       at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
-        assertTrue(result);
-    }
-
-    /**
-     * Run the boolean seekRank(long) method test.
-     *
-     * @throws Exception
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
-     */
-    @Test
-    public void testSeekRank_1()
-        throws Exception {
-        CtfIterator fixture = new CtfIterator(createTrace());
-        CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
-        ctfLocation.setLocation(Long.valueOf(1));
-        fixture.setLocation(ctfLocation);
-        fixture.increaseRank();
-        long rank = 1L;
-
-        boolean result = fixture.seekRank(rank);
-
-        // add additional test code here
-        // An unexpected exception was thrown in user code while executing this test:
-        //    java.lang.NullPointerException
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
-        //       at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
-        assertTrue(result);
-    }
-
-    /**
-     * Run the boolean seekRank(long) method test.
-     *
-     * @throws Exception
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
-     */
-    @Test
-    public void testSeekRank_2()
-        throws Exception {
-        CtfIterator fixture = new CtfIterator(createTrace());
-        CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
-        ctfLocation.setLocation(Long.valueOf(1));
-        fixture.setLocation(ctfLocation);
-        fixture.increaseRank();
-        long rank = 1L;
-
-        boolean result = fixture.seekRank(rank);
-
-        // add additional test code here
-        // An unexpected exception was thrown in user code while executing this test:
-        //    java.lang.NullPointerException
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
-        //       at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
         assertTrue(result);
     }
 
     /**
      * Run the void setLocation(ITmfLocation<?>) method test.
-     *
-     * @throws Exception
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
      */
     @Test
-    public void testSetLocation_1()
-        throws Exception {
-        CtfIterator fixture = new CtfIterator(createTrace());
-        CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
-        ctfLocation.setLocation(Long.valueOf(1));
-        fixture.setLocation(ctfLocation);
-        fixture.increaseRank();
-        CtfLocation location = new CtfLocation(Long.valueOf(1));
-        location.setLocation(Long.valueOf(1));
-
+    public void testSetLocation() {
+        CtfLocation location = new CtfLocation(new CtfLocationData(1, 0));
         fixture.setLocation(location);
-
-        // add additional test code here
-        // An unexpected exception was thrown in user code while executing this test:
-        //    java.lang.NullPointerException
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
-        //       at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
-    }
-
-    /**
-     * Run the void setRank(long) method test.
-     *
-     * @throws Exception
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
-     */
-    @Test
-    public void testSetRank_1()
-        throws Exception {
-        CtfIterator fixture = new CtfIterator(createTrace());
-        CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
-        ctfLocation.setLocation(Long.valueOf(1));
-        fixture.setLocation(ctfLocation);
-        fixture.increaseRank();
-        long rank = 1L;
-
-        fixture.setRank(rank);
-
-        // add additional test code here
-        // An unexpected exception was thrown in user code while executing this test:
-        //    java.lang.NullPointerException
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
-        //       at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
-    }
-
-    /**
-     * Run the void setRank(long) method test.
-     *
-     * @throws Exception
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
-     */
-    @Test
-    public void testSetRank_2()
-        throws Exception {
-        CtfIterator fixture = new CtfIterator(createTrace());
-        CtfLocation ctfLocation = new CtfLocation(Long.valueOf(1));
-        ctfLocation.setLocation(Long.valueOf(1));
-        fixture.setLocation(ctfLocation);
-        fixture.increaseRank();
-        long rank = 1L;
-
-        fixture.setRank(rank);
-
-        // add additional test code here
-        // An unexpected exception was thrown in user code while executing this test:
-        //    java.lang.NullPointerException
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.createStreamInputReaders(CTFTraceReader.java:152)
-        //       at org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader.<init>(CTFTraceReader.java:92)
-        //       at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator.<init>(CtfIterator.java:40)
-    }
-
-    /**
-     * Perform pre-test initialization.
-     *
-     * @throws Exception
-     *         if the initialization fails for some reason
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
-     */
-    @Before
-    public void setUp()
-        throws Exception {
-        // add additional set up code here
-    }
-
-    /**
-     * Perform post-test clean-up.
-     *
-     * @throws Exception
-     *         if the clean-up fails for some reason
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
-     */
-    @After
-    public void tearDown()
-        throws Exception {
-        // Add additional tear down code here
-    }
-
-    /**
-     * Launch the test.
-     *
-     * @param args the command line arguments
-     *
-     * @generatedBy CodePro at 03/05/12 2:29 PM
-     */
-    public static void main(String[] args) {
-        new org.junit.runner.JUnitCore().run(CtfIteratorTest.class);
     }
-}
\ No newline at end of file
+}
This page took 0.031419 seconds and 5 git commands to generate.