Vojtech Szocs has posted comments on this change.

Change subject: webadmin,userportal: JUnit rule for testing UiCommon models
......................................................................


Patch Set 2:

(2 comments)

http://gerrit.ovirt.org/#/c/31021/2/frontend/webadmin/modules/uicommonweb/src/test/java/org/ovirt/engine/ui/uicommonweb/junit/UiCommonSetup.java
File 
frontend/webadmin/modules/uicommonweb/src/test/java/org/ovirt/engine/ui/uicommonweb/junit/UiCommonSetup.java:

Line 88:                 env = new Env();
Line 89:                 env.update(true);
Line 90:                 base.evaluate();
Line 91:                 env.update(false);
Line 92:                 env = null;
> Is this explicit nulling necessary?
It's there to ensure proper behavior of getMocks() method, i.e. "env" should be 
non-null only during rule (statement) execution.

In other words, "env" is scoped to the execution of the rule.
Line 93:             }
Line 94:         };
Line 95:     }
Line 96: 


http://gerrit.ovirt.org/#/c/31021/2/frontend/webadmin/modules/uicommonweb/src/test/java/org/ovirt/engine/ui/uicommonweb/models/vms/BaseVmModelBehaviorTest.java
File 
frontend/webadmin/modules/uicommonweb/src/test/java/org/ovirt/engine/ui/uicommonweb/models/vms/BaseVmModelBehaviorTest.java:

Line 21: 
Line 22:     @BeforeClass
Line 23:     public static void mockFrontend() {
Line 24:         Frontend frontend = setup.getMocks().frontend();
Line 25:         
when(frontend.getQueryCompleteEvent()).thenReturn(mock(Event.class));
> I think it would be beneficial to have this in the Rule itself as great maj
Well, I counted 7 models using getQueryCompleteEvent() method :-)

OK, I will consider adding it to the rule.
Line 26:     }
Line 27: 
Line 28:     protected void setUpVm(VmBase vm) {
Line 29:         vm.setName(VM_NAME);


-- 
To view, visit http://gerrit.ovirt.org/31021
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifca6bf6a6b77813fa90f419ccfe2ef9f2cd09561
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Vojtech Szocs <vsz...@redhat.com>
Gerrit-Reviewer: Alexander Wels <aw...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Einav Cohen <eco...@redhat.com>
Gerrit-Reviewer: Frank Kobzik <fkob...@redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com>
Gerrit-Reviewer: Lior Vernia <lver...@redhat.com>
Gerrit-Reviewer: Martin Betak <mbe...@redhat.com>
Gerrit-Reviewer: Tomas Jelinek <tjeli...@redhat.com>
Gerrit-Reviewer: Vojtech Szocs <vsz...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to