Search in sources :

Example 1 with VmContainer

use of org.ovirt.engine.sdk4.internal.containers.VmContainer in project ovirt-engine-sdk-java by oVirt.

the class VmTest method testVmDiskWithValues.

/**
 * Check when creating list of vm disks it creates that list
 */
@Test
public void testVmDiskWithValues() {
    VmContainer vm = new VmContainer();
    vm.diskAttachments(Arrays.asList((DiskAttachment) new DiskAttachmentContainer()));
    assertNotNull(vm.diskAttachments());
    assertEquals(1, vm.diskAttachments().size());
    assertNotNull(vm.diskAttachments().get(0));
}
Also used : DiskAttachment(org.ovirt.engine.sdk4.types.DiskAttachment) VmContainer(org.ovirt.engine.sdk4.internal.containers.VmContainer) DiskAttachmentContainer(org.ovirt.engine.sdk4.internal.containers.DiskAttachmentContainer) Test(org.junit.Test)

Example 2 with VmContainer

use of org.ovirt.engine.sdk4.internal.containers.VmContainer in project ovirt-engine-sdk-java by oVirt.

the class VmTest method testVmDiskIsEmpty.

/**
 * Check when creating null vm disks it creates empty list
 */
@Test
public void testVmDiskIsEmpty() {
    VmContainer vm = new VmContainer();
    vm.diskAttachments(null);
    assertNotNull(vm.diskAttachments());
    assertEquals(0, vm.diskAttachments().size());
}
Also used : VmContainer(org.ovirt.engine.sdk4.internal.containers.VmContainer) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 VmContainer (org.ovirt.engine.sdk4.internal.containers.VmContainer)2 DiskAttachmentContainer (org.ovirt.engine.sdk4.internal.containers.DiskAttachmentContainer)1 DiskAttachment (org.ovirt.engine.sdk4.types.DiskAttachment)1