use of org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.io.diskioactivity.DiskIOActivityView in project tracecompass by tracecompass.
the class DisksIOViewTest method testDiskView.
/**
* Test to check the Disks IO Activity view. First, when trace opened, there
* should not be any activity. Then, we move to a time range where there are
* write activity. Afterward, we test the zoom
*/
@Test
public void testDiskView() {
// Wait for analysis to finish.
WaitUtils.waitForJobs();
IViewPart viewPart = getSWTBotView().getViewReference().getView(true);
assertTrue(viewPart instanceof DiskIOActivityView);
final TmfCommonXAxisChartViewer chartViewer = (TmfCommonXAxisChartViewer) getChartViewer(viewPart);
assertNotNull(chartViewer);
fBot.waitUntil(ConditionHelpers.xyViewerIsReadyCondition(chartViewer));
final Chart chart = getChart();
assertNotNull(chart);
SWTBotTreeItem[] items = getSWTBotView().bot().tree().getAllItems();
for (SWTBotTreeItem item : items) {
item.check();
}
SWTBotUtils.waitUntil(c -> c.getSeriesSet().getSeries().length > 0, chart, "No data available");
chartViewer.setNbPoints(NUMBER_OF_POINT);
/* Initially, no disk activity */
SWTBotUtils.waitUntil(json -> isChartDataValid(chart, json, WRITE_SERIES_NAME), "resources/disk/disk0-res50.json", "Chart data is not valid");
/* Change time range where there is disks activity */
TmfSignalManager.dispatchSignal(new TmfWindowRangeUpdatedSignal(this, new TmfTimeRange(ZOOM_START_TIME, ZOOM_END_TIME)));
fBot.waitUntil(ConditionHelpers.windowRange(new TmfTimeRange(ZOOM_START_TIME, ZOOM_END_TIME)));
fBot.waitUntil(ConditionHelpers.xyViewerIsReadyCondition(chartViewer));
/* Test type, style and color of series */
verifyChartStyle();
/* Test data model */
SWTBotUtils.waitUntil(json -> isChartDataValid(chart, json, WRITE_SERIES_NAME), "resources/disk/disk1-res50.json", "Chart data is not valid");
/* Change Zoom and number of points */
chartViewer.setNbPoints(MORE_POINTS);
/* Test type, style and color of series */
verifyChartStyle();
/* Test data model */
SWTBotUtils.waitUntil(json -> isChartDataValid(chart, json, WRITE_SERIES_NAME), "resources/disk/disk2-res100.json", "Chart data is not valid");
}
Aggregations