Commit | Line | Data |
---|---|---|
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 | 13 | package org.eclipse.tracecompass.analysis.os.linux.core.tests.kernelanalysis; |
efc403bb | 14 | |
b4f71e4a | 15 | import static org.junit.Assert.assertEquals; |
92ba8466 | 16 | import static org.junit.Assume.assumeTrue; |
8020be3c | 17 | |
6d16f5a9 AM |
18 | import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout; |
19 | import org.eclipse.tracecompass.internal.analysis.os.linux.core.kernelanalysis.KernelStateProvider; | |
2bdf0193 AM |
20 | import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider; |
21 | import org.eclipse.tracecompass.tmf.ctf.core.tests.shared.CtfTmfTestTrace; | |
efc403bb AM |
22 | import org.junit.BeforeClass; |
23 | import org.junit.Test; | |
efc403bb AM |
24 | |
25 | /** | |
e363eae1 | 26 | * Tests for the {@link KernelStateProvider} |
e743c3b8 | 27 | * |
2ba3d0a1 | 28 | * @author Alexandre Montplaisir |
efc403bb | 29 | */ |
6d16f5a9 | 30 | public class KernelStateProviderTest { |
efc403bb | 31 | |
9ac63b5b | 32 | private static final CtfTmfTestTrace testTrace = CtfTmfTestTrace.TRACE2; |
92ba8466 | 33 | |
0fe46f2a | 34 | private static ITmfStateProvider input; |
efc403bb | 35 | |
2ba3d0a1 AM |
36 | /** |
37 | * Set-up. | |
2ba3d0a1 | 38 | */ |
efc403bb | 39 | @BeforeClass |
92ba8466 | 40 | public static void initialize() { |
9ac63b5b | 41 | assumeTrue(testTrace.exists()); |
6d16f5a9 | 42 | input = new KernelStateProvider(testTrace.getTrace(), IKernelAnalysisEventLayout.DEFAULT_LAYOUT); |
efc403bb AM |
43 | } |
44 | ||
2ba3d0a1 AM |
45 | /** |
46 | * Test loading the state provider. | |
47 | */ | |
efc403bb AM |
48 | @Test |
49 | public void testOpening() { | |
50 | long testStartTime; | |
51 | testStartTime = input.getStartTime(); | |
6d16f5a9 AM |
52 | /* Expected start time of "trace2" */ |
53 | assertEquals(testStartTime, 1331668247314038062L); | |
efc403bb AM |
54 | } |
55 | ||
efc403bb | 56 | } |