1 /*******************************************************************************
2 * Copyright (c) 2013 Ericsson
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
10 * Alexandre Montplaisir - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.tmf
.core
.tests
.shared
;
15 import org
.eclipse
.linuxtools
.ctf
.core
.tests
.shared
.CtfTestTrace
;
16 import org
.eclipse
.linuxtools
.tmf
.core
.ctfadaptor
.CtfTmfEvent
;
17 import org
.eclipse
.linuxtools
.tmf
.core
.ctfadaptor
.CtfTmfTrace
;
18 import org
.eclipse
.linuxtools
.tmf
.core
.exceptions
.TmfTraceException
;
21 * Available CTF TMF test traces. Kind-of-extends {@link CtfTestTrace}.
23 * To run tests using these, you first need to run the "get-traces.[xml|sh]"
24 * script located under lttng/org.eclipse.linuxtools.ctf.core.tests/traces/ .
26 * @author Alexandre Montplaisir
28 public enum CtfTmfTestTrace
{
29 /** Example kernel trace */
31 /** Another kernel trace */
33 /** Kernel trace with event contexts */
35 /** UST trace with lots of lost events */
37 /** Autogenerated Syntetic trace */
39 /** Trace with non-standard field sizes */
43 private final String fPath
;
44 private CtfTmfTrace fTrace
= null;
46 private CtfTmfTestTrace() {
47 /* This makes my head spin */
48 fPath
= CtfTestTrace
.valueOf(this.name()).getPath();
52 * @return The path of this trace
54 public String
getPath() {
59 * Return a CtfTmfTrace object of this test trace. It will be already
60 * initTrace()'ed. You do not have to .dispose() the trace after use (the
61 * old one is disposed automatically when this method is called again).
63 * Make sure you call {@link #exists()} before calling this!
65 * @return A CtfTmfTrace reference to this trace
67 public synchronized CtfTmfTrace
getTrace() {
71 fTrace
= new CtfTmfTrace();
73 fTrace
.initTrace(null, fPath
, CtfTmfEvent
.class);
74 } catch (TmfTraceException e
) {
75 /* Should not happen if tracesExist() passed */
76 throw new RuntimeException(e
);
82 * Check if the trace actually exists on disk or not.
84 * @return If the trace is present
86 public boolean exists() {
87 return CtfTestTrace
.valueOf(this.name()).exists();
This page took 0.031813 seconds and 5 git commands to generate.