Change in ovirt-engine[master]: core: Clean up query test conf mocking

amureini at redhat.com amureini at redhat.com
Mon Jan 12 13:23:11 UTC 2015


Allon Mureinik has submitted this change and it was merged.

Change subject: core: Clean up query test conf mocking
......................................................................


core: Clean up query test conf mocking

Previously, AbstractQueryTest defined a @ClassRule for mocking Config
values. Since @ClassRules are hidden, not inherited, if any descending
class wished to have it's own MockConfigRule, the mocking from the base
class had to be copied to the descending class in order not to lose it.
This approach is both error prone and conceptually lacking, as it forces
the descendant classes to know details about the parent's
implementation.

This patch attempts to improve the situation by have AbstractQueryTest
define the getExtraConfigDescriptors() method. This allows each
inheriting class to specify which Config values it wishes to add to the
mocking, while leaving the actual mocking to the base class.

Change-Id: I1d511b1f67e842a64b7c9322a0d526e717f4a601
Signed-off-by: Allon Mureinik <amureini at redhat.com>
---
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AbstractQueryTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AbstractSysprepQueryTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GetAddedGlusterServersQueryTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/GetDeviceListQueryTest.java
M backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/MockConfigRule.java
5 files changed, 30 insertions(+), 19 deletions(-)

Approvals:
  Tal Nisan: Looks good to me, approved
  Allon Mureinik: Verified
  Idan Shaby: Looks good to me, but someone else must approve
  Yair Zaslavsky: Looks good to me, approved
  Oved Ourfali: Looks good to me, but someone else must approve



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1d511b1f67e842a64b7c9322a0d526e717f4a601
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Amit Aviram <aaviram at redhat.com>
Gerrit-Reviewer: Idan Shaby <ishaby at redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourfali at redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzaslavs at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server



More information about the Engine-commits mailing list