use of org.ovirt.engine.api.model.Boot 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.Boot in project ovirt-engine by oVirt.
the class V3OperatingSystemInAdapter method adapt.
@Override
public OperatingSystem adapt(V3OperatingSystem from) {
OperatingSystem to = new OperatingSystem();
if (from.isSetBoot()) {
Boot toBoot = new Boot();
Boot.DevicesList toDevicesList = new Boot.DevicesList();
List<BootDevice> toDevices = toDevicesList.getDevices();
from.getBoot().stream().map(V3Boot::getDev).map(BootDevice::fromValue).forEach(toDevices::add);
toBoot.setDevices(toDevicesList);
to.setBoot(toBoot);
}
if (from.isSetCmdline()) {
to.setCmdline(from.getCmdline());
}
if (from.isSetInitrd()) {
to.setInitrd(from.getInitrd());
}
if (from.isSetKernel()) {
to.setKernel(from.getKernel());
}
if (from.isSetType()) {
to.setType(from.getType());
}
if (from.isSetVersion()) {
to.setVersion(adaptIn(from.getVersion()));
}
return to;
}
Aggregations