import java.util.List;
import java.util.concurrent.TimeUnit;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.tracecompass.internal.lttng2.ust.core.callstack.LttngUstCallStackProvider;
import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
import org.eclipse.tracecompass.statesystem.core.StateSystemUtils;
import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException;
import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
+import org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace;
import org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException;
import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider;
import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp;
import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
-import org.eclipse.tracecompass.tmf.ctf.core.tests.shared.CtfTmfTestTrace;
+import org.eclipse.tracecompass.tmf.ctf.core.tests.shared.CtfTmfTestTraceUtils;
import org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace;
import org.junit.After;
import org.junit.Before;
// Attributes
// ------------------------------------------------------------------------
- private static final CtfTmfTestTrace otherUstTrace = CtfTmfTestTrace.HELLO_LOST;
+ private static final @NonNull CtfTestTrace otherUstTrace = CtfTestTrace.HELLO_LOST;
private CtfTmfTrace fTrace = null;
private ITmfStateSystem fSS = null;
/**
* @return The test trace to use for this test
*/
- protected abstract CtfTmfTestTrace getTestTrace();
+ protected abstract @NonNull CtfTestTrace getTestTrace();
/**
* @return The name of the executable process in that particular trace
*/
@Before
public void setUp() {
- CtfTmfTestTrace testTrace = getTestTrace();
+ CtfTestTrace testTrace = getTestTrace();
- CtfTmfTrace trace = testTrace.getTrace();
+ CtfTmfTrace trace = CtfTmfTestTraceUtils.getTrace(testTrace);
fTrace = trace;
fModule = new TestLttngCallStackModule();
try {
public void testOtherUstTrace() {
/* Initialize the trace and analysis module */
File suppDir;
- try (CtfTmfTrace ustTrace = otherUstTrace.getTrace();) {
- TestLttngCallStackModule module = null;
+ CtfTmfTrace ustTrace = CtfTmfTestTraceUtils.getTrace(otherUstTrace);
+ TestLttngCallStackModule module = null;
+ try {
+ module = new TestLttngCallStackModule();
try {
- module = new TestLttngCallStackModule();
- try {
- assertTrue(module.setTrace(ustTrace));
- } catch (TmfAnalysisException e) {
- fail();
- }
- module.schedule();
- assertTrue(module.waitForCompletion());
-
- /* Make sure the generated state system exists, but is empty */
- ITmfStateSystem ss = module.getStateSystem();
- assertNotNull(ss);
- assertTrue(ss.getStartTime() >= ustTrace.getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue());
- assertEquals(0, ss.getNbAttributes());
- } finally {
- if (module != null) {
- module.dispose();
- }
+ assertTrue(module.setTrace(ustTrace));
+ } catch (TmfAnalysisException e) {
+ fail();
+ }
+ module.schedule();
+ assertTrue(module.waitForCompletion());
+
+ /* Make sure the generated state system exists, but is empty */
+ ITmfStateSystem ss = module.getStateSystem();
+ assertNotNull(ss);
+ assertTrue(ss.getStartTime() >= ustTrace.getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue());
+ assertEquals(0, ss.getNbAttributes());
+ } finally {
+ if (module != null) {
+ module.dispose();
}
- suppDir = new File(TmfTraceManager.getSupplementaryFileDir(ustTrace));
}
+ suppDir = new File(TmfTraceManager.getSupplementaryFileDir(ustTrace));
+
+ ustTrace.dispose();
deleteDirectory(suppDir);
assertFalse(suppDir.exists());
}