protected void executeImport(ImportTemplatesModel model) { model.executeImport(cloneObjectMap, result -> { boolean isAllValidatePassed = true; for (ActionReturnValue returnValueBase : result.getReturnValue()) { if (!returnValueBase.isValid()) { isAllValidatePassed = false; break; } } if (isAllValidatePassed) { setWindow(null); } }); }
@Override public void executeCommand(UICommand uiCommand) { model.onRestoreVms( result -> { boolean isAllValidatePassed = true; for (ActionReturnValue returnValueBase : result.getReturnValue()) { if (!returnValueBase.isValid()) { isAllValidatePassed = false; break; } } if (isAllValidatePassed) { setWindow(null); } }); } }).setTitle(ConstantsManager.getInstance().getConstants().ok())
private IFrontendMultipleActionAsyncCallback createCallback() { return result -> { boolean hasError = false; for (ActionReturnValue singleResult : result.getReturnValue()) { if (!singleResult.isValid() || (waitForResult && !singleResult.getSucceeded())) { hasError = true; getActionFlowState().addFailure(actionType, singleResult); } } if (hasError && !runNextInCaseOfError) { then(null); } runNextAction(); }; }
List<MoveHostData> hosts = ((MoveHost) dataCenterGuideModel.getWindow()).getSelectedHosts(); List<ActionReturnValue> retVals = result.getReturnValue(); final List<ActionParametersBase> activateVdsParameterList = new ArrayList<>(); if (retVals != null && hosts.size() == retVals.size()) {
templateBackupModel.getWindow().stopProgress(); templateBackupModel.cancel(); List<ActionReturnValue> retVals = result.getReturnValue(); if (retVals != null && templateBackupModel.getSelectedItems().size() == retVals.size()) {
assertEquals(parameters, callbackMultipleParam.getValue().getParameters(), "Parameters should match"); //$NON-NLS-1$ assertEquals(returnValues, callbackMultipleParam.getValue().getReturnValue(), "Result should match"); //$NON-NLS-1$ assertEquals(testState, callbackMultipleParam.getValue().getState(), "States should match"); //$NON-NLS-1$
/** * Run the following test case. * <ol> * <li>Run a multiple actions, a single action</li> * <li>Force a failure with an HTTP status code = 404</li> * <li>Check to make sure the failure event is fired</li> * <li>Check to make sure the proper values are passed to the callback.</li> * </ol> */ @Test public void testrunMultipleActions_404_failure_multiple() { ArrayList<ActionParametersBase> parameters = new ArrayList<>(); parameters.add(new ActionParametersBase()); frontend.runMultipleAction(ActionType.AddLocalStorageDomain, parameters, false, mockMultipleActionCallback, testState); verify(mockService).runMultipleActions(eq(ActionType.AddLocalStorageDomain), eq(parameters), eq(false), eq(false), callbackMultipleActions.capture()); StatusCodeException exception = new StatusCodeException(HttpServletResponse.SC_NOT_FOUND, "404 status code"); //$NON-NLS-1$ callbackMultipleActions.getValue().onFailure(exception); verify(mockFrontendFailureEvent).raise(eq(Frontend.class), (FrontendFailureEventArgs) any()); verify(mockMultipleActionCallback).executed(callbackMultipleParam.capture()); assertEquals(ActionType.AddLocalStorageDomain, callbackMultipleParam.getValue().getActionType(), "ActionType should be 'AddLocalStorageDomain'"); //$NON-NLS-1$ assertEquals(parameters, callbackMultipleParam.getValue().getParameters(), "Parameters should match"); //$NON-NLS-1$ assertNull(callbackMultipleParam.getValue().getReturnValue(), "There should be no result"); //$NON-NLS-1$ assertEquals(testState, callbackMultipleParam.getValue().getState(), "States should match"); //$NON-NLS-1$ verifyAsyncActionStartedAndFailed(); }
assertEquals(parameters, callbackMultipleParam.getValue().getParameters(), "Parameters should match"); //$NON-NLS-1$ assertEquals(returnValues, callbackMultipleParam.getValue().getReturnValue(), "Result should match"); //$NON-NLS-1$ assertEquals(testState, callbackMultipleParam.getValue().getState(), "States should match"); //$NON-NLS-1$
ArrayList<ActionReturnValue> retVals = (ArrayList<ActionReturnValue>) result .getReturnValue(); if (retVals != null && getSelectedItems().size() == retVals
assertEquals(parameters, callbackMultipleParam.getValue().getParameters(), "Parameters should match"); //$NON-NLS-1$ assertEquals(returnValues, callbackMultipleParam.getValue().getReturnValue(), "Result should match"); //$NON-NLS-1$ assertEquals(testState, callbackMultipleParam.getValue().getState(), "States should match"); //$NON-NLS-1$
List<ActionReturnValue> retVals = result.getReturnValue(); final List<ActionParametersBase> activateVdsParameterList = new ArrayList<>(); if (retVals != null && hosts.size() == retVals.size()) {
result -> { DataCenterListModel localModel = (DataCenterListModel) result.getState(); localModel.postOnSaveInternal(result.getReturnValue().get(0)); }, this);
hostsModel.stopProgress(); boolean isAllValidatePassed = true; for (ActionReturnValue returnValueBase : result.getReturnValue()) { isAllValidatePassed = returnValueBase.isValid(); if (!isAllValidatePassed) {
hostsModel.stopProgress(); boolean isAllValidatePassed = true; for (ActionReturnValue returnValueBase : result.getReturnValue()) { isAllValidatePassed = isAllValidatePassed && returnValueBase.isValid(); if (!isAllValidatePassed) {