use of org.dashbuilder.dataset.DataColumn 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);
}
use of org.dashbuilder.dataset.DataColumn in project jbpm by kiegroup.
the class AbstractQueryMapper method getColumnDoubleValue.
protected Double getColumnDoubleValue(DataSet currentDataSet, String columnId, int index) {
DataColumn column = currentDataSet.getColumnById(columnId);
if (column == null) {
return null;
}
Object value = column.getValues().get(index);
return value != null ? ((Number) value).doubleValue() : null;
}
Aggregations