use of org.ovirt.engine.core.bll.storage.domain.SyncLunsInfoForBlockStorageDomainCommand.LunHandler in project ovirt-engine by oVirt.
the class SyncLunsInfoForBlockStorageDomainCommandTest method testGetLunsToUpdateInDbLunExistsInDbButNotInVgInfo.
@Test
public void testGetLunsToUpdateInDbLunExistsInDbButNotInVgInfo() {
Guid lunFromDbId = Guid.newGuid();
Map<LunHandler, List<LUNs>> lunsToUpdateInDb = getLunsToUpdateInDb(Guid.newGuid(), lunFromDbId, Guid.newGuid(), Guid.newGuid());
List<LUNs> lunsToRemoveFromDb = lunsToUpdateInDb.get(command.removeLunsHandler);
assertEquals(Stream.of(command.saveLunsHandler, command.removeLunsHandler).collect(Collectors.toSet()), lunsToUpdateInDb.keySet());
assertLunIdInList(lunsToRemoveFromDb, lunFromDbId);
}
use of org.ovirt.engine.core.bll.storage.domain.SyncLunsInfoForBlockStorageDomainCommand.LunHandler in project ovirt-engine by oVirt.
the class SyncLunsInfoForBlockStorageDomainCommandTest method testGetLunsToUpdateInDbDiffLunIdDiffPvId.
@Test
public void testGetLunsToUpdateInDbDiffLunIdDiffPvId() {
Guid lunFromVgLunId = Guid.newGuid();
Map<LunHandler, List<LUNs>> lunsToUpdateInDb = getLunsToUpdateInDb(lunFromVgLunId, Guid.newGuid(), Guid.newGuid(), Guid.newGuid());
List<LUNs> newLunsToSaveInDb = lunsToUpdateInDb.get(command.saveLunsHandler);
assertEquals(Stream.of(command.saveLunsHandler, command.removeLunsHandler).collect(Collectors.toSet()), lunsToUpdateInDb.keySet());
assertLunIdInList(newLunsToSaveInDb, lunFromVgLunId);
}
use of org.ovirt.engine.core.bll.storage.domain.SyncLunsInfoForBlockStorageDomainCommand.LunHandler in project ovirt-engine by oVirt.
the class SyncLunsInfoForBlockStorageDomainCommandTest method testGetLunsToUpdateInDbDiffLunIdSamePvId.
@Test
public void testGetLunsToUpdateInDbDiffLunIdSamePvId() {
Guid pvID = Guid.newGuid();
Guid lunFromVgLunId = Guid.newGuid();
Map<LunHandler, List<LUNs>> lunsToUpdateInDb = getLunsToUpdateInDb(lunFromVgLunId, Guid.newGuid(), pvID, pvID);
List<LUNs> newLunsToSaveInDb = lunsToUpdateInDb.get(command.saveLunsHandler);
assertEquals(Stream.of(command.saveLunsHandler, command.removeLunsHandler).collect(Collectors.toSet()), lunsToUpdateInDb.keySet());
assertLunIdInList(newLunsToSaveInDb, lunFromVgLunId);
}
use of org.ovirt.engine.core.bll.storage.domain.SyncLunsInfoForBlockStorageDomainCommand.LunHandler in project ovirt-engine by oVirt.
the class SyncLunsInfoForBlockStorageDomainCommandTest method testGetLunsToUpdateInDbSameLunIdDiffPvId.
@Test
public void testGetLunsToUpdateInDbSameLunIdDiffPvId() {
Guid lunId = Guid.newGuid();
Map<LunHandler, List<LUNs>> lunsToUpdateInDb = getLunsToUpdateInDb(lunId, lunId, Guid.newGuid(), Guid.newGuid());
List<LUNs> existingLunsToUpdateInDb = lunsToUpdateInDb.get(command.updateLunsHandler);
assertEquals(Collections.singleton(command.updateLunsHandler), lunsToUpdateInDb.keySet());
assertLunIdInList(existingLunsToUpdateInDb, lunId);
}
Aggregations