Commit | Line | Data |
---|---|---|
95bf10e7 AM |
1 | /******************************************************************************* |
2 | * Copyright (c) 2012 Ericsson | |
3 | * | |
4 | * All rights reserved. This program and the accompanying materials are | |
5 | * made available under the terms of the Eclipse Public License v1.0 which | |
6 | * accompanies this distribution, and is available at | |
7 | * http://www.eclipse.org/legal/epl-v10.html | |
8 | * | |
9 | * Contributors: | |
10 | * Matthew Khouzam - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | ||
a3fc8213 AM |
13 | package org.eclipse.linuxtools.tmf.core.tests.ctfadaptor; |
14 | ||
15 | import java.io.File; | |
a3fc8213 AM |
16 | |
17 | import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfEvent; | |
18 | import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace; | |
b4f71e4a | 19 | import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException; |
a3fc8213 | 20 | |
95bf10e7 AM |
21 | /** |
22 | * This is the set up for the trace files to be used with the ctfAdaptor tests. | |
23 | */ | |
24 | abstract class TestParams { | |
25e48683 | 25 | |
a3fc8213 | 26 | /* Path to test traces */ |
95bf10e7 | 27 | private static final String testTracePath1 = "../org.eclipse.linuxtools.ctf.core.tests/traces/kernel"; //$NON-NLS-1$ |
a3fc8213 | 28 | private static CtfTmfTrace testTrace1 = null; |
25e48683 | 29 | |
a3fc8213 AM |
30 | private static final File emptyFile = new File(""); //$NON-NLS-1$ |
31 | private static CtfTmfTrace emptyTrace = new CtfTmfTrace(); | |
8636b448 | 32 | |
a3fc8213 AM |
33 | public static File getEmptyFile() { |
34 | return emptyFile; | |
35 | } | |
25e48683 | 36 | |
a3fc8213 AM |
37 | public static CtfTmfTrace getEmptyTrace() { |
38 | return emptyTrace; | |
39 | } | |
25e48683 | 40 | |
81c8e6f7 MK |
41 | public static String getPath(){ |
42 | return testTracePath1; | |
43 | } | |
44 | ||
0879b6b9 FC |
45 | public synchronized static CtfTmfTrace createTrace() throws TmfTraceException { |
46 | if (testTrace1 == null) { | |
a3fc8213 | 47 | testTrace1 = new CtfTmfTrace(); |
25e48683 | 48 | testTrace1.initTrace(null, testTracePath1, CtfTmfEvent.class); |
a3fc8213 AM |
49 | } |
50 | return testTrace1; | |
51 | } | |
52 | } |