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 / trace / TmfExperimentTest.java
index 4158292593a0f8864d30438db5250af28dd9310c..d3ca984e19179661c85b0ff2c7633254dbedc55c 100644 (file)
@@ -38,7 +38,7 @@ import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
 import org.eclipse.linuxtools.tmf.core.trace.TmfExperiment;
-import org.eclipse.linuxtools.tmf.core.trace.TmfLocation;
+import org.eclipse.linuxtools.tmf.core.trace.TmfLongLocation;
 import org.eclipse.linuxtools.tmf.tests.stubs.trace.TmfExperimentStub;
 import org.eclipse.linuxtools.tmf.tests.stubs.trace.TmfTraceStub;
 
@@ -190,7 +190,7 @@ public class TmfExperimentTest extends TestCase {
     // ------------------------------------------------------------------------
 
     public void testSeekBadLocation() {
-        ITmfContext context = fExperiment.seekEvent(new TmfLocation<Long>(0L));
+        ITmfContext context = fExperiment.seekEvent(new TmfLongLocation(0L));
         assertNull("seekEvent", context);
     }
 
@@ -244,7 +244,6 @@ public class TmfExperimentTest extends TestCase {
         assertEquals("Context rank", 0, context.getRank());
     }
 
-    @SuppressWarnings("rawtypes")
     public void testGetLocationRatio() {
 
         // First event
@@ -536,7 +535,7 @@ public class TmfExperimentTest extends TestCase {
     public void testSeekLocationOutOfScope() {
 
         // Position trace at beginning
-        ITmfContext context = fExperiment.seekEvent((ITmfLocation<?>) null);
+        ITmfContext context = fExperiment.seekEvent((ITmfLocation) null);
 
         ITmfEvent event = fExperiment.getNext(context);
         assertEquals("Event timestamp", 1, event.getTimestamp().getValue());
@@ -723,7 +722,7 @@ public class TmfExperimentTest extends TestCase {
 
     public void testGetNextAfterSeekingOnLocation_1() {
 
-        final ITmfLocation<?> INITIAL_LOC = null;
+        final ITmfLocation INITIAL_LOC = null;
         final long INITIAL_TS = 1;
         final int NB_READS = 20;
 
@@ -750,7 +749,7 @@ public class TmfExperimentTest extends TestCase {
 
     public void testGetNextAfterSeekingOnLocation_2() {
 
-        final ITmfLocation<?> INITIAL_LOC = fExperiment.seekEvent(1L).getLocation();
+        final ITmfLocation INITIAL_LOC = fExperiment.seekEvent(1L).getLocation();
         final long INITIAL_TS = 2;
         final int NB_READS = 20;
 
@@ -775,7 +774,7 @@ public class TmfExperimentTest extends TestCase {
 
     public void testGetNextAfterSeekingOnLocation_3() {
 
-        final ITmfLocation<?> INITIAL_LOC = fExperiment.seekEvent(500L).getLocation();
+        final ITmfLocation INITIAL_LOC = fExperiment.seekEvent(500L).getLocation();
         final long INITIAL_TS = 501;
         final int NB_READS = 20;
 
@@ -801,7 +800,7 @@ public class TmfExperimentTest extends TestCase {
     public void testGetNextLocation() {
         ITmfContext context1 = fExperiment.seekEvent(0);
         fExperiment.getNext(context1);
-        ITmfLocation<?> location = context1.getLocation().clone();
+        ITmfLocation location = context1.getLocation();
         ITmfEvent event1 = fExperiment.getNext(context1);
         ITmfContext context2 = fExperiment.seekEvent(location);
         ITmfEvent event2 = fExperiment.getNext(context2);
@@ -811,7 +810,7 @@ public class TmfExperimentTest extends TestCase {
     public void testGetNextEndLocation() {
         ITmfContext context1 = fExperiment.seekEvent(fExperiment.getNbEvents() - 1);
         fExperiment.getNext(context1);
-        ITmfLocation<?> location = context1.getLocation().clone();
+        ITmfLocation location = context1.getLocation();
         ITmfContext context2 = fExperiment.seekEvent(location);
         ITmfEvent event = fExperiment.getNext(context2);
         assertNull("Event", event);
This page took 0.047032 seconds and 5 git commands to generate.