abce66bdb0a1a4b1b9e5fcc9511238ea433510ae
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.os.linux.core.tests / src / org / eclipse / tracecompass / analysis / os / linux / core / tests / kernelanalysis / KernelStateProviderTest.java
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>
5 *
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
10 *
11 *******************************************************************************/
12
13 package org.eclipse.tracecompass.analysis.os.linux.core.tests.kernelanalysis;
14
15 import static org.junit.Assert.assertEquals;
16
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;
26
27 /**
28 * Tests for the {@link KernelStateProvider}
29 *
30 * @author Alexandre Montplaisir
31 */
32 public class KernelStateProviderTest {
33
34 private static final @NonNull LinuxTestCase KERNEL_TEST_CASE = KernelAnalysisTestFactory.KERNEL_SCHED;
35
36 private IKernelTrace fTrace;
37 private ITmfStateProvider fInput;
38
39 /**
40 * Set-up.
41 */
42 @Before
43 public void initialize() {
44 IKernelTrace thetrace = KERNEL_TEST_CASE.getKernelTrace();
45 fTrace = thetrace;
46 fInput = new KernelStateProvider(thetrace, thetrace.getKernelEventLayout());
47 }
48
49 /**
50 * Class teardown
51 */
52 @After
53 public void classTeardown() {
54 if (fTrace != null) {
55 fTrace.dispose();
56 }
57 }
58
59 /**
60 * Test loading the state provider.
61 */
62 @Test
63 public void testOpening() {
64 long testStartTime;
65 testStartTime = fInput.getStartTime();
66 /* Expected start time of the trace */
67 assertEquals(testStartTime, 1L);
68 }
69
70 }
This page took 0.035243 seconds and 4 git commands to generate.