ctf: Depend on the tracecompass-test-traces project
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.os.linux.core.tests / src / org / eclipse / tracecompass / analysis / os / linux / core / tests / kernelanalysis / KernelStateProviderTest.java
CommitLineData
efc403bb 1/*******************************************************************************
ed902a2b 2 * Copyright (c) 2012, 2015 Ericsson
efc403bb
AM
3 * Copyright (c) 2010, 2011 École Polytechnique de Montréal
4 * Copyright (c) 2010, 2011 Alexandre Montplaisir <alexandre.montplaisir@gmail.com>
e743c3b8 5 *
efc403bb
AM
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
e743c3b8 10 *
efc403bb
AM
11 *******************************************************************************/
12
6d16f5a9 13package org.eclipse.tracecompass.analysis.os.linux.core.tests.kernelanalysis;
efc403bb 14
b4f71e4a 15import static org.junit.Assert.assertEquals;
8020be3c 16
c4d57ac1 17import org.eclipse.jdt.annotation.NonNull;
6d16f5a9
AM
18import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
19import org.eclipse.tracecompass.internal.analysis.os.linux.core.kernelanalysis.KernelStateProvider;
c4d57ac1 20import org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace;
2bdf0193 21import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider;
c4d57ac1
AM
22import org.eclipse.tracecompass.tmf.ctf.core.tests.shared.CtfTmfTestTraceUtils;
23import org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace;
24import org.junit.AfterClass;
efc403bb
AM
25import org.junit.BeforeClass;
26import org.junit.Test;
efc403bb
AM
27
28/**
e363eae1 29 * Tests for the {@link KernelStateProvider}
e743c3b8 30 *
2ba3d0a1 31 * @author Alexandre Montplaisir
efc403bb 32 */
6d16f5a9 33public class KernelStateProviderTest {
efc403bb 34
c4d57ac1 35 private static final @NonNull CtfTestTrace testTrace = CtfTestTrace.TRACE2;
92ba8466 36
c4d57ac1 37 private static CtfTmfTrace trace;
0fe46f2a 38 private static ITmfStateProvider input;
efc403bb 39
2ba3d0a1
AM
40 /**
41 * Set-up.
2ba3d0a1 42 */
efc403bb 43 @BeforeClass
92ba8466 44 public static void initialize() {
c4d57ac1
AM
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 }
efc403bb
AM
58 }
59
2ba3d0a1
AM
60 /**
61 * Test loading the state provider.
62 */
efc403bb
AM
63 @Test
64 public void testOpening() {
65 long testStartTime;
66 testStartTime = input.getStartTime();
6d16f5a9
AM
67 /* Expected start time of "trace2" */
68 assertEquals(testStartTime, 1331668247314038062L);
efc403bb
AM
69 }
70
efc403bb 71}
This page took 0.067337 seconds and 5 git commands to generate.