tmf: Re-enable the unit tests depending on CTF traces
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core.tests / src / org / eclipse / linuxtools / tmf / core / tests / ctfadaptor / CtfTmfTraceTest.java
index 7f9d448c0fb3e0e39bb93ae9b1898be49dd64366..5a179ff9cc3bbdb95a54939b37c55afa5983cfcc 100644 (file)
@@ -17,11 +17,12 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeTrue;
 
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfLocation;
-import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfLocationData;
+import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfLocationInfo;
 import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfEvent;
 import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace;
@@ -32,6 +33,7 @@ import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
 import org.eclipse.linuxtools.tmf.core.signal.TmfEndSynchSignal;
 import org.eclipse.linuxtools.tmf.core.signal.TmfSignal;
+import org.eclipse.linuxtools.tmf.core.tests.shared.CtfTmfTestTraces;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
 import org.junit.After;
 import org.junit.Before;
@@ -46,7 +48,8 @@ import org.junit.Test;
  */
 public class CtfTmfTraceTest {
 
-    private static final String PATH = TestParams.getPath();
+    private static final int TRACE_INDEX = 0;
+    private static final String PATH = CtfTmfTestTraces.getTestTracePath(TRACE_INDEX);
 
     private CtfTmfTrace fixture;
 
@@ -58,6 +61,7 @@ public class CtfTmfTraceTest {
      */
     @Before
     public void setUp() throws TmfTraceException {
+        assumeTrue(CtfTmfTestTraces.tracesExist());
         fixture = new CtfTmfTrace();
         fixture.initTrace((IResource) null, PATH, CtfTmfEvent.class);
     }
@@ -67,7 +71,9 @@ public class CtfTmfTraceTest {
      */
     @After
     public void tearDown() {
-        fixture.dispose();
+        if (fixture != null) {
+            fixture.dispose();
+        }
     }
 
     /**
@@ -200,7 +206,7 @@ public class CtfTmfTraceTest {
      */
     @Test
     public void testGetLocationRatio() {
-        final CtfLocationData location2 = new CtfLocationData(1, 0);
+        final CtfLocationInfo location2 = new CtfLocationInfo(1, 0);
         CtfLocation location = new CtfLocation(location2);
         double result = fixture.getLocationRatio(location);
 
@@ -334,7 +340,7 @@ public class CtfTmfTraceTest {
      */
     @Test
     public void testSeekEvent_location() {
-        final CtfLocationData location2 = new CtfLocationData(1L, 0L);
+        final CtfLocationInfo location2 = new CtfLocationInfo(1L, 0L);
         CtfLocation ctfLocation = new CtfLocation(location2);
         ITmfContext result = fixture.seekEvent(ctfLocation);
         assertNotNull(result);
This page took 0.024931 seconds and 5 git commands to generate.