package org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests;
import static org.junit.Assert.assertNotNull;
-import static org.junit.Assume.assumeTrue;
import java.util.List;
import org.apache.log4j.Logger;
import org.apache.log4j.varia.NullAppender;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.eclipse.tracecompass.internal.tmf.ui.views.statistics.TmfStatisticsViewImpl;
+import org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace;
import org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal;
import org.eclipse.tracecompass.tmf.core.trace.ITmfContext;
import org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEvent;
-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.eclipse.tracecompass.tmf.ui.editors.TmfEventsEditor;
import org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.ConditionHelpers;
import org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotUtils;
import org.eclipse.tracecompass.tmf.ui.views.histogram.HistogramView;
-import org.eclipse.tracecompass.tmf.ui.views.statistics.TmfStatisticsView;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IViewReference;
import org.eclipse.ui.PlatformUI;
protected static final String TRACE_FOLDER = "synctraces";
/** Trace type name for generic CTF traces */
protected static final String TRACE_TYPE_NAME = "Generic CTF Trace";
- /** A Generic CTF Trace*/
- protected static final CtfTmfTestTrace fTrace = CtfTmfTestTrace.SYNC_DEST;
+ /** A Generic CTF Trace */
+ protected static final @NonNull CtfTestTrace fTrace = CtfTestTrace.SYNC_DEST;
/** SWT BOT workbench reference */
protected static SWTWorkbenchBot fBot;
/** Wizard to use */
/** Test Class setup */
@BeforeClass
public static void init() {
- assumeTrue(fTrace.exists());
SWTBotUtils.failIfUIThread();
/* set up for swtbot */
/**
* Gets the project Name
+ *
* @return the project name
*/
protected abstract String getProjectName();
/**
* Verifies the Histogram View
+ *
* @param vp
* the view part
* @param tmfEd
/**
* Verifies the statistics view
+ *
* @param vp
* the view part
*/
protected void testStatisticsView(IViewPart vp) {
- TmfStatisticsView sv = (TmfStatisticsView) vp;
+ TmfStatisticsViewImpl sv = (TmfStatisticsViewImpl) vp;
assertNotNull(sv);
}
/**
* Gets an event at a given rank
+ *
* @param rank
* a rank
* @return the event at given rank
*/
protected CtfTmfEvent getEvent(int rank) {
- try (CtfTmfTrace trace = fTrace.getTrace()) {
- ITmfContext ctx = trace.seekEvent(0);
- for (int i = 0; i < rank; i++) {
- trace.getNext(ctx);
- }
- return trace.getNext(ctx);
- }
+ CtfTmfTrace trace = CtfTmfTestTraceUtils.getTrace(fTrace);
+ ITmfContext ctx = trace.seekEvent(rank);
+ CtfTmfEvent ret = trace.getNext(ctx);
+ ctx.dispose();
+ return ret;
}
/**
* Gets a view part based on view title
+ *
* @param viewTile
- * a view title
+ * a view title
* @return the view part
*/
protected IViewPart getViewPart(final String viewTile) {