use of org.ovirt.engine.api.model.Action in project ovirt-engine by oVirt.
the class BackendVmResourceTest method testStart.
@Test
public void testStart() throws Exception {
setUriInfo(setUpActionExpectations(ActionType.RunVm, RunVmParams.class, new String[] { "VmId" }, new Object[] { GUIDS[0] }));
Response response = resource.start(new Action());
verifyActionResponse(response);
verifyActionModel(((Action) response.getEntity()).getVm(), 0);
}
use of org.ovirt.engine.api.model.Action in project ovirt-engine by oVirt.
the class BackendVmResourceTest method testStartWithBootDev.
@Test
public void testStartWithBootDev() throws Exception {
setUpWindowsGetEntityExpectations(1, false);
setUriInfo(setUpActionExpectations(ActionType.RunVmOnce, RunVmOnceParams.class, new String[] { "VmId", "BootSequence" }, new Object[] { GUIDS[0], BootSequence.N }));
Action action = new Action();
action.setVm(new Vm());
action.getVm().setOs(new OperatingSystem());
action.getVm().getOs().setBoot(new Boot());
action.getVm().getOs().getBoot().setDevices(new Boot.DevicesList());
action.getVm().getOs().getBoot().getDevices().getDevices().add(BootDevice.NETWORK);
verifyActionResponse(resource.start(action));
}
use of org.ovirt.engine.api.model.Action in project ovirt-engine by oVirt.
the class BackendVmResourceTest method testUndoSnapshot.
@Test
public void testUndoSnapshot() throws Exception {
setUriInfo(setUpActionExpectations(ActionType.RestoreAllSnapshots, RestoreAllSnapshotsParameters.class, new String[] { "VmId", "SnapshotAction" }, new Object[] { GUIDS[0], SnapshotActionEnum.UNDO }));
Response response = resource.undoSnapshot(new Action());
verifyActionResponse(response);
Action action = (Action) response.getEntity();
assertTrue(action.isSetStatus());
assertEquals(CreationStatus.COMPLETE.value(), action.getStatus());
}
use of org.ovirt.engine.api.model.Action in project ovirt-engine by oVirt.
the class BackendVmResourceTest method testFreezeFilesystems.
@Test
public void testFreezeFilesystems() throws Exception {
setUriInfo(setUpActionExpectations(ActionType.FreezeVm, VmOperationParameterBase.class, new String[] { "VmId" }, new Object[] { GUIDS[0] }));
Action action = new Action();
verifyActionResponse(resource.freezeFilesystems(action));
}
use of org.ovirt.engine.api.model.Action in project ovirt-engine by oVirt.
the class BackendVmResourceTest method testStartWithModifiedGraphics.
private void testStartWithModifiedGraphics(GraphicsType graphicsType) throws Exception {
setUpWindowsGetEntityExpectations(1, false);
setUriInfo(setUpActionExpectations(ActionType.RunVmOnce, RunVmOnceParams.class, new String[] { "VmId", "RunOnceGraphics" }, new Object[] { GUIDS[0], Collections.singleton(graphicsType) }));
Action action = new Action();
action.setVm(new Vm());
action.getVm().setDisplay(new Display());
DisplayType display = (graphicsType == GraphicsType.VNC) ? DisplayType.VNC : DisplayType.SPICE;
action.getVm().getDisplay().setType(display);
verifyActionResponse(resource.start(action));
}
Aggregations