use of org.eclipse.swtchart.model.IndexedSeriesModel in project tracecompass by tracecompass.
the class PatternDensityViewTest method testWithTrace.
/**
* Test the pattern density view and its viewers data
*
* @throws SecurityException
* If a security manager is present and any the wrong class is
* loaded or the class loader is not the same as its ancestor's
* loader.
*
* @throws NoSuchFieldException
* Field not available
* @throws IllegalAccessException
* Field is inaccessible
* @throws IllegalArgumentException
* the object is not the correct class type
*/
@Test
public void testWithTrace() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
setDensityViewer();
WaitUtils.waitForJobs();
// Test the table content
SWTBotTable tableBot = new SWTBotTable(fDensityViewer.getTableViewer().getTable());
fBot.waitUntil(ConditionHelpers.isTableCellFilled(tableBot, SYSTEM_CALL_PREFIX, 0, 3));
tableBot.header(COLUMN_HEADER).click();
fBot.waitUntil(ConditionHelpers.isTableCellFilled(tableBot, SYSTEM_CALL_PREFIX, 0, 3));
tableBot.header(COLUMN_HEADER).click();
fBot.waitUntil(ConditionHelpers.isTableCellFilled(tableBot, SYSTEM_CALL_PREFIX, 0, 3));
// Test the chart content
final Chart densityChart = fDensityChart;
assertNotNull(densityChart);
fBot.waitUntil(ConditionHelpers.numberOfSeries(densityChart, 1));
SWTBotChart chartBot = new SWTBotChart(densityChart);
assertVisible(chartBot);
ISeriesSet seriesSet = fDensityChart.getSeriesSet();
assertNotNull(seriesSet);
ISeries<?>[] series = seriesSet.getSeries();
assertNotNull(series);
// Verify that the chart has 1 series
assertEquals(1, series.length);
// Verify that the series has data
assertTrue(((IndexedSeriesModel<?>) series[0].getDataModel()).size() > 0);
}
use of org.eclipse.swtchart.model.IndexedSeriesModel in project tracecompass by tracecompass.
the class PatternScatterChartViewTest method testWithTrace.
/**
* Test the pattern latency scatter graph. This method test if the chart has one
* series and the series has data
*/
@Test
public void testWithTrace() {
// Get the chart viewer and wait for the view to be ready
WaitUtils.waitForJobs();
TmfXYChartViewer chartViewer = getChartViewer();
assertNotNull(chartViewer);
fBot.waitUntil(ConditionHelpers.xyViewerIsReadyCondition(chartViewer));
// Check all the items in the tree
final Chart chart = fScatterChart;
assertNotNull(chart);
SWTBotView viewBot = fBot.viewById(VIEW_ID);
SWTBotTreeItem[] items = viewBot.bot().tree().getAllItems();
for (SWTBotTreeItem item : items) {
item.check();
}
SWTBotUtils.waitUntil(c -> c.getSeriesSet().getSeries().length > 0, chart, "No data available");
// Look at the presence of data in the chart
SWTBotChart chartBot = new SWTBotChart(chart);
assertVisible(chartBot);
final Range range = chart.getAxisSet().getXAxes()[0].getRange();
assertEquals(100000000, range.upper - range.lower, 0);
ISeriesSet seriesSet = fScatterChart.getSeriesSet();
assertNotNull(seriesSet);
ISeries<?>[] series = seriesSet.getSeries();
assertNotNull(series);
// Verify that the chart has more than 1 series
assertTrue(series.length > 1);
// Verify that each series has data
for (int i = 0; i < series.length; i++) {
assertTrue("Verifying series " + i, ((IndexedSeriesModel<?>) series[i].getDataModel()).size() > 0);
}
}
Aggregations