use of org.ovirt.engine.api.model.Fault in project ovirt-engine by oVirt.
the class AbstractBackendCpuProfilesResourceTest method testListFailure.
@Override
@Test
public void testListFailure() throws Exception {
setUpCpuProfilesQueryExpectations(FAILURE);
UriInfo uriInfo = setUpUriExpectations(null);
collection.setUriInfo(uriInfo);
try {
getCollection();
fail("expected WebApplicationException");
} catch (WebApplicationException wae) {
assertTrue(wae.getResponse().getEntity() instanceof Fault);
assertEquals(mockl10n(FAILURE), ((Fault) wae.getResponse().getEntity()).getDetail());
}
}
use of org.ovirt.engine.api.model.Fault in project ovirt-engine by oVirt.
the class AbstractBackendDiskProfilesResourceTest method testListFailure.
@Override
@Test
public void testListFailure() throws Exception {
setUpDiskProfilesQueryExpectations(FAILURE);
UriInfo uriInfo = setUpUriExpectations(null);
collection.setUriInfo(uriInfo);
try {
getCollection();
fail("expected WebApplicationException");
} catch (WebApplicationException wae) {
assertTrue(wae.getResponse().getEntity() instanceof Fault);
assertEquals(mockl10n(FAILURE), ((Fault) wae.getResponse().getEntity()).getDetail());
}
}
use of org.ovirt.engine.api.model.Fault in project ovirt-engine by oVirt.
the class AbstractBackendNetworkAttachmentsResourceTest method testListFailure.
@Override
@Test
public void testListFailure() throws Exception {
setUpNetworkAttachmentsQueryExpectations(FAILURE);
UriInfo uriInfo = setUpUriExpectations(null);
collection.setUriInfo(uriInfo);
try {
getCollection();
fail("expected WebApplicationException");
} catch (WebApplicationException wae) {
assertTrue(wae.getResponse().getEntity() instanceof Fault);
assertEquals(mockl10n(FAILURE), ((Fault) wae.getResponse().getEntity()).getDetail());
}
}
use of org.ovirt.engine.api.model.Fault in project ovirt-engine by oVirt.
the class BackendFilesResourceTest method verifyFault.
@Override
protected void verifyFault(WebApplicationException wae, String reason, Throwable t) {
assertEquals(BAD_REQUEST, wae.getResponse().getStatus());
assertTrue(wae.getResponse().getEntity() instanceof Fault);
Fault fault = (Fault) wae.getResponse().getEntity();
assertEquals(reason, fault.getReason());
assertNotNull(fault.getDetail());
assertTrue("expected detail to include: " + t.getMessage(), fault.getDetail().contains(t.getMessage()));
}
use of org.ovirt.engine.api.model.Fault in project ovirt-engine by oVirt.
the class AbstractBackendVnicProfilesResourceTest method testListFailure.
@Override
@Test
public void testListFailure() throws Exception {
setUpVnicProfilesQueryExpectations(FAILURE);
UriInfo uriInfo = setUpUriExpectations(null);
collection.setUriInfo(uriInfo);
try {
getCollection();
fail("expected WebApplicationException");
} catch (WebApplicationException wae) {
assertTrue(wae.getResponse().getEntity() instanceof Fault);
assertEquals(mockl10n(FAILURE), ((Fault) wae.getResponse().getEntity()).getDetail());
}
}
Aggregations