tmf: Fix wrong interval returns in the history backend
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.kernel.core.tests / src / org / eclipse / linuxtools / lttng2 / kernel / core / tests / stateprovider / StateSystemFullThreadedHistoryTest.java
CommitLineData
efc403bb
AM
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
13package org.eclipse.linuxtools.lttng2.kernel.core.tests.stateprovider;
14
15import java.io.File;
16
dc0f7bfe 17import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.CtfKernelStateInput;
efc403bb
AM
18import org.eclipse.linuxtools.tmf.core.statesystem.StateHistorySystem;
19import org.eclipse.linuxtools.tmf.core.statesystem.backend.historytree.ThreadedHistoryTreeBackend;
20import org.eclipse.linuxtools.tmf.core.statesystem.helpers.HistoryBuilder;
21import org.eclipse.linuxtools.tmf.core.statesystem.helpers.IStateChangeInput;
22import org.eclipse.linuxtools.tmf.core.statesystem.helpers.IStateHistoryBackend;
23
24import org.junit.BeforeClass;
25import org.junit.Test;
26
27/**
28 * Variant of the StateSystemFullHistoryTest, which uses the threaded event
29 * handler instead.
30 *
31 * @author alexmont
32 *
33 */
34public 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 {
dc0f7bfe 47 input = new CtfKernelStateInput(CtfTestFiles.getTestTrace());
efc403bb
AM
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();
fee997a5 56 builder.close(); /* Waits for the construction to finish */
efc403bb
AM
57 }
58
59 @Override
60 @Test
61 public void testBuild() {
62 HistoryBuilder zebuilder;
63 IStateChangeInput zeinput;
64 IStateHistoryBackend zehp;
65
66 try {
dc0f7bfe 67 zeinput = new CtfKernelStateInput(CtfTestFiles.getTestTrace());
efc403bb
AM
68 zehp = new ThreadedHistoryTreeBackend(stateFileBenchmark,
69 zeinput.getStartTime(), 2000);
70 zebuilder = new HistoryBuilder(zeinput, zehp);
71 zebuilder.run();
72 } catch (Exception e) {
73 e.printStackTrace();
74 }
75 }
76}
This page took 0.027921 seconds and 5 git commands to generate.