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 public abstract class TestParams
{
16 /* Path to test traces */
17 private static final String testTracePath1
= "Tests/traces/trace20m"; //$NON-NLS-1$
18 private static CTFTrace testTrace1
= null;
19 private static CTFTrace testTraceFromFile1
= null;
21 private static final File emptyFile
= new File(""); //$NON-NLS-1$
22 private static CTFTrace emptyTrace
= null;
24 public static File
getEmptyFile() {
28 public static CTFTrace
getEmptyTrace() {
29 if (emptyTrace
== null) {
31 emptyTrace
= new CTFTrace(""); //$NON-NLS-1$
32 } catch (CTFReaderException e
) {
33 /* We know this trace should exist */
34 throw new RuntimeException(e
);
40 public static CTFTrace
createTrace() {
41 if (testTrace1
== null) {
43 testTrace1
= new CTFTrace(testTracePath1
);
44 } catch (CTFReaderException e
) {
45 /* We know this trace should exist */
46 throw new RuntimeException(e
);
52 public static CTFTrace
createTraceFromFile() {
53 if (testTraceFromFile1
== null) {
55 testTraceFromFile1
= new CTFTrace(new File(testTracePath1
));
56 } catch (CTFReaderException e
) {
57 /* We know this trace should exist */
58 throw new RuntimeException(e
);
61 return testTraceFromFile1
;