1 /*******************************************************************************
2 * Copyright (c) 2014 École Polytechnique de Montréal
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Geneviève Bastien - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.lttng2
.kernel
.core
.tests
.analysis
;
15 import static org
.junit
.Assert
.assertFalse
;
16 import static org
.junit
.Assert
.assertNotNull
;
17 import static org
.junit
.Assert
.assertNull
;
18 import static org
.junit
.Assert
.assertTrue
;
19 import static org
.junit
.Assert
.fail
;
20 import static org
.junit
.Assume
.assumeTrue
;
22 import java
.util
.List
;
24 import org
.eclipse
.linuxtools
.lttng2
.kernel
.core
.analysis
.LttngKernelAnalysisModule
;
25 import org
.eclipse
.linuxtools
.statesystem
.core
.ITmfStateSystem
;
26 import org
.eclipse
.linuxtools
.tmf
.core
.exceptions
.TmfAnalysisException
;
27 import org
.eclipse
.linuxtools
.tmf
.core
.tests
.shared
.TmfTestHelper
;
28 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.ITmfTrace
;
29 import org
.eclipse
.linuxtools
.tmf
.ctf
.core
.tests
.shared
.CtfTmfTestTrace
;
30 import org
.junit
.After
;
31 import org
.junit
.Before
;
32 import org
.junit
.Test
;
35 * Test the {@link LttngKernelAnalysisModule} class
37 * @author Geneviève Bastien
39 public class LttngKernelAnalysisTest
{
41 private ITmfTrace fTrace
;
48 assumeTrue(CtfTmfTestTrace
.KERNEL
.exists());
49 fTrace
= CtfTmfTestTrace
.KERNEL
.getTrace();
53 * Dispose test objects
56 public void tearDown() {
61 * Test the LTTng kernel analysis execution
64 public void testAnalysisExecution() {
65 LttngKernelAnalysisModule module
= new LttngKernelAnalysisModule();
68 module
.setTrace(fTrace
);
69 } catch (TmfAnalysisException e
) {
72 // Assert the state system has not been initialized yet
73 ITmfStateSystem ss
= module
.getStateSystem();
76 assertTrue(TmfTestHelper
.executeAnalysis(module
));
78 ss
= module
.getStateSystem();
81 List
<Integer
> quarks
= ss
.getQuarks("*");
82 assertFalse(quarks
.isEmpty());