@Test public void test() throws InterruptedException, ApiSenderException { DiskOfferingInventory inv = new DiskOfferingInventory(); inv.setDiskSize(SizeUnit.GIGABYTE.toByte(10)); inv.setName("Test"); inv.setDescription("Test"); inv = api.addDiskOffering(inv); inv.setName("1"); inv.setDescription("xxx"); inv = api.updateDiskOffering(inv); Assert.assertEquals("1", inv.getName()); Assert.assertEquals("xxx", inv.getDescription()); }
@Test public void test() throws ApiSenderException { DiskOfferingInventory dinv = new DiskOfferingInventory(); dinv.setDiskSize(SizeUnit.GIGABYTE.toByte(10)); dinv.setName("Test"); dinv.setDescription("Test"); dinv = api.addDiskOffering(dinv); VolumeInventory vinv = api.createDataVolume("TestData", dinv.getUuid()); Assert.assertEquals(VolumeStatus.NotInstantiated.toString(), vinv.getStatus()); Assert.assertEquals(VolumeType.Data.toString(), vinv.getType()); Assert.assertFalse(vinv.isAttached()); api.deleteDataVolume(vinv.getUuid()); VolumeVO vo = dbf.findByUuid(vinv.getUuid(), VolumeVO.class); Assert.assertNull(vo); }