Alona Kaplan has posted comments on this change. Change subject: webadmin: fluent UiAction ......................................................................
Patch Set 25: (3 comments) https://gerrit.ovirt.org/#/c/36848/25/frontend/webadmin/modules/uicommonweb/src/test/java/org/ovirt/engine/ui/uicommonweb/action/AsyncUiActionTest.java File frontend/webadmin/modules/uicommonweb/src/test/java/org/ovirt/engine/ui/uicommonweb/action/AsyncUiActionTest.java: Line 96: ActionFlowState flowState = actions.get(0).getActionFlowState(); Line 97: Line 98: verifyRunActionAndExecuteCallbacksRandomly(true, flowState, 1); Line 99: List<C> callbacks = verfifyRunAction(2); Line 100: executeCallbacks(lastSuccess, flowState, callbacks.subList(callbacks.size() - 1, callbacks.size())); > I do have another suggestion. Extend the actions being tested and add to th What for should I store whether the callback had run? I'm executing the callback via the test, I know if it ran. I should verify whether the runAction had run. Line 101: Line 102: return actions; Line 103: } Line 104: https://gerrit.ovirt.org/#/c/36848/25/frontend/webadmin/modules/uicommonweb/src/test/java/org/ovirt/engine/ui/uicommonweb/action/UiActionBaseTest.java File frontend/webadmin/modules/uicommonweb/src/test/java/org/ovirt/engine/ui/uicommonweb/action/UiActionBaseTest.java: Line 54: int numOfProgressInteractions = shouldCallProgressActions ? 1 : 0; Line 55: verify(model, times(numOfProgressInteractions)).startProgress(any(String.class)); Line 56: verify(model, times(numOfProgressInteractions)).stopProgress(); Line 57: Line 58: UiAction previousAction = null; > Is there any test where you wouldn't want to verify at the end that all suc There is, if the flow has stopped because of an error in one of the previous actions. That's why I pass to the assertAllDone just the list of actions that should have actually run. Line 59: for (UiAction action : actions) { Line 60: if (previousAction != null) { Line 61: assertSame(previousAction.getActionFlowState(), action.getActionFlowState()); Line 62: } https://gerrit.ovirt.org/#/c/36848/25/frontend/webadmin/modules/uicommonweb/src/test/java/org/ovirt/engine/ui/uicommonweb/action/UiVdcActionTest.java File frontend/webadmin/modules/uicommonweb/src/test/java/org/ovirt/engine/ui/uicommonweb/action/UiVdcActionTest.java: Line 97: } Line 98: Line 99: private List<IFrontendActionAsyncCallback> verfifyRunAction(int exepectedNumOfRunActionExecutions, Line 100: boolean showErrorDialog) { Line 101: verify(frontend, times(exepectedNumOfRunActionExecutions)).runAction(eq(ACTION_TYPE), > How is it different? Both have the same type. That's the error I get when running the test without the eq- Invalid use of argument matchers! 4 matchers expected, 3 recorded. This exception may occur if matchers are combined with raw values: //incorrect: someMethod(anyObject(), "raw String"); When using matchers, all arguments have to be provided by matchers. For example: //correct: someMethod(anyObject(), eq("String by matcher")); Line 102: any(VdcActionParametersBase.class), Line 103: callbackCaptor.capture(), Line 104: eq(showErrorDialog)); Line 105: List<IFrontendActionAsyncCallback> callbacks = callbackCaptor.getAllValues(); -- To view, visit https://gerrit.ovirt.org/36848 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I262282d00bbb16a65f36a2463d3ffe8dbf6594c6 Gerrit-PatchSet: 25 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alona Kaplan <alkap...@redhat.com> Gerrit-Reviewer: Alona Kaplan <alkap...@redhat.com> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Lior Vernia <lver...@redhat.com> Gerrit-Reviewer: Yevgeny Zaspitsky <yzasp...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches