use of org.ovirt.engine.core.common.businessentities.Snapshot in project ovirt-engine by oVirt.
the class SnapshotDaoTest method getAllByVmWithConfiguration.
@Test
public void getAllByVmWithConfiguration() {
List<Snapshot> snapshots = dao.getAllWithConfiguration(FixturesTool.VM_RHEL5_POOL_50);
assertEquals("VM should have a snapshot", 1, snapshots.size());
for (Snapshot snapshot : snapshots) {
assertEquals("Snapshot should have configuration", "test!", snapshot.getVmConfiguration());
assertTrue("Snapshot should have configuration available", snapshot.isVmConfigurationAvailable());
}
}
use of org.ovirt.engine.core.common.businessentities.Snapshot in project ovirt-engine by oVirt.
the class SnapshotDaoTest method getFilteredWithPermissionsNoPermissionsAndNoFilter.
@Test
public void getFilteredWithPermissionsNoPermissionsAndNoFilter() {
Snapshot snapshot = dao.get(EXISTING_SNAPSHOT_ID, UNPRIVILEGED_USER_ID, false);
assertNotNull(snapshot);
assertEquals(existingEntity, snapshot);
}
use of org.ovirt.engine.core.common.businessentities.Snapshot in project ovirt-engine by oVirt.
the class SnapshotDaoTest method updateId.
@Test
public void updateId() throws Exception {
Snapshot snapshot = dao.get(getExistingEntityId());
assertNotNull(snapshot);
Guid oldId = snapshot.getId();
snapshot.setId(Guid.Empty);
dao.updateId(oldId, snapshot.getId());
assertEquals(snapshot, dao.get(snapshot.getId()));
}
use of org.ovirt.engine.core.common.businessentities.Snapshot in project ovirt-engine by oVirt.
the class SnapshotDaoTest method getZeroSnapshotsByMemory.
@Test
public void getZeroSnapshotsByMemory() {
Snapshot snapshot = new Snapshot();
snapshot.setMemoryDiskId(Guid.newGuid());
snapshot.setMetadataDiskId(Guid.newGuid());
assertEquals(0, dao.getNumOfSnapshotsByDisks(snapshot));
}
use of org.ovirt.engine.core.common.businessentities.Snapshot in project ovirt-engine by oVirt.
the class SnapshotDaoTest method assertFullGetAllByVmResult.
/**
* Asserts the result of {@link SnapshotDao#getAll(Guid)} contains the correct snapshots.
*
* @param snapshots
* The result to check
*/
private static void assertFullGetAllByVmResult(List<Snapshot> snapshots) {
assertEquals("VM should have a snapshot", 1, snapshots.size());
for (Snapshot snapshot : snapshots) {
assertFalse("Snapshot shouldn't have configuration available", snapshot.isVmConfigurationAvailable());
assertTrue("Snapshot should have no configuration", StringUtils.isEmpty(snapshot.getVmConfiguration()));
}
}
Aggregations