1 package org
.eclipse
.linuxtools
.ctf
.core
.tests
;
5 import org
.eclipse
.linuxtools
.ctf
.core
.trace
.CTFReaderException
;
6 import org
.eclipse
.linuxtools
.ctf
.core
.trace
.CTFTrace
;
9 * Here are the definitions common to all the CTF parser tests.
14 @SuppressWarnings("javadoc")
15 public abstract class TestParams
{
18 * Path to test traces. Make sure you run the traces/get-traces.sh script
21 private static final String testTracePath1
= "traces/kernel"; //$NON-NLS-1$
22 private static CTFTrace testTrace1
= null;
23 private static CTFTrace testTraceFromFile1
= null;
24 private static final File testTraceFile1
= new File(testTracePath1
+"/channel0_0"); //$NON-NLS-1$
26 private static final File emptyFile
= new File(""); //$NON-NLS-1$
27 private static CTFTrace emptyTrace
= null;
29 public static File
getEmptyFile() {
33 public static File
getTraceFile(){
34 return testTraceFile1
;
36 public static CTFTrace
getEmptyTrace() {
37 if (emptyTrace
== null) {
39 emptyTrace
= new CTFTrace(""); //$NON-NLS-1$
40 } catch (CTFReaderException e
) {
41 /* We know this trace should exist */
42 throw new RuntimeException(e
);
48 public static CTFTrace
createTrace() throws CTFReaderException
{
49 if (testTrace1
== null) {
50 testTrace1
= new CTFTrace(testTracePath1
);
55 public static CTFTrace
createTraceFromFile() {
56 if (testTraceFromFile1
== null) {
58 testTraceFromFile1
= new CTFTrace(new File(testTracePath1
));
59 } catch (CTFReaderException e
) {
60 /* We know this trace should exist */
61 throw new RuntimeException(e
);
64 return testTraceFromFile1
;