@Test(expected = RuntimeException.class) public void testDoTestDataSetNotEdited() { presenter.dataSetDef = null; final DataSetEditorWorkflow.TestDataSetCallback testDataSetCallback = mock(DataSetEditorWorkflow.TestDataSetCallback.class); presenter.testDataSet(testDataSetCallback); }
public void testDataSet(final TestDataSetCallback testDataSetCallback) { checkDataSetDefNotNull(); getDataSetDef().setAllColumnsEnabled(true); getDataSetDef().setColumns(null); getDataSetDef().setDataSetFilter(null); DataSetDef editCloneWithoutCacheSettings = getDataSetDef().clone(); editCloneWithoutCacheSettings.setCacheEnabled(false); final DataSetLookup lookup = DataSetFactory.newDataSetLookupBuilder() .dataset(dataSetDef.getUUID()) .rowOffset(0) .rowNumber(6) .buildLookup(); try { DataSetHandler editHandler = new DataSetEditHandler(clientServices, lookup, editCloneWithoutCacheSettings); editHandler.lookupDataSet(new DataSetReadyCallback() { @Override public void callback(final DataSet dataSet) { testDataSetCallback.onSuccess(dataSet); } @Override public void notFound() { testDataSetCallback.onError(new ClientRuntimeError(DataSetEditorConstants.INSTANCE.defNotFound())); } @Override public boolean onError(final ClientRuntimeError error) { testDataSetCallback.onError(error); return false; } }); } catch (final Exception e) { testDataSetCallback.onError(new ClientRuntimeError(e)); } }
DataSetEditorWorkflow implements IsWidget { public void testDataSet(final TestDataSetCallback testDataSetCallback) { checkDataSetDefNotNull(); getDataSetDef().setAllColumnsEnabled(true); getDataSetDef().setColumns(null); getDataSetDef().setDataSetFilter(null); DataSetDef editCloneWithoutCacheSettings = getDataSetDef().clone(); editCloneWithoutCacheSettings.setCacheEnabled(false); final DataSetLookup lookup = DataSetFactory.newDataSetLookupBuilder() .dataset(dataSetDef.getUUID()) .rowOffset(0) .rowNumber(6) .buildLookup(); try { DataSetHandler editHandler = new DataSetEditHandler(clientServices, lookup, editCloneWithoutCacheSettings); editHandler.lookupDataSet(new DataSetReadyCallback() { @Override public void callback(final DataSet dataSet) { testDataSetCallback.onSuccess(dataSet); } @Override public void notFound() { testDataSetCallback.onError(new ClientRuntimeError(DataSetEditorConstants.INSTANCE.defNotFound())); } @Override public boolean onError(final ClientRuntimeError error) { testDataSetCallback.onError(error); return false; } }); } catch (final Exception e) { testDataSetCallback.onError(new ClientRuntimeError(e)); } } }
DataSetEditorWorkflow implements IsWidget { public void testDataSet(final TestDataSetCallback testDataSetCallback) { checkDataSetDefNotNull(); getDataSetDef().setAllColumnsEnabled(true); getDataSetDef().setColumns(null); getDataSetDef().setDataSetFilter(null); DataSetDef editCloneWithoutCacheSettings = getDataSetDef().clone(); editCloneWithoutCacheSettings.setCacheEnabled(false); final DataSetLookup lookup = DataSetFactory.newDataSetLookupBuilder() .dataset(dataSetDef.getUUID()) .rowOffset(0) .rowNumber(6) .buildLookup(); try { DataSetHandler editHandler = new DataSetEditHandler(clientServices, lookup, editCloneWithoutCacheSettings); editHandler.lookupDataSet(new DataSetReadyCallback() { @Override public void callback(final DataSet dataSet) { testDataSetCallback.onSuccess(dataSet); } @Override public void notFound() { testDataSetCallback.onError(new ClientRuntimeError(DataSetEditorConstants.INSTANCE.defNotFound())); } @Override public boolean onError(final ClientRuntimeError error) { testDataSetCallback.onError(error); return false; } }); } catch (final Exception e) { testDataSetCallback.onError(new ClientRuntimeError(e)); } } @Inject  DataSetEditorWorkflow(final DataSetClientServices clientServices,
                                 final DataSetValidatorProvider validatorProvider,
                                 final SyncBeanManager beanManager,
                                 final Event<SaveRequestEvent> saveRequestEvent,
                                 final Event<TestDataSetRequestEvent> testDataSetEvent,
                                 final Event<CancelRequestEvent> cancelRequestEvent,
                                 final View view); }
