1 /*******************************************************************************
2 * Copyright (c) 2013, 2014 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Alexandre Montplaisir - Initial API and implementation
11 * Bernd Hufmann - Use state system analysis module instead of factory
12 ******************************************************************************/
14 package org
.eclipse
.linuxtools
.lttng2
.kernel
.core
.tests
.stateprovider
;
16 import static org
.junit
.Assert
.assertNotNull
;
17 import static org
.junit
.Assert
.assertTrue
;
18 import static org
.junit
.Assert
.fail
;
19 import static org
.junit
.Assume
.assumeTrue
;
21 import org
.eclipse
.linuxtools
.internal
.lttng2
.kernel
.core
.stateprovider
.LttngKernelStateProvider
;
22 import org
.eclipse
.linuxtools
.tmf
.core
.exceptions
.TmfAnalysisException
;
23 import org
.eclipse
.linuxtools
.tmf
.core
.statesystem
.ITmfStateProvider
;
24 import org
.eclipse
.linuxtools
.tmf
.core
.statesystem
.TmfStateSystemAnalysisModule
;
25 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.ITmfTrace
;
26 import org
.eclipse
.linuxtools
.tmf
.ctf
.core
.CtfTmfTrace
;
27 import org
.junit
.AfterClass
;
28 import org
.junit
.BeforeClass
;
31 * State system tests using the in-memory back-end.
33 * @author Alexandre Montplaisir
35 public class StateSystemInMemoryTest
extends StateSystemTest
{
37 private static TestLttngKernelAnalysisModule module
;
43 public static void initialize() {
44 assumeTrue(testTrace
.exists());
46 module
= new TestLttngKernelAnalysisModule();
48 module
.setTrace(testTrace
.getTrace());
49 } catch (TmfAnalysisException e
) {
53 assertTrue(module
.waitForCompletion());
54 ssq
= module
.getStateSystem();
62 public static void cleanupClass() {
66 private static class TestLttngKernelAnalysisModule
extends TmfStateSystemAnalysisModule
{
69 * Constructor adding the views to the analysis
71 public TestLttngKernelAnalysisModule() {
76 public void setTrace(ITmfTrace trace
) throws TmfAnalysisException
{
77 if (!(trace
instanceof CtfTmfTrace
)) {
78 throw new IllegalStateException("TestLttngKernelAnalysisModule: trace should be of type CtfTmfTrace"); //$NON-NLS-1$
80 super.setTrace(trace
);
84 protected ITmfStateProvider
createStateProvider() {
85 return new LttngKernelStateProvider(getTrace());
89 protected StateSystemBackendType
getBackendType() {
90 return StateSystemBackendType
.INMEM
;