1 /*******************************************************************************
2 * Copyright (c) 2012 Ericsson
3 * Copyright (c) 2010, 2011 École Polytechnique de Montréal
4 * Copyright (c) 2010, 2011 Alexandre Montplaisir <alexandre.montplaisir@gmail.com>
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
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.lttng2
.kernel
.core
.tests
.stateprovider
;
17 import org
.eclipse
.linuxtools
.internal
.lttng2
.kernel
.core
.stateprovider
.CtfKernelStateInput
;
18 import org
.eclipse
.linuxtools
.tmf
.core
.statesystem
.HistoryBuilder
;
19 import org
.eclipse
.linuxtools
.tmf
.core
.statesystem
.IStateChangeInput
;
20 import org
.eclipse
.linuxtools
.tmf
.core
.statesystem
.IStateHistoryBackend
;
21 import org
.eclipse
.linuxtools
.tmf
.core
.statesystem
.backend
.historytree
.ThreadedHistoryTreeBackend
;
23 import org
.junit
.BeforeClass
;
24 import org
.junit
.Test
;
27 * Variant of the StateSystemFullHistoryTest, which uses the threaded event
33 public class StateSystemFullThreadedHistoryTest
extends
34 StateSystemFullHistoryTest
{
36 /* Hiding the static method in the superclass */
37 protected static String
getTestFileName() {
38 return "/tmp/statefile-threaded.ht"; //$NON-NLS-1$
42 public static void initialize() {
43 stateFile
= new File(getTestFileName());
44 stateFileBenchmark
= new File(getTestFileName() + ".benchmark"); //$NON-NLS-1$
46 input
= new CtfKernelStateInput(CtfTestFiles
.getTestTrace());
47 hp
= new ThreadedHistoryTreeBackend(stateFile
,
48 input
.getStartTime(), 2000);
49 builder
= new HistoryBuilder(input
, hp
);
50 } catch (Exception e
) {
53 builder
.startBuilding(null);
54 ssb
= builder
.getStateSystemBuilder();
59 public void testBuild() {
60 HistoryBuilder zebuilder
;
61 IStateChangeInput zeinput
;
62 IStateHistoryBackend zehp
;
65 zeinput
= new CtfKernelStateInput(CtfTestFiles
.getTestTrace());
66 zehp
= new ThreadedHistoryTreeBackend(stateFileBenchmark
,
67 zeinput
.getStartTime(), 2000);
68 zebuilder
= new HistoryBuilder(zeinput
, zehp
);
69 zebuilder
.startBuilding(null);
70 } catch (Exception e
) {