Search in sources :

Example 11 with File

use of org.ovirt.engine.api.model.File in project ovirt-engine by oVirt.

the class BackendVmResourceTest method testStartWithCdRomAndFloppy.

@Test
public void testStartWithCdRomAndFloppy() throws Exception {
    setUpWindowsGetEntityExpectations(1, false);
    setUriInfo(setUpActionExpectations(ActionType.RunVmOnce, RunVmOnceParams.class, new String[] { "VmId", "DiskPath", "FloppyPath" }, new Object[] { GUIDS[0], ISO_ID, FLOPPY_ID }));
    Action action = new Action();
    action.setVm(new Vm());
    action.getVm().setCdroms(new Cdroms());
    action.getVm().getCdroms().getCdroms().add(new Cdrom());
    action.getVm().getCdroms().getCdroms().get(0).setFile(new File());
    action.getVm().getCdroms().getCdroms().get(0).getFile().setId(ISO_ID);
    action.getVm().setFloppies(new Floppies());
    action.getVm().getFloppies().getFloppies().add(new Floppy());
    action.getVm().getFloppies().getFloppies().get(0).setFile(new File());
    action.getVm().getFloppies().getFloppies().get(0).getFile().setId(FLOPPY_ID);
    verifyActionResponse(resource.start(action));
}
Also used : Cdrom(org.ovirt.engine.api.model.Cdrom) Action(org.ovirt.engine.api.model.Action) RunVmOnceParams(org.ovirt.engine.core.common.action.RunVmOnceParams) Floppies(org.ovirt.engine.api.model.Floppies) Vm(org.ovirt.engine.api.model.Vm) Floppy(org.ovirt.engine.api.model.Floppy) File(org.ovirt.engine.api.model.File) Cdroms(org.ovirt.engine.api.model.Cdroms) Test(org.junit.Test)

Aggregations

File (org.ovirt.engine.api.model.File)11 Cdrom (org.ovirt.engine.api.model.Cdrom)6 Test (org.junit.Test)3 Host (org.ovirt.engine.api.model.Host)2 StorageDomain (org.ovirt.engine.api.model.StorageDomain)2 Vm (org.ovirt.engine.api.model.Vm)2 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 WebApplicationException (javax.ws.rs.WebApplicationException)1 Action (org.ovirt.engine.api.model.Action)1 AuthorizedKey (org.ovirt.engine.api.model.AuthorizedKey)1 Cdroms (org.ovirt.engine.api.model.Cdroms)1 Cluster (org.ovirt.engine.api.model.Cluster)1 ExternalVmImport (org.ovirt.engine.api.model.ExternalVmImport)1 Files (org.ovirt.engine.api.model.Files)1 Floppies (org.ovirt.engine.api.model.Floppies)1 Floppy (org.ovirt.engine.api.model.Floppy)1 Nic (org.ovirt.engine.api.model.Nic)1 Payload (org.ovirt.engine.api.model.Payload)1 User (org.ovirt.engine.api.model.User)1