1 /*******************************************************************************
2 * Copyright (c) 2013, 2015 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
.lttng
.scope
.lttng
.kernel
.core
.analysis
.os
.statesystem
;
16 import static org
.junit
.Assert
.assertTrue
;
17 import static org
.junit
.Assert
.fail
;
19 import org
.eclipse
.tracecompass
.ctf
.tmf
.core
.tests
.shared
.CtfTmfTestTraceUtils
;
20 import org
.eclipse
.tracecompass
.ctf
.tmf
.core
.trace
.CtfTmfTrace
;
21 import org
.eclipse
.tracecompass
.tmf
.core
.exceptions
.TmfAnalysisException
;
22 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.ITmfTrace
;
23 import org
.junit
.AfterClass
;
24 import org
.junit
.BeforeClass
;
25 import org
.lttng
.scope
.lttng
.kernel
.core
.analysis
.os
.KernelAnalysisModule
;
28 * State system tests using the in-memory back-end.
30 * @author Alexandre Montplaisir
32 public class StateSystemInMemoryTest
extends StateSystemTest
{
34 private static CtfTmfTrace trace
;
35 private static TestLttngKernelAnalysisModule module
;
41 public static void initialize() {
42 CtfTmfTrace thetrace
= CtfTmfTestTraceUtils
.getTrace(testTrace
);
45 module
= new TestLttngKernelAnalysisModule();
47 assertTrue(module
.setTrace(thetrace
));
48 } catch (TmfAnalysisException e
) {
52 assertTrue(module
.waitForCompletion());
54 fixture
= module
.getStateSystem();
61 public static void cleanup() {
65 if (fixture
!= null) {
76 private static class TestLttngKernelAnalysisModule
extends KernelAnalysisModule
{
79 * Constructor adding the views to the analysis
81 public TestLttngKernelAnalysisModule() {
86 public boolean setTrace(ITmfTrace trace
) throws TmfAnalysisException
{
87 if (!(trace
instanceof CtfTmfTrace
)) {
90 return super.setTrace(trace
);
94 protected StateSystemBackendType
getBackendType() {
95 return StateSystemBackendType
.INMEM
;