--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2013 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Geneviève Bastien - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.tmf.core.tests.shared;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
+import org.eclipse.linuxtools.tmf.core.tests.TmfCoreTestPlugin;
+import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
+import org.eclipse.linuxtools.tmf.tests.stubs.trace.TmfTraceStub;
+
+/**
+ * Wrapper, imitating the {@link CtfTmfTestTrace} class for the non-ctf traces
+ *
+ * @author Geneviève Bastien
+ */
+public enum TmfTestTrace {
+ /** A test */
+ A_TEST_10K("A-Test-10K"),
+ /** A second trace */
+ A_TEST_10K2("A-Test-10K-2"),
+ /** A third trace */
+ E_TEST_10K("E-Test-10K"),
+ /** A fourth trace */
+ O_TEST_10K("O-Test-10K"),
+ /** And oh! a fifth trace */
+ R_TEST_10K("R-Test-10K");
+
+
+ private final String fPath;
+ private final String fDirectory = "testfiles";
+ private ITmfTrace fTrace = null;
+
+ private TmfTestTrace(String file) {
+ fPath = file;
+ }
+
+ /**
+ * Get the path of the trace
+ *
+ * @return The path of this trace
+ */
+ public String getPath() {
+ return fPath;
+ }
+
+ /**
+ * Get the full path of the trace
+ *
+ * @return The full path of the trace
+ */
+ public String getFullPath() {
+ return fDirectory + File.separator + fPath;
+ }
+
+ /**
+ * Return a ITmfTrace object of this test trace. It will be already
+ * initTrace()'ed.
+ *
+ * @return A {@link ITmfTrace} reference to this trace
+ */
+ public ITmfTrace getTrace() {
+ if (fTrace == null) {
+ TmfTraceStub trace = null;
+ final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(fDirectory + File.separator + fPath), null);
+ try {
+ File test = new File(FileLocator.toFileURL(location).toURI());
+ trace = new TmfTraceStub(test.toURI().getPath(), ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, false, null, null);
+
+ } catch (URISyntaxException e) {
+ throw new RuntimeException(e);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ } catch (TmfTraceException e) {
+ throw new RuntimeException(e);
+ } finally {
+ if (trace != null) {
+ trace.dispose();
+ }
+ }
+ fTrace = trace;
+ }
+ return fTrace;
+ }
+}
import org.eclipse.linuxtools.tmf.core.event.TmfEventType;
import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
import org.eclipse.linuxtools.tmf.core.tests.TmfCoreTestPlugin;
+import org.eclipse.linuxtools.tmf.core.tests.shared.TmfTestTrace;
import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
// ------------------------------------------------------------------------
private static TmfTraceStub openTrace() {
- final String DIRECTORY = "testfiles";
- final String TEST_STREAM = "A-Test-10K";
- final String path = DIRECTORY + File.separator + TEST_STREAM;
-
TmfTraceStub trace = null;
try {
- final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(path), null);
+ final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TmfTestTrace.A_TEST_10K.getFullPath()), null);
final File test = new File(FileLocator.toFileURL(location).toURI());
trace = new TmfTraceStub(test.toURI().getPath(), 500, false);
} catch (final TmfTraceException e) {
import org.eclipse.linuxtools.tmf.core.signal.TmfSignalHandler;
import org.eclipse.linuxtools.tmf.core.signal.TmfSignalManager;
import org.eclipse.linuxtools.tmf.core.tests.TmfCoreTestPlugin;
+import org.eclipse.linuxtools.tmf.core.tests.shared.TmfTestTrace;
import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
import org.eclipse.linuxtools.tmf.tests.stubs.request.TmfEventRequestStub;
// Coalescing
// ------------------------------------------------------------------------
- private static final String DIRECTORY = "testfiles";
- private static final String TEST_STREAM = "A-Test-10K";
+ private static final TmfTestTrace TEST_TRACE = TmfTestTrace.A_TEST_10K;
private static final int NB_EVENTS = 5000;
private static final int BLOCK_SIZE = 100;
public void runCoalescedRequest(long startIndex) throws InterruptedException {
- fTrace = setupTrace(DIRECTORY + File.separator + TEST_STREAM);
+ fTrace = setupTrace(TEST_TRACE.getFullPath());
TmfSignalManager.register(this);
TmfTestTriggerSignal signal = new TmfTestTriggerSignal(this, startIndex, false);
@Test
public void testCancelCoalescedRequest() throws InterruptedException {
- fTrace = setupTrace(DIRECTORY + File.separator + TEST_STREAM);
+ fTrace = setupTrace(TEST_TRACE.getFullPath());
TmfSignalManager.register(this);
TmfTestTriggerSignal signal = new TmfTestTriggerSignal(this, 0, true);
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
import org.eclipse.linuxtools.tmf.core.tests.TmfCoreTestPlugin;
+import org.eclipse.linuxtools.tmf.core.tests.shared.TmfTestTrace;
import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
import org.eclipse.linuxtools.tmf.core.trace.ITmfCheckpoint;
import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
// Variables
// ------------------------------------------------------------------------
- private static final String DIRECTORY = "testfiles";
- private static final String TEST_STREAM = "A-Test-10K";
private static final int BLOCK_SIZE = 100;
private static final int NB_EVENTS = 10000;
private static TestTrace fTrace = null;
@Before
public void setUp() {
- setupTrace(DIRECTORY + File.separator + TEST_STREAM);
+ setupTrace(TmfTestTrace.A_TEST_10K.getFullPath());
}
@After
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
import org.eclipse.linuxtools.tmf.core.tests.TmfCoreTestPlugin;
+import org.eclipse.linuxtools.tmf.core.tests.shared.TmfTestTrace;
import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
import org.eclipse.linuxtools.tmf.core.trace.ITmfCheckpoint;
import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
// Variables
// ------------------------------------------------------------------------
- private static final String DIRECTORY = "testfiles";
- // Trace has 3 events at t=101 at rank 99, 100, 101
- // Trace has events with same timestamp (ts=102) for ranks 102..702 -> 2 checkpoints with same timestamp are created
- private static final String TEST_STREAM = "A-Test-10K-2";
private static final int BLOCK_SIZE = 100;
private static final int NB_EVENTS = 702;
private static TestTrace fTrace = null;
@Before
public void setUp() {
- setupTrace(DIRECTORY + File.separator + TEST_STREAM);
+ // Trace has 3 events at t=101 at rank 99, 100, 101
+ // Trace has events with same timestamp (ts=102) for ranks 102..702 -> 2 checkpoints with same timestamp are created
+ setupTrace(TmfTestTrace.A_TEST_10K2.getFullPath());
}
@After
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
import org.eclipse.linuxtools.tmf.core.tests.TmfCoreTestPlugin;
+import org.eclipse.linuxtools.tmf.core.tests.shared.TmfTestTrace;
import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
import org.eclipse.linuxtools.tmf.core.trace.ITmfCheckpoint;
// Attributes
// ------------------------------------------------------------------------
- private static final String DIRECTORY = "testfiles";
- private static final String TEST_STREAM1 = "O-Test-10K";
- private static final String TEST_STREAM2 = "E-Test-10K";
private static final String EXPERIMENT = "MyExperiment";
+ private static final TmfTestTrace TEST_TRACE1 = TmfTestTrace.O_TEST_10K;
+ private static final TmfTestTrace TEST_TRACE2 = TmfTestTrace.E_TEST_10K;
private static int NB_EVENTS = 20000;
private static int BLOCK_SIZE = 1000;
}
private static void setupTraces() {
- final String path1 = DIRECTORY + File.separator + TEST_STREAM1;
- final String path2 = DIRECTORY + File.separator + TEST_STREAM2;
fTestTraces = new ITmfTrace[2];
try {
- URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(path1), null);
+ URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TEST_TRACE1.getFullPath()), null);
File test = new File(FileLocator.toFileURL(location).toURI());
final TmfTraceStub trace1 = new TmfTraceStub(test.getPath(), 0, true);
fTestTraces[0] = trace1;
- location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(path2), null);
+ location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TEST_TRACE2.getFullPath()), null);
test = new File(FileLocator.toFileURL(location).toURI());
final TmfTraceStub trace2 = new TmfTraceStub(test.getPath(), 0, true);
fTestTraces[1] = trace2;
public void testGrowingIndex() {
ITmfTrace[] testTraces = new TmfTraceStub[2];
try {
- URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(DIRECTORY + File.separator + TEST_STREAM1), null);
+ URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TEST_TRACE1.getFullPath()), null);
File test = new File(FileLocator.toFileURL(location).toURI());
final TmfTraceStub trace1 = new TmfTraceStub(test.getPath(), 0, false);
testTraces[0] = trace1;
- location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(DIRECTORY + File.separator + TEST_STREAM2), null);
+ location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TEST_TRACE2.getFullPath()), null);
test = new File(FileLocator.toFileURL(location).toURI());
final TmfTraceStub trace2 = new TmfTraceStub(test.getPath(), 0, false);
testTraces[1] = trace2;
import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateSystem;
import org.eclipse.linuxtools.tmf.core.statistics.ITmfStatistics;
import org.eclipse.linuxtools.tmf.core.tests.TmfCoreTestPlugin;
+import org.eclipse.linuxtools.tmf.core.tests.shared.TmfTestTrace;
import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
// Attributes
// ------------------------------------------------------------------------
- private static final String DIRECTORY = "testfiles";
- private static final String TEST_STREAM = "A-Test-10K";
private static final String EXPERIMENT = "MyExperiment";
private static int NB_EVENTS = 10000;
private static int BLOCK_SIZE = 1000;
@Before
public void setUp() {
- setupTrace(DIRECTORY + File.separator + TEST_STREAM);
+ setupTrace(TmfTestTrace.A_TEST_10K.getFullPath());
setupExperiment();
}
import org.eclipse.linuxtools.tmf.core.request.TmfDataRequest;
import org.eclipse.linuxtools.tmf.core.request.TmfEventRequest;
import org.eclipse.linuxtools.tmf.core.tests.TmfCoreTestPlugin;
+import org.eclipse.linuxtools.tmf.core.tests.shared.TmfTestTrace;
import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
// ------------------------------------------------------------------------
private static final long DEFAULT_INITIAL_OFFSET_VALUE = (1L * 100 * 1000 * 1000); // .1sec
- private static final String DIRECTORY = "testfiles";
- private static final String TEST_STREAM1 = "O-Test-10K";
- private static final String TEST_STREAM2 = "E-Test-10K";
private static final String EXPERIMENT = "MyExperiment";
private static int NB_EVENTS = 20000;
private static int BLOCK_SIZE = 1000;
}
private static ITmfTrace[] setupTraces() {
- final String path1 = DIRECTORY + File.separator + TEST_STREAM1;
- final String path2 = DIRECTORY + File.separator + TEST_STREAM2;
try {
ITmfTrace[] traces = new ITmfTrace[2];
- URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(path1), null);
+ URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TmfTestTrace.O_TEST_10K.getFullPath()), null);
File test = new File(FileLocator.toFileURL(location).toURI());
final TmfTraceStub trace1 = new TmfTraceStub(test.getPath(), 0, true);
traces[0] = trace1;
- location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(path2), null);
+ location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TmfTestTrace.E_TEST_10K.getFullPath()), null);
test = new File(FileLocator.toFileURL(location).toURI());
final TmfTraceStub trace2 = new TmfTraceStub(test.getPath(), 0, true);
traces[1] = trace2;
import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateSystem;
import org.eclipse.linuxtools.tmf.core.statistics.ITmfStatistics;
import org.eclipse.linuxtools.tmf.core.tests.TmfCoreTestPlugin;
+import org.eclipse.linuxtools.tmf.core.tests.shared.TmfTestTrace;
import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
// Variables
// ------------------------------------------------------------------------
+ private static final TmfTestTrace TEST_TRACE = TmfTestTrace.A_TEST_10K;
private static final long DEFAULT_INITIAL_OFFSET_VALUE = (1L * 100 * 1000 * 1000); // .1sec
- private static final String DIRECTORY = "testfiles";
- private static final String TEST_STREAM = "A-Test-10K";
private static final int BLOCK_SIZE = 500;
private static final int NB_EVENTS = 10000;
private static TmfTraceStub fTrace = null;
@Before
public void setUp() {
- fTrace = setupTrace(DIRECTORY + File.separator + TEST_STREAM);
+ fTrace = setupTrace(TEST_TRACE.getFullPath());
}
@After
@Test
public void testStandardConstructor() throws TmfTraceException {
try {
- final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(DIRECTORY + File.separator + TEST_STREAM), null);
+ final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TEST_TRACE.getFullPath()), null);
File testfile = new File(FileLocator.toFileURL(location).toURI());
TmfTraceStub trace = new TmfTraceStub(testfile.toURI().getPath());
trace.indexTrace(true);
assertEquals("getPath", testfile.toURI().getPath(), trace.getPath());
assertEquals("getCacheSize", ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, trace.getCacheSize());
assertEquals("getStreamingInterval", 0, trace.getStreamingInterval());
- assertEquals("getName", TEST_STREAM, trace.getName());
+ assertEquals("getName", TEST_TRACE.getPath(), trace.getName());
assertEquals("getNbEvents", NB_EVENTS, trace.getNbEvents());
assertEquals("getRange-start", 1, trace.getTimeRange().getStartTime().getValue());
@Test
public void testStandardConstructorCacheSize() throws TmfTraceException {
try {
- final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(DIRECTORY + File.separator + TEST_STREAM), null);
+ final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TEST_TRACE.getFullPath()), null);
File testfile = new File(FileLocator.toFileURL(location).toURI());
TmfTraceStub trace = new TmfTraceStub(testfile.toURI().getPath(), 0);
trace.indexTrace(true);
assertEquals("getPath", testfile.toURI().getPath(), trace.getPath());
assertEquals("getCacheSize", ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, trace.getCacheSize());
assertEquals("getStreamingInterval", 0, trace.getStreamingInterval());
- assertEquals("getName", TEST_STREAM, trace.getName());
+ assertEquals("getName", TEST_TRACE.getPath(), trace.getName());
assertEquals("getNbEvents", NB_EVENTS, trace.getNbEvents());
assertEquals("getRange-start", 1, trace.getTimeRange().getStartTime().getValue());
}
try {
- final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(DIRECTORY + File.separator + TEST_STREAM), null);
+ final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TEST_TRACE.getFullPath()), null);
File testfile = new File(FileLocator.toFileURL(location).toURI());
TmfTraceStub trace = new TmfTraceStub(testfile.toURI().getPath(), BLOCK_SIZE);
trace.indexTrace(true);
assertEquals("getPath", testfile.toURI().getPath(), trace.getPath());
assertEquals("getCacheSize", BLOCK_SIZE, trace.getCacheSize());
assertEquals("getStreamingInterval", 0, trace.getStreamingInterval());
- assertEquals("getName", TEST_STREAM, trace.getName());
+ assertEquals("getName", TEST_TRACE.getPath(), trace.getName());
assertEquals("getNbEvents", NB_EVENTS, trace.getNbEvents());
assertEquals("getRange-start", 1, trace.getTimeRange().getStartTime().getValue());
@Test
public void testFullConstructor() throws TmfTraceException {
try {
- final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(DIRECTORY + File.separator + TEST_STREAM), null);
+ final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TEST_TRACE.getFullPath()), null);
File testfile = new File(FileLocator.toFileURL(location).toURI());
TmfTraceStub trace = new TmfTraceStub(testfile.toURI().getPath(), BLOCK_SIZE, null);
trace.indexTrace(true);
assertEquals("getPath", testfile.toURI().getPath(), trace.getPath());
assertEquals("getCacheSize", BLOCK_SIZE, trace.getCacheSize());
assertEquals("getStreamingInterval", 0, trace.getStreamingInterval());
- assertEquals("getName", TEST_STREAM, trace.getName());
+ assertEquals("getName", TEST_TRACE.getPath(), trace.getName());
assertEquals("getNbEvents", NB_EVENTS, trace.getNbEvents());
assertEquals("getRange-start", 1, trace.getTimeRange().getStartTime().getValue());
public void testLiveTraceConstructor() throws TmfTraceException {
final long interval = 100;
try {
- final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(DIRECTORY + File.separator + TEST_STREAM), null);
+ final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TEST_TRACE.getFullPath()), null);
File testfile = new File(FileLocator.toFileURL(location).toURI());
TmfTraceStub trace = new TmfTraceStub(testfile.toURI().getPath(), BLOCK_SIZE, interval);
trace.indexTrace(true);
assertEquals("getPath", testfile.toURI().getPath(), trace.getPath());
assertEquals("getCacheSize", BLOCK_SIZE, trace.getCacheSize());
assertEquals("getStreamingInterval", interval, trace.getStreamingInterval());
- assertEquals("getName", TEST_STREAM, trace.getName());
+ assertEquals("getName", TEST_TRACE.getPath(), trace.getName());
assertEquals("getNbEvents", NB_EVENTS, trace.getNbEvents());
assertEquals("getRange-start", 1, trace.getTimeRange().getStartTime().getValue());
@Test
public void testCopyConstructor() throws TmfTraceException {
try {
- final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(DIRECTORY + File.separator + TEST_STREAM), null);
+ final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TEST_TRACE.getFullPath()), null);
File testfile = new File(FileLocator.toFileURL(location).toURI());
TmfTraceStub original = new TmfTraceStub(testfile.toURI().getPath(), BLOCK_SIZE, new TmfCheckpointIndexer(null));
TmfTraceStub trace = new TmfTraceStub(original);
assertEquals("getPath", testfile.toURI().getPath(), trace.getPath());
assertEquals("getCacheSize", BLOCK_SIZE, trace.getCacheSize());
assertEquals("getStreamingInterval", 0, trace.getStreamingInterval());
- assertEquals("getName", TEST_STREAM, trace.getName());
+ assertEquals("getName", TEST_TRACE.getPath(), trace.getName());
assertEquals("getNbEvents", NB_EVENTS, trace.getNbEvents());
assertEquals("getRange-start", 1, trace.getTimeRange().getStartTime().getValue());
assertEquals("getEndTime", Long.MIN_VALUE, trace.getEndTime().getValue());
// Validate
- final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(DIRECTORY + File.separator + TEST_STREAM), null);
+ final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TEST_TRACE.getFullPath()), null);
final File testfile = new File(FileLocator.toFileURL(location).toURI());
assertTrue("validate", trace.validate(null, testfile.getPath()).isOK());
assertNull ("getResource", trace.getResource());
assertEquals("getCacheSize", ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, trace.getCacheSize());
assertEquals("getStreamingInterval", 0, trace.getStreamingInterval());
- assertEquals("getName", TEST_STREAM, trace.getName());
+ assertEquals("getName", TEST_TRACE.getPath(), trace.getName());
assertEquals("getNbEvents", NB_EVENTS, trace.getNbEvents());
assertEquals("getRange-start", 1, trace.getTimeRange().getStartTime().getValue());
assertNull ("getResource", fTrace.getResource());
assertEquals("getCacheSize", BLOCK_SIZE, fTrace.getCacheSize());
assertEquals("getStreamingInterval", 0, fTrace.getStreamingInterval());
- assertEquals("getName", TEST_STREAM, fTrace.getName());
+ assertEquals("getName", TEST_TRACE.getPath(), fTrace.getName());
assertEquals("getNbEvents", NB_EVENTS, fTrace.getNbEvents());
assertEquals("getRange-start", 1, fTrace.getTimeRange().getStartTime().getValue());
TmfTraceStub trace = null;
File testfile = null;
try {
- final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(DIRECTORY + File.separator + TEST_STREAM), null);
+ final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TEST_TRACE.getFullPath()), null);
testfile = new File(FileLocator.toFileURL(location).toURI());
trace = new TmfTraceStub(testfile.toURI().getPath());
// verify initial values
import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest;
import org.eclipse.linuxtools.tmf.core.request.ITmfEventRequest;
import org.eclipse.linuxtools.tmf.core.tests.TmfCoreTestPlugin;
+import org.eclipse.linuxtools.tmf.core.tests.shared.TmfTestTrace;
import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
import org.eclipse.linuxtools.tmf.tests.stubs.trace.TmfTraceStub;
@SuppressWarnings("javadoc")
public class TmfEventProviderStub extends TmfEventProvider {
- private static final String DIRECTORY = "testfiles";
- private static final String TEST_STREAM = "A-Test-10K";
-
private TmfTraceStub fTrace;
public TmfEventProviderStub(final String path) throws IOException {
}
public TmfEventProviderStub() throws IOException {
- this(DIRECTORY + File.separator + TEST_STREAM);
+ this(TmfTestTrace.A_TEST_10K.getFullPath());
}
@Override