DataSetEditorWorkflow implements IsWidget { public void testDataSet(final TestDataSetCallback testDataSetCallback) { checkDataSetDefNotNull(); getDataSetDef().setAllColumnsEnabled(true); getDataSetDef().setColumns(null); getDataSetDef().setDataSetFilter(null); DataSetDef editCloneWithoutCacheSettings = getDataSetDef().clone(); editCloneWithoutCacheSettings.setCacheEnabled(false); final DataSetLookup lookup = DataSetFactory.newDataSetLookupBuilder() .dataset(dataSetDef.getUUID()) .rowOffset(0) .rowNumber(6) .buildLookup(); try { DataSetHandler editHandler = new DataSetEditHandler(clientServices, lookup, editCloneWithoutCacheSettings); editHandler.lookupDataSet(new DataSetReadyCallback() { @Override public void callback(final DataSet dataSet) { testDataSetCallback.onSuccess(dataSet); } @Override public void notFound() { testDataSetCallback.onError(new ClientRuntimeError(DataSetEditorConstants.INSTANCE.defNotFound())); } @Override public boolean onError(final ClientRuntimeError error) { testDataSetCallback.onError(error); return false; } }); } catch (final Exception e) { testDataSetCallback.onError(new ClientRuntimeError(e)); } } @Inject  DataSetEditorWorkflow(final DataSetClientServices clientServices,
                                 final DataSetValidatorProvider validatorProvider,
                                 final SyncBeanManager beanManager,
                                 final Event<SaveRequestEvent> saveRequestEvent,
                                 final Event<TestDataSetRequestEvent> testDataSetEvent,
                                 final Event<CancelRequestEvent> cancelRequestEvent,
                                 final View view); void init(); void testDataSet(final TestDataSetCallback testDataSetCallback); DataSetEditorWorkflow flush(); DataSetEditorWorkflow showNextButton(); DataSetEditorWorkflow showTestButton(); DataSetEditorWorkflow showBackButton(); DataSetEditorWorkflow clearButtons(); boolean hasErrors(); T getDataSetDef(); @Override Widget asWidget(); void flush(final SimpleBeanEditorDriver driver); DataSetEditorWorkflow clear(); }
DataSetEditorWorkflow implements IsWidget { public void testDataSet(final TestDataSetCallback testDataSetCallback) { checkDataSetDefNotNull(); getDataSetDef().setAllColumnsEnabled(true); getDataSetDef().setColumns(null); getDataSetDef().setDataSetFilter(null); DataSetDef editCloneWithoutCacheSettings = getDataSetDef().clone(); editCloneWithoutCacheSettings.setCacheEnabled(false); final DataSetLookup lookup = DataSetFactory.newDataSetLookupBuilder() .dataset(dataSetDef.getUUID()) .rowOffset(0) .rowNumber(6) .buildLookup(); try { DataSetHandler editHandler = new DataSetEditHandler(clientServices, lookup, editCloneWithoutCacheSettings); editHandler.lookupDataSet(new DataSetReadyCallback() { @Override public void callback(final DataSet dataSet) { testDataSetCallback.onSuccess(dataSet); } @Override public void notFound() { testDataSetCallback.onError(new ClientRuntimeError(DataSetEditorConstants.INSTANCE.defNotFound())); } @Override public boolean onError(final ClientRuntimeError error) { testDataSetCallback.onError(error); return false; } }); } catch (final Exception e) { testDataSetCallback.onError(new ClientRuntimeError(e)); } } @Inject  DataSetEditorWorkflow(final DataSetClientServices clientServices,
                                 final DataSetValidatorProvider validatorProvider,
                                 final SyncBeanManager beanManager,
                                 final Event<SaveRequestEvent> saveRequestEvent,
                                 final Event<TestDataSetRequestEvent> testDataSetEvent,
                                 final Event<CancelRequestEvent> cancelRequestEvent,
                                 final View view); void init(); void testDataSet(final TestDataSetCallback testDataSetCallback); DataSetEditorWorkflow flush(); DataSetEditorWorkflow showNextButton(); DataSetEditorWorkflow showTestButton(); DataSetEditorWorkflow showBackButton(); DataSetEditorWorkflow clearButtons(); boolean hasErrors(); T getDataSetDef(); @Override Widget asWidget(); void flush(final SimpleBeanEditorDriver driver); DataSetEditorWorkflow clear(); public View view; }