1 /*******************************************************************************
2 * Copyright (c) 2012, 2015 Ericsson
3 * Copyright (c) 2010, 2011 École Polytechnique de Montréal
4 * Copyright (c) 2010, 2011 Alexandre Montplaisir <alexandre.montplaisir@gmail.com>
6 * All rights reserved. This program and the accompanying materials are
7 * made available under the terms of the Eclipse Public License v1.0 which
8 * accompanies this distribution, and is available at
9 * http://www.eclipse.org/legal/epl-v10.html
11 *******************************************************************************/
13 package org
.eclipse
.tracecompass
.analysis
.os
.linux
.core
.tests
.kernelanalysis
;
15 import static org
.junit
.Assert
.assertEquals
;
17 import org
.eclipse
.jdt
.annotation
.NonNull
;
18 import org
.eclipse
.tracecompass
.analysis
.os
.linux
.core
.trace
.IKernelAnalysisEventLayout
;
19 import org
.eclipse
.tracecompass
.internal
.analysis
.os
.linux
.core
.kernel
.KernelStateProvider
;
20 import org
.eclipse
.tracecompass
.testtraces
.ctf
.CtfTestTrace
;
21 import org
.eclipse
.tracecompass
.tmf
.core
.statesystem
.ITmfStateProvider
;
22 import org
.eclipse
.tracecompass
.tmf
.ctf
.core
.tests
.shared
.CtfTmfTestTraceUtils
;
23 import org
.eclipse
.tracecompass
.tmf
.ctf
.core
.trace
.CtfTmfTrace
;
24 import org
.junit
.AfterClass
;
25 import org
.junit
.BeforeClass
;
26 import org
.junit
.Test
;
29 * Tests for the {@link KernelStateProvider}
31 * @author Alexandre Montplaisir
33 public class KernelStateProviderTest
{
35 private static final @NonNull CtfTestTrace testTrace
= CtfTestTrace
.TRACE2
;
37 private static CtfTmfTrace trace
;
38 private static ITmfStateProvider input
;
44 public static void initialize() {
45 CtfTmfTrace thetrace
= CtfTmfTestTraceUtils
.getTrace(testTrace
);
47 input
= new KernelStateProvider(thetrace
, IKernelAnalysisEventLayout
.DEFAULT_LAYOUT
);
54 public static void classTeardown() {
61 * Test loading the state provider.
64 public void testOpening() {
66 testStartTime
= input
.getStartTime();
67 /* Expected start time of "trace2" */
68 assertEquals(testStartTime
, 1331668247314038062L);