use of org.ovirt.engine.api.model.Action in project ovirt-engine by oVirt.
the class BackendJobResourceTest method testEnd.
@Test
public void testEnd() throws Exception {
setUriInfo(setUpActionExpectations(ActionType.EndExternalJob, EndExternalJobParameters.class, new String[] { "JobId", "Status", "Force" }, new Object[] { GUIDS[0], true, false }, true, true));
Action action = new Action();
action.setSucceeded(true);
verifyActionResponse(resource.end(action));
}
use of org.ovirt.engine.api.model.Action in project ovirt-engine by oVirt.
the class BackendSnapshotResourceTest method testRestore.
@Test
public void testRestore() {
setUriInfo(setUpBasicUriExpectations());
setUpTryBackExpectations();
setUpRestoreExpectations();
resource.restore(new Action());
}
use of org.ovirt.engine.api.model.Action in project ovirt-engine by oVirt.
the class BackendHostResourceTest method testManualFence.
@Test
public void testManualFence() throws Exception {
setUpGetEntityWithNoCertificateInfoExpectations();
setUriInfo(setUpActionExpectations(ActionType.FenceVdsManualy, FenceVdsManualyParameters.class, new String[] { "VdsId", "StoragePoolId" }, new Object[] { GUIDS[0], GUIDS[1] }));
Action action = new Action();
action.setFenceType(FenceType.MANUAL.value());
verifyActionResponse(resource.fence(action));
}
use of org.ovirt.engine.api.model.Action in project ovirt-engine by oVirt.
the class BackendHostResourceTest method testIncompleteFence.
@Test
public void testIncompleteFence() throws Exception {
setUriInfo(setUpBasicUriExpectations());
try {
resource.fence(new Action());
fail("expected WebApplicationException on incomplete parameters");
} catch (WebApplicationException wae) {
verifyIncompleteException(wae, "Action", "fence", "fenceType");
}
}
use of org.ovirt.engine.api.model.Action in project ovirt-engine by oVirt.
the class BackendHostResourceTest method testFenceStatus.
@Test
public void testFenceStatus() throws Exception {
FenceOperationResult retVal = new FenceOperationResult(FenceOperationResult.Status.SUCCESS, PowerStatus.ON);
setUpEntityQueryExpectations(QueryType.GetVdsFenceStatus, IdQueryParameters.class, new String[] { "Id" }, new Object[] { GUIDS[0] }, retVal);
Action action = new Action();
action.setFenceType(FenceType.STATUS.value());
verifyActionResponse(resource.fence(action));
PowerManagementStatus status = action.getPowerManagement().getStatus();
assertEquals(PowerManagementStatus.ON, status);
}
Aggregations