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
.tests
.stubs
.LinuxTestCase
;
19 import org
.eclipse
.tracecompass
.analysis
.os
.linux
.core
.tests
.stubs
.kernel
.KernelAnalysisTestFactory
;
20 import org
.eclipse
.tracecompass
.analysis
.os
.linux
.core
.trace
.IKernelTrace
;
21 import org
.eclipse
.tracecompass
.internal
.analysis
.os
.linux
.core
.kernel
.KernelStateProvider
;
22 import org
.eclipse
.tracecompass
.tmf
.core
.statesystem
.ITmfStateProvider
;
23 import org
.junit
.After
;
24 import org
.junit
.Before
;
25 import org
.junit
.Test
;
28 * Tests for the {@link KernelStateProvider}
30 * @author Alexandre Montplaisir
32 public class KernelStateProviderTest
{
34 private static final @NonNull LinuxTestCase KERNEL_TEST_CASE
= KernelAnalysisTestFactory
.KERNEL_SCHED
;
36 private IKernelTrace fTrace
;
37 private ITmfStateProvider fInput
;
43 public void initialize() {
44 IKernelTrace thetrace
= KERNEL_TEST_CASE
.getKernelTrace();
46 fInput
= new KernelStateProvider(thetrace
, thetrace
.getKernelEventLayout());
53 public void classTeardown() {
60 * Test loading the state provider.
63 public void testOpening() {
65 testStartTime
= fInput
.getStartTime();
66 /* Expected start time of the trace */
67 assertEquals(testStartTime
, 1L);