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
.Assert
.fail
;
15 import static org
.junit
.Assume
.assumeTrue
;
18 import java
.io
.IOException
;
20 import org
.eclipse
.linuxtools
.internal
.lttng2
.kernel
.core
.stateprovider
.LttngKernelStateProvider
;
21 import org
.eclipse
.linuxtools
.tmf
.core
.exceptions
.TimeRangeException
;
22 import org
.eclipse
.linuxtools
.tmf
.core
.exceptions
.TmfTraceException
;
23 import org
.eclipse
.linuxtools
.tmf
.core
.statesystem
.TmfStateSystemFactory
;
24 import org
.junit
.AfterClass
;
25 import org
.junit
.BeforeClass
;
26 import org
.junit
.Test
;
29 * State system tests using a partial history.
31 * @author Alexandre Montplaisir
33 public class PartialStateSystemTest
extends StateSystemTest
{
35 private static File stateFile
;
41 public static void initialize() {
42 assumeTrue(testTrace
.exists());
44 stateFile
= File
.createTempFile("test-partial", ".ht");
46 input
= new LttngKernelStateProvider(testTrace
.getTrace());
47 ssq
= TmfStateSystemFactory
.newPartialHistory(stateFile
, input
, true);
48 } catch (IOException e
) {
50 } catch (TmfTraceException e
) {
59 public static void tearDownClass() {
64 * Partial histories cannot get the intervals' end times. The fake value that
65 * is returned is equal to the query's timestamp. So override this here
66 * so that {@link #testFullQueryThorough} keeps working.
69 protected long getEndTimes(int idx
) {
70 return interestingTimestamp1
;
73 // ------------------------------------------------------------------------
74 // Skip tests using single-queries (unsupported in partial history)
75 // ------------------------------------------------------------------------
78 @Test(expected
= UnsupportedOperationException
.class)
79 public void testSingleQuery1() {
80 super.testSingleQuery1();
84 @Test(expected
= UnsupportedOperationException
.class)
85 public void testRangeQuery1() {
86 super.testRangeQuery1();
90 @Test(expected
= UnsupportedOperationException
.class)
91 public void testRangeQuery2() {
92 super.testRangeQuery2();
96 @Test(expected
= UnsupportedOperationException
.class)
97 public void testRangeQuery3() {
98 super.testRangeQuery3();
102 @Test(expected
= UnsupportedOperationException
.class)
103 public void testSingleQueryInvalidTime1() throws TimeRangeException
{
104 super.testSingleQueryInvalidTime1();
108 @Test(expected
= UnsupportedOperationException
.class)
109 public void testSingleQueryInvalidTime2() throws TimeRangeException
{
110 super.testSingleQueryInvalidTime2();
114 @Test(expected
= UnsupportedOperationException
.class)
115 public void testRangeQueryInvalidTime1() throws TimeRangeException
{
116 super.testRangeQueryInvalidTime1();
120 @Test(expected
= UnsupportedOperationException
.class)
121 public void testRangeQueryInvalidTime2() throws TimeRangeException
{
122 super.testRangeQueryInvalidTime2();