use of org.eclipse.tracecompass.analysis.counters.ui.views.CounterView in project tracecompass by tracecompass.
the class NewCounterViewTest method testDisplayingDataSeries.
/**
* Validate the Counters view data model.
*/
@Test
public void testDisplayingDataSeries() {
// Setup the chart viewer
IViewPart viewPart = getSWTBotView().getViewReference().getView(true);
assertTrue(viewPart instanceof CounterView);
final TmfCommonXAxisChartViewer chartViewer = (TmfCommonXAxisChartViewer) getChartViewer(viewPart);
assertNotNull(chartViewer);
fBot.waitUntil(ConditionHelpers.xyViewerIsReadyCondition(chartViewer));
chartViewer.setNbPoints(NUMBER_OF_POINTS);
fBot.waitUntil(ConditionHelpers.xyViewerIsReadyCondition(chartViewer));
final Chart chart = getChart();
assertNotNull(chart);
assertEquals(0, chart.getSeriesSet().getSeries().length);
// Check the counter entry
SWTBotTree treeBot = getSWTBotView().bot().tree();
WaitUtils.waitUntil(tree -> tree.rowCount() >= 1, treeBot, "The tree viewer did not finish loading.");
SWTBotTreeItem root = treeBot.getTreeItem(TRACE_NAME);
SWTBotTreeItem counter = retrieveTreeItem(root, COUNTER_NAME);
assertNotNull(counter);
counter.check();
fBot.waitUntil(ConditionHelpers.xyViewerIsReadyCondition(chartViewer));
WaitUtils.waitUntil(c -> c.getSeriesSet().getSeries().length >= 1, chart, "The data series did not load.");
// Ensure the data series has the correct styling
verifySeriesStyle(MAIN_SERIES_NAME, ISeries.SeriesType.LINE, BLUE, LineStyle.SOLID, false);
// Ensure the data model is valid
WaitUtils.waitUntil(json -> isChartDataValid(chart, json), "resources/minor_faults-res50.json", "The chart data is not valid.");
}
Aggregations