tmf: Don't use .deleteOnExit() in unit tests
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.kernel.core.tests / src / org / eclipse / linuxtools / lttng2 / kernel / core / tests / stateprovider / PartialStateSystemTest.java
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
7 *
8 * Contributors:
9 * Alexandre Montplaisir - Initial API and implementation
10 ******************************************************************************/
11
12 package org.eclipse.linuxtools.lttng2.kernel.core.tests.stateprovider;
13
14 import static org.junit.Assert.fail;
15 import static org.junit.Assume.assumeTrue;
16
17 import java.io.File;
18 import java.io.IOException;
19
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;
27
28 /**
29 * State system tests using a partial history.
30 *
31 * @author Alexandre Montplaisir
32 */
33 public class PartialStateSystemTest extends StateSystemTest {
34
35 private static File stateFile;
36
37 /**
38 * Initialization
39 */
40 @BeforeClass
41 public static void initialize() {
42 assumeTrue(testTrace.exists());
43 try {
44 stateFile = File.createTempFile("test-partial", ".ht");
45
46 input = new LttngKernelStateProvider(testTrace.getTrace());
47 ssq = TmfStateSystemFactory.newPartialHistory(stateFile, input, true);
48 } catch (IOException e) {
49 fail();
50 } catch (TmfTraceException e) {
51 fail();
52 }
53 }
54
55 /**
56 * Class clean-up
57 */
58 @AfterClass
59 public static void tearDownClass() {
60 stateFile.delete();
61 }
62
63 /**
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.
67 */
68 @Override
69 protected long getEndTimes(int idx) {
70 return interestingTimestamp1;
71 }
72
73 // ------------------------------------------------------------------------
74 // Skip tests using single-queries (unsupported in partial history)
75 // ------------------------------------------------------------------------
76
77 @Override
78 @Test(expected = UnsupportedOperationException.class)
79 public void testSingleQuery1() {
80 super.testSingleQuery1();
81 }
82
83 @Override
84 @Test(expected = UnsupportedOperationException.class)
85 public void testRangeQuery1() {
86 super.testRangeQuery1();
87 }
88
89 @Override
90 @Test(expected = UnsupportedOperationException.class)
91 public void testRangeQuery2() {
92 super.testRangeQuery2();
93 }
94
95 @Override
96 @Test(expected = UnsupportedOperationException.class)
97 public void testRangeQuery3() {
98 super.testRangeQuery3();
99 }
100
101 @Override
102 @Test(expected = UnsupportedOperationException.class)
103 public void testSingleQueryInvalidTime1() throws TimeRangeException {
104 super.testSingleQueryInvalidTime1();
105 }
106
107 @Override
108 @Test(expected = UnsupportedOperationException.class)
109 public void testSingleQueryInvalidTime2() throws TimeRangeException {
110 super.testSingleQueryInvalidTime2();
111 }
112
113 @Override
114 @Test(expected = UnsupportedOperationException.class)
115 public void testRangeQueryInvalidTime1() throws TimeRangeException {
116 super.testRangeQueryInvalidTime1();
117 }
118
119 @Override
120 @Test(expected = UnsupportedOperationException.class)
121 public void testRangeQueryInvalidTime2() throws TimeRangeException {
122 super.testRangeQueryInvalidTime2();
123 }
124 }
This page took 0.037295 seconds and 6 git commands to generate.