public T dataset(String uuid) { dataSetLookup.setDataSetUUID(uuid); return (T) this; }
public T dataset(String uuid) { dataSetLookup.setDataSetUUID(uuid); return (T) this; }
public DataSetLookup cloneInstance() { DataSetLookup clone = new DataSetLookup(); clone.setDataSetUUID(dataSetUUID); clone.setRowOffset(rowOffset); clone.setNumberOfRows(numberOfRows); for (DataSetOp dataSetOp : operationList) { clone.operationList.add(dataSetOp.cloneInstance()); } return clone; }
public DataSetLookup cloneInstance() { DataSetLookup clone = new DataSetLookup(); clone.setDataSetUUID(dataSetUUID); clone.setRowOffset(rowOffset); clone.setNumberOfRows(numberOfRows); for (DataSetOp dataSetOp : operationList) { clone.operationList.add(dataSetOp.cloneInstance()); } return clone; }
@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); }
public DataSet lookupDataSet(DataSetDef def, DataSetLookup lookup) throws Exception { try { // Although if using a not registered definition, it must have an uuid set for performing lookups. if (def.getUUID() == null) { final String uuid = uuidGenerator.newUuid(); def.setUUID(uuid); lookup.setDataSetUUID(uuid); } return dataSetManager.resolveProvider(def) .lookupDataSet(def, lookup); } catch (Exception e) { throw exceptionManager.handleException(e); } }
public DataSetLookup fromJson(JsonObject json) throws JsonException { if (json == null) { return null; } DataSetLookup dataSetLookup = new DataSetLookup(); dataSetLookup.setDataSetUUID(json.get(UUID) != null ? json.getString(UUID) : null); dataSetLookup.setNumberOfRows(json.get(ROWCOUNT) != null ? Integer.parseInt(json.getString(ROWCOUNT), 10) : -1); dataSetLookup.setRowOffset(json.get(ROWOFFSET) != null ? Integer.parseInt(json.getString(ROWOFFSET), 10) : 0); List<DataSetOp> dataSetOpList = dataSetLookup.getOperationList(); Collection c = null; if ((c = parseFilterOperations(json.getArray(FILTEROPS))) != null) { dataSetOpList.addAll(c); } if ((c = parseGroupOperations(json.getArray(GROUPOPS))) != null) { dataSetOpList.addAll(c); } if ((c = parseSortOperations(json.getArray(SORTOPS))) != null) { dataSetOpList.addAll(c); } return dataSetLookup; }
public DataSet lookupDataSet(DataSetDef def, DataSetLookup lookup) throws Exception { try { // Although if using a not registered definition, it must have an uuid set for performing lookups. if (def.getUUID() == null) { final String uuid = uuidGenerator.newUuid(); def.setUUID(uuid); lookup.setDataSetUUID(uuid); } return dataSetManager.resolveProvider(def) .lookupDataSet(def, lookup); } catch (Exception e) { throw exceptionManager.handleException(e); } }
public DataSetLookup fromJson(JsonObject json) throws JsonException { if (json == null) { return null; } DataSetLookup dataSetLookup = new DataSetLookup(); dataSetLookup.setDataSetUUID(json.get(UUID) != null ? json.getString(UUID) : null); dataSetLookup.setNumberOfRows(json.get(ROWCOUNT) != null ? Integer.parseInt(json.getString(ROWCOUNT), 10) : -1); dataSetLookup.setRowOffset(json.get(ROWOFFSET) != null ? Integer.parseInt(json.getString(ROWOFFSET), 10) : 0); List<DataSetOp> dataSetOpList = dataSetLookup.getOperationList(); Collection c = null; if ((c = parseFilterOperations(json.getArray(FILTEROPS))) != null) { dataSetOpList.addAll(c); } if ((c = parseGroupOperations(json.getArray(GROUPOPS))) != null) { dataSetOpList.addAll(c); } if ((c = parseSortOperations(json.getArray(SORTOPS))) != null) { dataSetOpList.addAll(c); } return dataSetLookup; }
dataSetLookup.setDataSetUUID(HUMAN_TASKS_DATASET);
dataSetLookup.setDataSetUUID(datasetUId);
@Test public void lookupDataSetLogicalExprTest() throws Exception { DataSetLookup lookup = new DataSetLookup(); lookup.setDataSetUUID(""); when(dataSetDef.getUUID()).thenReturn("");
@Test public void lookupDataSetLogicalExprTest() throws Exception { DataSetLookup lookup = new DataSetLookup(); lookup.setDataSetUUID(""); when(dataSetDef.getUUID()).thenReturn("");
lookup.setDataSetUUID(dataSetDef.getUUID()); DataSet dataSet = dataSetManager.lookupDataSet(lookup);