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 */
39 private final String fPath
;
40 private CtfTmfTrace fTrace
= null;
42 private CtfTmfTestTrace() {
43 /* This makes my head spin */
44 fPath
= CtfTestTrace
.valueOf(this.name()).getPath();
48 * @return The path of this trace
50 public String
getPath() {
55 * Return a CtfTmfTrace object of this test trace. It will be already
58 * Make sure you call {@link #exists()} before calling this!
60 * @return A CtfTmfTrace reference to this trace
62 public CtfTmfTrace
getTrace() {
64 CtfTmfTrace trace
= new CtfTmfTrace();
66 trace
.initTrace(null, fPath
, CtfTmfEvent
.class);
67 } catch (TmfTraceException e
) {
68 /* Should not happen if tracesExist() passed */
69 throw new RuntimeException(e
);
77 * Check if the trace actually exists on disk or not.
79 * @return If the trace is present
81 public boolean exists() {
82 return CtfTestTrace
.valueOf(this.name()).exists();
This page took 0.03539 seconds and 5 git commands to generate.