Yair Zaslavsky has submitted this change and it was merged.

Change subject: utils: enable UT for EngineLocalConfig
......................................................................


utils: enable UT for EngineLocalConfig

EngineLocalConfig is singleton without initialization method, as such we
cannot mock it nor control who in the chain actually call it.

the solution taken is to allow overriding its instance using pre-defined
configuration, so that the default getInstance() method will return
already constructed instance.

to ease usage, a test watcher class was added.

Change-Id: Ie877a056e11a83badd5675cf24ffa48898b5786d
Signed-off-by: Alon Bar-Lev <[email protected]>
---
M 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/EngineLocalConfig.java
M 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/LocalConfig.java
A 
backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/MockEngineLocalConfigRule.java
M 
backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/crypt/EngineEncryptionUtilsTest.java
M backend/manager/modules/utils/src/test/resources/localconfig.conf.ref
5 files changed, 120 insertions(+), 17 deletions(-)

Approvals:
  Yair Zaslavsky: Verified; Looks good to me, approved


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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie877a056e11a83badd5675cf24ffa48898b5786d
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Laszlo Hornyak <[email protected]>
Gerrit-Reviewer: Roy Golan <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to