use of org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.latency.SystemCallLatencyScatterView in project tracecompass by tracecompass.
the class SystemCallLatencyScatterChartViewTest method testWithTrace.
/**
* Test to check the System Call Scatter view. When trace opens, there are a few
* syscalls present, then we move to the zone without system calls, the tree
* should be empty.
*
* TODO: Test the data
*/
@Test
public void testWithTrace() {
// Wait for analysis to finish.
WaitUtils.waitForJobs();
IViewPart viewPart = getSWTBotView().getViewReference().getView(true);
assertTrue(viewPart instanceof SystemCallLatencyScatterView);
final TmfCommonXAxisChartViewer chartViewer = (TmfCommonXAxisChartViewer) getChartViewer(viewPart);
assertNotNull(chartViewer);
fBot.waitUntil(ConditionHelpers.xyViewerIsReadyCondition(chartViewer));
final Chart chart = getChart();
assertNotNull(chart);
SWTBotUtils.waitUntil(bot -> bot.tree().visibleRowCount() >= 25, getSWTBotView().bot(), "Missing rows, expected 25, was " + getSWTBotView().bot().tree().visibleRowCount());
SWTBotTreeItem[] items = getSWTBotView().bot().tree().getAllItems();
for (SWTBotTreeItem item : items) {
item.check();
}
SWTBotUtils.waitUntil(c -> c.getSeriesSet().getSeries().length >= 24, chart, "No data available");
/* Test type, style and color of series */
verifyChartStyle();
// Update the time range to a range where there is no data
long noDataStart = 1412670961274443542L;
long noDataEnd = 1412670961298823940L;
TmfTimeRange windowRange = new TmfTimeRange(TmfTimestamp.fromNanos(noDataStart), TmfTimestamp.fromNanos(noDataEnd));
TmfSignalManager.dispatchSignal(new TmfWindowRangeUpdatedSignal(this, windowRange));
fBot.waitUntil(ConditionHelpers.windowRange(windowRange));
fBot.waitUntil(ConditionHelpers.xyViewerIsReadyCondition(chartViewer));
// Only the root item should be present
items = getSWTBotView().bot().tree().getAllItems();
assertEquals(1, items.length);
}
Aggregations