Search in sources :

Example 1 with DisplayerSettings

use of org.dashbuilder.displayer.DisplayerSettings in project kie-wb-common by kiegroup.

the class ProjectMetricsScreenTest method dateSelectorFormatTest.

@Test
public void dateSelectorFormatTest() {
    DisplayerSettings settings = metricsFactory.buildDateSelectorSettings(project);
    assertEquals(settings.getColumnSettings(COLUMN_DATE).getValuePattern(), "dd MMM, yyyy HH:mm");
}
Also used : DisplayerSettings(org.dashbuilder.displayer.DisplayerSettings) AbstractDisplayerTest(org.dashbuilder.displayer.client.AbstractDisplayerTest) Test(org.junit.Test)

Example 2 with DisplayerSettings

use of org.dashbuilder.displayer.DisplayerSettings in project kie-wb-common by kiegroup.

the class ProjectMetricsFactory method lookupCommitsOverTimeDisplayer_small.

public Displayer lookupCommitsOverTimeDisplayer_small(WorkspaceProject project) {
    DisplayerSettings settings = buildCommitsOverTimeSettings(project);
    settings.setChartWidth(300);
    settings.setChartHeight(80);
    settings.setChartMarginTop(5);
    settings.setChartMarginBottom(5);
    settings.setTitleVisible(false);
    settings.setYAxisTitle(null);
    return displayerLocator.lookupDisplayer(settings);
}
Also used : DisplayerSettings(org.dashbuilder.displayer.DisplayerSettings)

Example 3 with DisplayerSettings

use of org.dashbuilder.displayer.DisplayerSettings in project kie-wb-common by kiegroup.

the class DataManagementServiceImplTest method testGetDisplayerSettings.

@Test
public void testGetDisplayerSettings() {
    expectedDataSetUUID = DATASOURCE_UUID + SEPARATOR + SCHEMA + SEPARATOR + TABLE;
    DataSetLookup expectedLookup = new DataSetLookup();
    expectedLookup.setDataSetUUID(expectedDataSetUUID);
    DataSet expectedSet = mock(DataSet.class);
    List<DataColumn> dataColumns = new ArrayList<>();
    for (int i = 0; i < COLUMNS_COUNT; i++) {
        DataColumn dataColumn = mock(DataColumn.class);
        when(dataColumn.getId()).thenReturn(DATA_COLUMN + String.valueOf(i));
        dataColumns.add(dataColumn);
    }
    when(expectedSet.getColumns()).thenReturn(dataColumns);
    when(dataSetManager.lookupDataSet(expectedLookup)).thenReturn(expectedSet);
    DisplayerSettings settings = dataManagementService.getDisplayerSettings(DATASOURCE_UUID, SCHEMA, TABLE);
    verify(dataSetDefRegistry, times(1)).registerDataSetDef(dataSetDefCaptor.capture());
    verifyDataSetDef(dataSetDefCaptor.getValue());
    verifySettings(settings);
}
Also used : DataSet(org.dashbuilder.dataset.DataSet) DataColumn(org.dashbuilder.dataset.DataColumn) ArrayList(java.util.ArrayList) DisplayerSettings(org.dashbuilder.displayer.DisplayerSettings) DataSetLookup(org.dashbuilder.dataset.DataSetLookup) Test(org.junit.Test)

Aggregations

DisplayerSettings (org.dashbuilder.displayer.DisplayerSettings)3 Test (org.junit.Test)2 ArrayList (java.util.ArrayList)1 DataColumn (org.dashbuilder.dataset.DataColumn)1 DataSet (org.dashbuilder.dataset.DataSet)1 DataSetLookup (org.dashbuilder.dataset.DataSetLookup)1 AbstractDisplayerTest (org.dashbuilder.displayer.client.AbstractDisplayerTest)1