1 /*******************************************************************************
2 * Copyright (c) 2013 Ericsson
3 * All rights reserved. This program and the accompanying materials are
4 * made available under the terms of the Eclipse Public License v1.0 which
5 * accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * Alexandre Montplaisir - Initial API and implementation
10 ******************************************************************************/
12 package org
.eclipse
.linuxtools
.lttng2
.kernel
.core
.tests
.stateprovider
;
14 import static org
.junit
.Assume
.assumeTrue
;
17 import java
.io
.IOException
;
19 import org
.eclipse
.linuxtools
.internal
.lttng2
.kernel
.core
.stateprovider
.CtfKernelStateProvider
;
20 import org
.eclipse
.linuxtools
.tmf
.core
.exceptions
.TimeRangeException
;
21 import org
.eclipse
.linuxtools
.tmf
.core
.exceptions
.TmfTraceException
;
22 import org
.eclipse
.linuxtools
.tmf
.core
.statesystem
.StateSystemManager
;
23 import org
.eclipse
.linuxtools
.tmf
.core
.tests
.shared
.CtfTmfTestTraces
;
24 import org
.junit
.BeforeClass
;
25 import org
.junit
.Test
;
28 * State system tests using a partial history.
30 * @author Alexandre Montplaisir
32 public class PartialStateSystemTest
extends StateSystemTest
{
38 public static void initialize() {
39 assumeTrue(CtfTmfTestTraces
.tracesExist());
40 File stateFile
= null;
42 stateFile
= File
.createTempFile("test-partial", ".ht");
43 stateFile
.deleteOnExit();
45 input
= new CtfKernelStateProvider(CtfTmfTestTraces
.getTestTrace(TRACE_INDEX
));
46 ssq
= StateSystemManager
.newPartialHistory(stateFile
, input
, true);
47 } catch (IOException e
) {
49 } catch (TmfTraceException e
) {
55 * Partial histories cannot get the intervals' end times. The fake value that
56 * is returned is equal to the query's timestamp. So override this here
57 * so that {@link #testFullQueryThorough} keeps working.
60 protected long getEndTimes(int idx
) {
61 return interestingTimestamp1
;
64 // ------------------------------------------------------------------------
65 // Skip tests using single-queries (unsupported in partial history)
66 // ------------------------------------------------------------------------
69 @Test(expected
= UnsupportedOperationException
.class)
70 public void testSingleQuery1() {
71 super.testSingleQuery1();
75 @Test(expected
= UnsupportedOperationException
.class)
76 public void testRangeQuery1() {
77 super.testRangeQuery1();
81 @Test(expected
= UnsupportedOperationException
.class)
82 public void testRangeQuery2() {
83 super.testRangeQuery2();
87 @Test(expected
= UnsupportedOperationException
.class)
88 public void testRangeQuery3() {
89 super.testRangeQuery3();
93 @Test(expected
= UnsupportedOperationException
.class)
94 public void testSingleQueryInvalidTime1() throws TimeRangeException
{
95 super.testSingleQueryInvalidTime1();
99 @Test(expected
= UnsupportedOperationException
.class)
100 public void testSingleQueryInvalidTime2() throws TimeRangeException
{
101 super.testSingleQueryInvalidTime2();
105 @Test(expected
= UnsupportedOperationException
.class)
106 public void testRangeQueryInvalidTime1() throws TimeRangeException
{
107 super.testRangeQueryInvalidTime1();
111 @Test(expected
= UnsupportedOperationException
.class)
112 public void testRangeQueryInvalidTime2() throws TimeRangeException
{
113 super.testRangeQueryInvalidTime2();