Search in sources :

Example 11 with Usb

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

the class VmMapperTest method getUsbPolicyOnUpdateCurrentlyNativeGotNullUsb.

@Test
public void getUsbPolicyOnUpdateCurrentlyNativeGotNullUsb() {
    Usb usb = null;
    UsbPolicy currentPolicy = UsbPolicy.ENABLED_NATIVE;
    assertEquals(VmMapper.getUsbPolicyOnUpdate(usb, currentPolicy), currentPolicy);
}
Also used : UsbPolicy(org.ovirt.engine.core.common.businessentities.UsbPolicy) Usb(org.ovirt.engine.api.model.Usb) Test(org.junit.Test)

Example 12 with Usb

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

the class VmMapperTest method getUsbPolicyNullUsb.

@Test
public void getUsbPolicyNullUsb() {
    Usb usb = null;
    assertEquals(UsbPolicy.DISABLED, VmMapper.getUsbPolicyOnCreate(usb));
}
Also used : Usb(org.ovirt.engine.api.model.Usb) Test(org.junit.Test)

Example 13 with Usb

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

the class VmMapperTest method getUsbPolicyOnUpdateCurrentlyDisabledGotEnabledNotSetPolicyNotSetUsb.

@Test
public void getUsbPolicyOnUpdateCurrentlyDisabledGotEnabledNotSetPolicyNotSetUsb() {
    Usb usb = new Usb();
    UsbPolicy currentPolicy = UsbPolicy.DISABLED;
    assertEquals(VmMapper.getUsbPolicyOnUpdate(usb, currentPolicy), currentPolicy);
}
Also used : UsbPolicy(org.ovirt.engine.core.common.businessentities.UsbPolicy) Usb(org.ovirt.engine.api.model.Usb) Test(org.junit.Test)

Example 14 with Usb

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

the class VmMapperTest method getUsbPolicyOnUpdateCurrentlyDisabledGotEnabledNotSetNativePolicyUsb.

@Test
public void getUsbPolicyOnUpdateCurrentlyDisabledGotEnabledNotSetNativePolicyUsb() {
    Usb usb = new Usb();
    usb.setType(UsbType.NATIVE);
    assertEquals(UsbPolicy.DISABLED, VmMapper.getUsbPolicyOnUpdate(usb, UsbPolicy.DISABLED));
}
Also used : Usb(org.ovirt.engine.api.model.Usb) Test(org.junit.Test)

Aggregations

Usb (org.ovirt.engine.api.model.Usb)14 Test (org.junit.Test)13 UsbPolicy (org.ovirt.engine.core.common.businessentities.UsbPolicy)4 Cpu (org.ovirt.engine.api.model.Cpu)1 CpuTopology (org.ovirt.engine.api.model.CpuTopology)1 HighAvailability (org.ovirt.engine.api.model.HighAvailability)1 Host (org.ovirt.engine.api.model.Host)1 Hosts (org.ovirt.engine.api.model.Hosts)1 Io (org.ovirt.engine.api.model.Io)1 MemoryPolicy (org.ovirt.engine.api.model.MemoryPolicy)1 UsbType (org.ovirt.engine.api.model.UsbType)1 VmAffinity (org.ovirt.engine.api.model.VmAffinity)1 VmPlacementPolicy (org.ovirt.engine.api.model.VmPlacementPolicy)1 Guid (org.ovirt.engine.core.compat.Guid)1