Fix location of the new test trace file
[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.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;
23
24 import org.junit.BeforeClass;
25 import org.junit.Test;
26
27 /**
28 * Variant of the StateSystemFullHistoryTest, which uses the threaded event
29 * handler instead.
30 *
31 * @author alexmont
32 *
33 */
34 public class StateSystemFullThreadedHistoryTest extends
35 StateSystemFullHistoryTest {
36
37 /* Hiding the static method in the superclass */
38 protected static String getTestFileName() {
39 return "/tmp/statefile-threaded.ht"; //$NON-NLS-1$
40 }
41
42 @BeforeClass
43 public static void initialize() {
44 stateFile = new File(getTestFileName());
45 stateFileBenchmark = new File(getTestFileName() + ".benchmark"); //$NON-NLS-1$
46 try {
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) {
52 e.printStackTrace();
53 }
54 builder.run();
55 shs = (StateHistorySystem) builder.getSS();
56 }
57
58 @Override
59 @Test
60 public void testBuild() {
61 HistoryBuilder zebuilder;
62 IStateChangeInput zeinput;
63 IStateHistoryBackend zehp;
64
65 try {
66 zeinput = new CTFKernelStateInput(CTFTestFiles.getTestTrace());
67 zehp = new ThreadedHistoryTreeBackend(stateFileBenchmark,
68 zeinput.getStartTime(), 2000);
69 zebuilder = new HistoryBuilder(zeinput, zehp);
70 zebuilder.run();
71 } catch (Exception e) {
72 e.printStackTrace();
73 }
74 }
75 }
This page took 0.032397 seconds and 5 git commands to generate.