Fix for bug 381252
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.kernel.core.tests / src / org / eclipse / linuxtools / lttng2 / kernel / core / tests / stateprovider / StateSystemFullThreadedHistoryTest.java
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>
5 *
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
10 *
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.lttng2.kernel.core.tests.stateprovider;
14
15 import java.io.File;
16
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;
22
23 import org.junit.BeforeClass;
24 import org.junit.Test;
25
26 /**
27 * Variant of the StateSystemFullHistoryTest, which uses the threaded event
28 * handler instead.
29 *
30 * @author alexmont
31 *
32 */
33 public class StateSystemFullThreadedHistoryTest extends
34 StateSystemFullHistoryTest {
35
36 /* Hiding the static method in the superclass */
37 protected static String getTestFileName() {
38 return "/tmp/statefile-threaded.ht"; //$NON-NLS-1$
39 }
40
41 @BeforeClass
42 public static void initialize() {
43 stateFile = new File(getTestFileName());
44 stateFileBenchmark = new File(getTestFileName() + ".benchmark"); //$NON-NLS-1$
45 try {
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) {
51 e.printStackTrace();
52 }
53 builder.startBuilding(null);
54 ssb = builder.getStateSystemBuilder();
55 }
56
57 @Override
58 @Test
59 public void testBuild() {
60 HistoryBuilder zebuilder;
61 IStateChangeInput zeinput;
62 IStateHistoryBackend zehp;
63
64 try {
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) {
71 e.printStackTrace();
72 }
73 }
74 }
This page took 0.032024 seconds and 5 git commands to generate.