ctf: Fix Javadoc for all public methods
[deliverable/tracecompass.git] / org.eclipse.linuxtools.ctf.core.tests / src / org / eclipse / linuxtools / ctf / core / tests / TestParams.java
1 package org.eclipse.linuxtools.ctf.core.tests;
2
3 import java.io.File;
4
5 import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
6 import org.eclipse.linuxtools.ctf.core.trace.CTFTrace;
7
8 /**
9 * Here are the definitions common to all the CTF parser tests.
10 *
11 * @author alexmont
12 *
13 */
14 @SuppressWarnings("javadoc")
15 public abstract class TestParams {
16
17 /*
18 * Path to test traces. Make sure you run the traces/get-traces.sh script
19 * first!
20 */
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$
25
26 private static final File emptyFile = new File(""); //$NON-NLS-1$
27 private static CTFTrace emptyTrace = null;
28
29 public static File getEmptyFile() {
30 return emptyFile;
31 }
32
33 public static File getTraceFile(){
34 return testTraceFile1;
35 }
36 public static CTFTrace getEmptyTrace() {
37 if (emptyTrace == null) {
38 try {
39 emptyTrace = new CTFTrace(""); //$NON-NLS-1$
40 } catch (CTFReaderException e) {
41 /* We know this trace should exist */
42 throw new RuntimeException(e);
43 }
44 }
45 return emptyTrace;
46 }
47
48 public static CTFTrace createTrace() throws CTFReaderException {
49 if (testTrace1 == null) {
50 testTrace1 = new CTFTrace(testTracePath1);
51 }
52 return testTrace1;
53 }
54
55 public static CTFTrace createTraceFromFile() {
56 if (testTraceFromFile1 == null) {
57 try {
58 testTraceFromFile1 = new CTFTrace(new File(testTracePath1));
59 } catch (CTFReaderException e) {
60 /* We know this trace should exist */
61 throw new RuntimeException(e);
62 }
63 }
64 return testTraceFromFile1;
65 }
66 }
This page took 0.032873 seconds and 5 git commands to generate.