Commit | Line | Data |
---|---|---|
60cabb56 | 1 | /******************************************************************************* |
b9d50127 | 2 | * Copyright (c) 2016 Ericsson and others |
60cabb56 PT |
3 | * |
4 | * All rights reserved. This program and the accompanying materials are | |
5 | * made available under the terms of the Eclipse Public License v1.0 which | |
6 | * accompanies this distribution, and is available at | |
7 | * http://www.eclipse.org/legal/epl-v10.html | |
8 | *******************************************************************************/ | |
9 | ||
10 | package org.eclipse.tracecompass.statesystem.core.tests.backend; | |
11 | ||
12 | import java.io.File; | |
13 | import java.io.IOException; | |
14 | ||
15 | import org.eclipse.tracecompass.internal.statesystem.core.backend.historytree.ThreadedHistoryTreeBackend; | |
16 | import org.eclipse.tracecompass.statesystem.core.backend.IStateHistoryBackend; | |
17 | ||
18 | /** | |
19 | * Test the {@link ThreadedHistoryTreeBackend} class. | |
20 | * | |
21 | * @author Patrick Tasse | |
60cabb56 PT |
22 | */ |
23 | public class ThreadedHistoryTreeBackendTest extends HistoryTreeBackendTest { | |
24 | ||
25 | private static final int QUEUE_SIZE = 10; | |
26 | ||
27 | /** | |
28 | * Constructor | |
29 | * | |
30 | * @param reOpen | |
31 | * True if the backend should be disposed and re-opened as a new | |
32 | * backend from the file, or false to use the backend as-is | |
33 | */ | |
34 | public ThreadedHistoryTreeBackendTest(Boolean reOpen) { | |
35 | super(reOpen); | |
36 | } | |
37 | ||
38 | @Override | |
39 | protected IStateHistoryBackend getBackendForBuilding(long startTime) throws IOException { | |
40 | File historyTreeFile = File.createTempFile("ThreadedHistoryTreeBackendTest", ".ht"); | |
41 | fHistoryTreeFiles.add(historyTreeFile); | |
42 | ThreadedHistoryTreeBackend backend = new ThreadedHistoryTreeBackend(SSID, historyTreeFile, PROVIDER_VERSION, startTime, QUEUE_SIZE, fBlockSize, fMaxChildren); | |
43 | fBackendMap.put(backend, historyTreeFile); | |
44 | return backend; | |
45 | } | |
46 | } |