gdbtrace: Move plugins to the Trace Compass namespace
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.kernel.core.tests / src / org / eclipse / linuxtools / lttng2 / kernel / core / tests / stateprovider / StateSystemInMemoryTest.java
index 18df8006b435584618f6f8ae32b7506ded5db64e..80cec1cbd72e63a803edd4ddb71c092f799f0f37 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2013 Ericsson
+ * Copyright (c) 2013, 2014 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
 
 package org.eclipse.linuxtools.lttng2.kernel.core.tests.stateprovider;
 
-import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
-import static org.junit.Assume.assumeTrue;
 
 import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.LttngKernelStateProvider;
-import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace;
+import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem;
 import org.eclipse.linuxtools.tmf.core.exceptions.TmfAnalysisException;
 import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider;
 import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
-import org.junit.BeforeClass;
+import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfTrace;
+import org.junit.After;
 
 /**
  * State system tests using the in-memory back-end.
@@ -33,14 +32,11 @@ import org.junit.BeforeClass;
  */
 public class StateSystemInMemoryTest extends StateSystemTest {
 
-    /**
-     * Initialization
-     */
-    @BeforeClass
-    public static void initialize() {
-        assumeTrue(testTrace.exists());
+    private TestLttngKernelAnalysisModule module;
 
-        TestLttngKernelAnalysisModule module = new TestLttngKernelAnalysisModule();
+    @Override
+    protected ITmfStateSystem initialize() {
+        module = new TestLttngKernelAnalysisModule();
         try {
             module.setTrace(testTrace.getTrace());
         } catch (TmfAnalysisException e) {
@@ -48,8 +44,17 @@ public class StateSystemInMemoryTest extends StateSystemTest {
         }
         module.schedule();
         assertTrue(module.waitForCompletion());
-        ssq = module.getStateSystem();
-        assertNotNull(ssq);
+        return module.getStateSystem();
+    }
+
+    /**
+     * Class cleanup
+     */
+    @After
+    public void cleanup() {
+        if (module != null) {
+            module.close();
+        }
     }
 
     private static class TestLttngKernelAnalysisModule extends TmfStateSystemAnalysisModule {
@@ -71,7 +76,7 @@ public class StateSystemInMemoryTest extends StateSystemTest {
 
         @Override
         protected ITmfStateProvider createStateProvider() {
-            return new LttngKernelStateProvider((CtfTmfTrace) getTrace());
+            return new LttngKernelStateProvider(getTrace());
         }
 
         @Override
This page took 0.026575 seconds and 5 git commands to generate.