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
.StateHistorySystem
;
19 import org
.eclipse
.linuxtools
.tmf
.core
.statesystem
.backend
.historytree
.ThreadedHistoryTreeBackend
;
20 import org
.eclipse
.linuxtools
.tmf
.core
.statesystem
.helpers
.HistoryBuilder
;
21 import org
.eclipse
.linuxtools
.tmf
.core
.statesystem
.helpers
.IStateChangeInput
;
22 import org
.eclipse
.linuxtools
.tmf
.core
.statesystem
.helpers
.IStateHistoryBackend
;
24 import org
.junit
.BeforeClass
;
25 import org
.junit
.Test
;
28 * Variant of the StateSystemFullHistoryTest, which uses the threaded event
34 public class StateSystemFullThreadedHistoryTest
extends
35 StateSystemFullHistoryTest
{
37 /* Hiding the static method in the superclass */
38 protected static String
getTestFileName() {
39 return "/tmp/statefile-threaded.ht"; //$NON-NLS-1$
43 public static void initialize() {
44 stateFile
= new File(getTestFileName());
45 stateFileBenchmark
= new File(getTestFileName() + ".benchmark"); //$NON-NLS-1$
47 input
= new CTFKernelStateInput(CTFTestFiles
.getTestTrace());
48 hp
= new ThreadedHistoryTreeBackend(stateFile
,
49 input
.getStartTime(), 2000);
50 builder
= new HistoryBuilder(input
, hp
);
51 } catch (Exception e
) {
55 shs
= (StateHistorySystem
) builder
.getSS();
60 public void testBuild() {
61 HistoryBuilder zebuilder
;
62 IStateChangeInput zeinput
;
63 IStateHistoryBackend zehp
;
66 zeinput
= new CTFKernelStateInput(CTFTestFiles
.getTestTrace());
67 zehp
= new ThreadedHistoryTreeBackend(stateFileBenchmark
,
68 zeinput
.getStartTime(), 2000);
69 zebuilder
= new HistoryBuilder(zeinput
, zehp
);
71 } catch (Exception e
) {