ctf: Depend on the tracecompass-test-traces project
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.os.linux.core.tests / src / org / eclipse / tracecompass / analysis / os / linux / core / tests / kernelanalysis / KernelStateProviderTest.java
index 4f53a3d4b3211a9866d1faead1bf9d5c3938d3bb..9cd8c426dcc79defab6aabf9d78b05f471f55be5 100644 (file)
 package org.eclipse.tracecompass.analysis.os.linux.core.tests.kernelanalysis;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assume.assumeTrue;
 
+import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
 import org.eclipse.tracecompass.internal.analysis.os.linux.core.kernelanalysis.KernelStateProvider;
+import org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace;
 import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider;
-import org.eclipse.tracecompass.tmf.ctf.core.tests.shared.CtfTmfTestTrace;
+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;
 import org.junit.Test;
 
@@ -29,8 +32,9 @@ import org.junit.Test;
  */
 public class KernelStateProviderTest {
 
-    private static final CtfTmfTestTrace testTrace = CtfTmfTestTrace.TRACE2;
+    private static final @NonNull CtfTestTrace testTrace = CtfTestTrace.TRACE2;
 
+    private static CtfTmfTrace trace;
     private static ITmfStateProvider input;
 
     /**
@@ -38,8 +42,19 @@ public class KernelStateProviderTest {
      */
     @BeforeClass
     public static void initialize() {
-        assumeTrue(testTrace.exists());
-        input = new KernelStateProvider(testTrace.getTrace(), IKernelAnalysisEventLayout.DEFAULT_LAYOUT);
+        CtfTmfTrace thetrace = CtfTmfTestTraceUtils.getTrace(testTrace);
+        trace = thetrace;
+        input = new KernelStateProvider(thetrace, IKernelAnalysisEventLayout.DEFAULT_LAYOUT);
+    }
+
+    /**
+     * Class teardown
+     */
+    @AfterClass
+    public static void classTeardown() {
+        if (trace != null) {
+            trace.dispose();
+        }
     }
 
     /**
This page took 0.025549 seconds and 5 git commands to generate.