Change in ovirt-engine[master]: resatpi: Mocking backend exceptions in tests

Code Review gerrit at ovirt.org
Mon May 22 10:43:45 UTC 2017


>From Allon Mureinik <amureini at redhat.com>:

Allon Mureinik has submitted this change and it was merged.

Change subject: resatpi: Mocking backend exceptions in tests
......................................................................


resatpi: Mocking backend exceptions in tests

In the backend, once a VdcQueryRetrunValue is generated, it can no
longer throw an exception when it's accessed, so mocking
queryResult.getExceptionString() to throw an exception is artificial,
and doesn't represent any real world use case.

This patch moves the mocking of throwing a [runtime] Exception to the
backend.runQuery call, which represents a query that actually fails
catastrophically.

Change-Id: Ibd9d1f5555c5a357f9947f727a7b6f1c5ea568bf
Signed-off-by: Allon Mureinik <amureini at redhat.com>
---
M backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/AbstractBackendBaseTest.java
M backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/AbstractBackendCollectionResourceTest.java
M backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendExportDomainDiskResourceTest.java
M backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendExportDomainDisksResourceTest.java
4 files changed, 38 insertions(+), 20 deletions(-)

Approvals:
  Allon Mureinik: Verified; Passed CI tests
  Vojtech Szocs: Looks good to me, but someone else must approve
  Moti Asayag: Looks good to me, approved



-- 
To view, visit https://gerrit.ovirt.org/76962
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibd9d1f5555c5a357f9947f727a7b6f1c5ea568bf
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: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Moti Asayag <masayag at redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: Vojtech Szocs <vszocs at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>


More information about the Engine-commits mailing list