1 /*******************************************************************************
2 * Copyright (c) 2012, 2014 Ericsson
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 * Alexandre Montplaisir - Initial API and implementation
11 ******************************************************************************/
13 package org
.eclipse
.linuxtools
.tmf
.ctf
.core
.tests
.statistics
;
15 import static org
.junit
.Assert
.assertNotNull
;
16 import static org
.junit
.Assert
.assertTrue
;
17 import static org
.junit
.Assert
.fail
;
18 import static org
.junit
.Assume
.assumeTrue
;
20 import org
.eclipse
.linuxtools
.tmf
.core
.exceptions
.TmfAnalysisException
;
21 import org
.eclipse
.linuxtools
.tmf
.core
.statesystem
.ITmfStateSystem
;
22 import org
.eclipse
.linuxtools
.tmf
.core
.statistics
.TmfStateStatistics
;
23 import org
.eclipse
.linuxtools
.tmf
.core
.statistics
.TmfStatisticsEventTypesModule
;
24 import org
.eclipse
.linuxtools
.tmf
.core
.statistics
.TmfStatisticsTotalsModule
;
25 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.ITmfTrace
;
26 import org
.junit
.After
;
27 import org
.junit
.Before
;
28 import org
.junit
.BeforeClass
;
31 * Unit tests for the {@link TmfStateStatistics}
33 * @author Alexandre Montplaisir
35 public class TmfStateStatisticsTest
extends TmfStatisticsTest
{
37 private ITmfTrace fTrace
;
43 public static void setUpClass() {
44 assumeTrue(testTrace
.exists());
52 fTrace
= testTrace
.getTrace();
54 /* Prepare the two analysis-backed state systems */
55 TmfStatisticsTotalsModule totalsMod
= new TmfStatisticsTotalsModule();
56 TmfStatisticsEventTypesModule eventTypesMod
= new TmfStatisticsEventTypesModule();
58 totalsMod
.setTrace(fTrace
);
59 eventTypesMod
.setTrace(fTrace
);
60 } catch (TmfAnalysisException e
) {
65 eventTypesMod
.schedule();
66 assertTrue(totalsMod
.waitForCompletion());
67 assertTrue(eventTypesMod
.waitForCompletion());
69 ITmfStateSystem totalsSS
= totalsMod
.getStateSystem();
70 ITmfStateSystem eventTypesSS
= eventTypesMod
.getStateSystem();
71 assertNotNull(totalsSS
);
72 assertNotNull(eventTypesSS
);
74 backend
= new TmfStateStatistics(totalsSS
, eventTypesSS
);
81 public void tearDown() {