Search in sources :

Example 1 with UstMemoryUsageView

use of org.eclipse.tracecompass.internal.lttng2.ust.ui.views.memusage.UstMemoryUsageView in project tracecompass by tracecompass.

the class MemoryUsageViewTest method testMemoryUsage.

/**
 * Test Memory Usage data model
 */
@Test
public void testMemoryUsage() {
    IViewPart viewPart = getSWTBotView().getViewReference().getView(true);
    assertTrue(viewPart instanceof UstMemoryUsageView);
    final TmfCommonXAxisChartViewer chartViewer = (TmfCommonXAxisChartViewer) getChartViewer(viewPart);
    assertNotNull(chartViewer);
    fBot.waitUntil(ConditionHelpers.xyViewerIsReadyCondition(chartViewer));
    final Chart chart = getChart();
    assertNotNull(chart);
    checkAllEntries();
    SWTBotUtils.waitUntil(c -> c.getSeriesSet().getSeries().length > 3, chart, "No data available");
    chartViewer.setNbPoints(50);
    /* Test data model*/
    SWTBotUtils.waitUntil(json -> isChartDataValid(chart, json, FIRST_SERIES_NAME, SECOND_SERIES_NAME, THIRD_SERIES_NAME, FOURTH_SERIES_NAME), "resources/memory-res50.json", "Chart data is not valid");
    /* Test type, style and color of series */
    verifyChartStyle();
}
Also used : IViewPart(org.eclipse.ui.IViewPart) UstMemoryUsageView(org.eclipse.tracecompass.internal.lttng2.ust.ui.views.memusage.UstMemoryUsageView) TmfCommonXAxisChartViewer(org.eclipse.tracecompass.tmf.ui.viewers.xychart.linechart.TmfCommonXAxisChartViewer) Chart(org.eclipse.swtchart.Chart) Test(org.junit.Test) XYDataProviderBaseTest(org.eclipse.tracecompass.tmf.ui.swtbot.tests.views.xychart.XYDataProviderBaseTest)

Aggregations

Chart (org.eclipse.swtchart.Chart)1 UstMemoryUsageView (org.eclipse.tracecompass.internal.lttng2.ust.ui.views.memusage.UstMemoryUsageView)1 XYDataProviderBaseTest (org.eclipse.tracecompass.tmf.ui.swtbot.tests.views.xychart.XYDataProviderBaseTest)1 TmfCommonXAxisChartViewer (org.eclipse.tracecompass.tmf.ui.viewers.xychart.linechart.TmfCommonXAxisChartViewer)1 IViewPart (org.eclipse.ui.IViewPart)1 Test (org.junit.Test)1