Change in ovirt-engine[master]: engine: New test method in DBConfigUtilsTest

yzaslavs at redhat.com yzaslavs at redhat.com
Wed Apr 17 10:26:04 UTC 2013


Yair Zaslavsky has submitted this change and it was merged.

Change subject: engine: New test method in DBConfigUtilsTest
......................................................................


engine: New test method in DBConfigUtilsTest

There seems to be a perception in the community that there is some bug
in the config framework because of which the api returns a null value if
there is no entry in vdc_options for a given config.

This patch attempts to add a new test case that verifies that this is
not the case, and if entry is missing in vdc_options, value returned is
from the @DefaultValueAttribute annotation in ConfigValues enum.

For this purpose,
- Modified DBConfigUtilsTest to extend from BaseDAOTestCase, so that
  fixtures.xml can be used to insert entries in vdc_options
- Modified fixtures.xml to insert two entries in vdc_options for the
  config NonVmNetworkSupported for version 3.0 and 3.2
- Renamed DBConfigUtils#RefreshVdcOptionCache to refreshVdcOptionCache
  and made it protected so that it can be called from test class passing
  the test dbFacade
- Added new test method testGetValue() to verify that default value is
  returned if entry is not present in vdc_options

Change-Id: Ia736419e766bc6ce2e82158f775817e885b90dfd
Signed-off-by: Shireesh Anjal <sanjal at redhat.com>
---
M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/generic/DBConfigUtils.java
M backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dal/dbbroker/generic/DBConfigUtilsTest.java
M backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VdcOptionDAOTest.java
M backend/manager/modules/dal/src/test/resources/fixtures.xml
4 files changed, 30 insertions(+), 5 deletions(-)

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


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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia736419e766bc6ce2e82158f775817e885b90dfd
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Shireesh Anjal <sanjal at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Mike Kolesnik <mkolesni at redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofrenkel at redhat.com>
Gerrit-Reviewer: Sahina Bose <sabose at redhat.com>
Gerrit-Reviewer: Shireesh Anjal <sanjal at redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzaslavs at redhat.com>



More information about the Engine-commits mailing list