use of org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.kernelmemoryusage.KernelMemoryUsageView in project tracecompass by tracecompass.
the class KernelMemoryUsageViewTest method testFilter.
/**
* Test that the filter button works
*/
@Test
public void testFilter() {
IViewPart viewPart = getSWTBotView().getViewReference().getView(true);
assertTrue(viewPart instanceof KernelMemoryUsageView);
final TmfCommonXAxisChartViewer chartViewer = (TmfCommonXAxisChartViewer) getChartViewer(viewPart);
assertNotNull(chartViewer);
fBot.waitUntil(ConditionHelpers.xyViewerIsReadyCondition(chartViewer));
SWTBotUtils.waitUntil(bot -> bot.tree().getTreeItem(fTraceName).getItems().length == 5, getSWTBotView().bot(), "Failed to load the filtered threads");
getSWTBotView().toolbarButton("Showing active threads").click();
SWTBotUtils.waitUntil(bot -> bot.tree().getTreeItem(fTraceName).getItems().length == 16, getSWTBotView().bot(), "Failed to load all the threads");
getSWTBotView().toolbarButton("Showing all threads").click();
SWTBotUtils.waitUntil(bot -> bot.tree().getTreeItem(fTraceName).getItems().length == 5, getSWTBotView().bot(), "Failed to filter the threads");
}
use of org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.kernelmemoryusage.KernelMemoryUsageView in project tracecompass by tracecompass.
the class KernelMemoryUsageViewTest method testKernelMemoryView.
/**
* Simple test to check the Kernel Memory Usage view data model
*/
@Test
public void testKernelMemoryView() {
IViewPart viewPart = getSWTBotView().getViewReference().getView(true);
assertTrue(viewPart instanceof KernelMemoryUsageView);
final TmfCommonXAxisChartViewer chartViewer = (TmfCommonXAxisChartViewer) getChartViewer(viewPart);
assertNotNull(chartViewer);
fBot.waitUntil(ConditionHelpers.xyViewerIsReadyCondition(chartViewer));
final Chart chart = getChart();
assertNotNull(chart);
chartViewer.setNbPoints(NUMBER_OF_POINT);
SWTBotTree treeBot = getSWTBotView().bot().tree();
SWTBotTreeItem totalNode = treeBot.getTreeItem(fTraceName);
SWTBotUtils.waitUntil(root -> root.getItems().length >= 5, totalNode, "Did not finish loading");
/*
* Select the total entry, which should be the first entry with an empty pid
* column.
*/
SWTBotUtils.waitUntil(c -> c.getSeriesSet().getSeries().length >= 1, chart, "No data available");
/* Test type, style and color of series */
verifySeriesStyle(TOTAL_PID, ISeries.SeriesType.LINE, BLUE, LineStyle.SOLID, false);
/* Test data model*/
SWTBotUtils.waitUntil(json -> isChartDataValid(chart, json), "resources/kernelmemory/kernel-memory-res50.json", "Chart data is not valid");
/*
* Select a thread
*/
SWTBotTreeItem sessiondEntry = totalNode.getNode("lttng-sessiond");
sessiondEntry.check();
SWTBotUtils.waitUntil(c -> c.getSeriesSet().getSeries().length >= 2, chart, "Only total available");
/* Test type, style and color of series */
verifySeriesStyle(SESSIOND_PID, ISeries.SeriesType.LINE, RED, LineStyle.SOLID, false);
SWTBotUtils.waitUntil(json -> isChartDataValid(chart, json, SESSIOND_PID), "resources/kernelmemory/kernel-memory-res50Selected.json", "Chart data is not valid");
/*
* Select an another thread and change zoom
*/
SWTBotTreeItem consumerdEntry = totalNode.getNode("lttng-consumerd");
consumerdEntry.check();
chartViewer.setNbPoints(MORE_POINTS);
SWTBotUtils.waitUntil(c -> c.getSeriesSet().getSeries().length >= 3, chart, "Only total and sessiond available");
/* Test type, style and color of series */
verifySeriesStyle(CONSUMERD_PID, ISeries.SeriesType.LINE, GREEN, LineStyle.SOLID, false);
SWTBotUtils.waitUntil(json -> isChartDataValid(chart, json, CONSUMERD_PID), "resources/kernelmemory/kernel-memory-res100Selected.json", "Chart data is not valid");
}
Aggregations