ctf: Depend on the tracecompass-test-traces project
[deliverable/tracecompass.git] / lttng / org.eclipse.tracecompass.lttng2.kernel.core.tests / src / org / eclipse / tracecompass / lttng2 / kernel / core / tests / analysis / kernel / statesystem / PartialStateSystemTest.java
index 7dfbae841e072e5c0233ee093ff83758731cb9cd..8aaa4cabc736e41395c3eb495eabe8a3be8269ad 100644 (file)
@@ -25,6 +25,7 @@ import org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException;
 import org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException;
 import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
 import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
+import org.eclipse.tracecompass.tmf.ctf.core.tests.shared.CtfTmfTestTraceUtils;
 import org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
@@ -41,6 +42,7 @@ public class PartialStateSystemTest extends StateSystemTest {
 
     private static final @NonNull String TEST_FILE_NAME = "test-partial";
 
+    private static CtfTmfTrace trace;
     private static File stateFile;
     private static TestLttngKernelAnalysisModule module;
 
@@ -49,20 +51,16 @@ public class PartialStateSystemTest extends StateSystemTest {
      */
     @BeforeClass
     public static void initialize() {
-        if (!testTrace.exists()) {
-            traceIsPresent = false;
-            return;
-        }
-        traceIsPresent = true;
+        trace = CtfTmfTestTraceUtils.getTrace(testTrace);
 
-        stateFile = new File(TmfTraceManager.getSupplementaryFileDir(testTrace.getTrace()) + TEST_FILE_NAME);
+        stateFile = new File(TmfTraceManager.getSupplementaryFileDir(trace) + TEST_FILE_NAME);
         if (stateFile.exists()) {
             stateFile.delete();
         }
 
         module = new TestLttngKernelAnalysisModule(TEST_FILE_NAME);
         try {
-            assertTrue(module.setTrace(testTrace.getTrace()));
+            assertTrue(module.setTrace(trace));
         } catch (TmfAnalysisException e) {
             fail();
         }
@@ -86,8 +84,12 @@ public class PartialStateSystemTest extends StateSystemTest {
         if (fixture != null) {
             fixture.dispose();
         }
+        if (trace != null) {
+            trace.dispose();
+        }
         module = null;
         fixture = null;
+        trace = null;
     }
 
     /**
This page took 0.025407 seconds and 5 git commands to generate.