83752c305abf2da7ba1aecd3c95810f99973d661
[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.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;
27
28 /**
29 * Tests for the {@link KernelStateProvider}
30 *
31 * @author Alexandre Montplaisir
32 */
33 public class KernelStateProviderTest {
34
35 private static final @NonNull CtfTestTrace testTrace = CtfTestTrace.TRACE2;
36
37 private static CtfTmfTrace trace;
38 private static ITmfStateProvider input;
39
40 /**
41 * Set-up.
42 */
43 @BeforeClass
44 public static void initialize() {
45 CtfTmfTrace thetrace = CtfTmfTestTraceUtils.getTrace(testTrace);
46 trace = thetrace;
47 input = new KernelStateProvider(thetrace, IKernelAnalysisEventLayout.DEFAULT_LAYOUT);
48 }
49
50 /**
51 * Class teardown
52 */
53 @AfterClass
54 public static void classTeardown() {
55 if (trace != null) {
56 trace.dispose();
57 }
58 }
59
60 /**
61 * Test loading the state provider.
62 */
63 @Test
64 public void testOpening() {
65 long testStartTime;
66 testStartTime = input.getStartTime();
67 /* Expected start time of "trace2" */
68 assertEquals(testStartTime, 1331668247314038062L);
69 }
70
71 }
This page took 0.032405 seconds and 4 git commands to generate.