use of org.ovirt.engine.core.common.businessentities.storage.RepoImage in project ovirt-engine by oVirt.
the class RepoFileMetaDataDaoTest method testPrimaryKeyValidation.
/**
* Test primary key validity.
*/
@Test
public void testPrimaryKeyValidation() {
RepoImage newRepoFileMap = getNewIsoRepoFile();
repoFileMetaDataDao.addRepoFileMap(newRepoFileMap);
expectedException.expect(DuplicateKeyException.class);
// Should enter here since its a violation of primary key
repoFileMetaDataDao.addRepoFileMap(newRepoFileMap);
}
use of org.ovirt.engine.core.common.businessentities.storage.RepoImage in project ovirt-engine by oVirt.
the class RepoFileMetaDataDaoTest method testFetchNotExistingRepoFileListById.
/**
* Test that the list returns is not null, but is empty.
*/
@Test
public void testFetchNotExistingRepoFileListById() {
Guid falseGuid = new Guid("11111111-1111-1111-1111-111111111111");
List<RepoImage> listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain(falseGuid, ImageFileType.ISO);
assertNotNull(listOfRepoFiles);
assertTrue(listOfRepoFiles.isEmpty());
}
use of org.ovirt.engine.core.common.businessentities.storage.RepoImage in project ovirt-engine by oVirt.
the class RepoFileMetaDataDaoTest method testInsertRepoFileAndFetchItAgain.
/**
* Test when insert row and fetching it later.
*/
@Test
public void testInsertRepoFileAndFetchItAgain() {
RepoImage newRepoFileMap = getNewIsoRepoFile();
repoFileMetaDataDao.addRepoFileMap(newRepoFileMap);
List<RepoImage> listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain(FixturesTool.STORAGE_DOMAIN_NFS_ISO, ImageFileType.ISO);
assertNotNull(listOfRepoFiles);
assertFalse(listOfRepoFiles.isEmpty());
assertEquals(listOfRepoFiles.get(0).getRepoImageId(), newRepoFileMap.getRepoImageId());
assertEquals(listOfRepoFiles.get(0).getLastRefreshed(), newRepoFileMap.getLastRefreshed());
assertEquals(listOfRepoFiles.get(0).getSize(), newRepoFileMap.getSize());
assertEquals(listOfRepoFiles.get(0).getRepoDomainId(), newRepoFileMap.getRepoDomainId());
}
use of org.ovirt.engine.core.common.businessentities.storage.RepoImage in project ovirt-engine by oVirt.
the class BackendOpenStackImageResourceTest method getEntity.
@Override
protected RepoImage getEntity(int index) {
RepoImage image = mock(RepoImage.class);
when(image.getRepoImageId()).thenReturn(GUIDS[index].toString());
when(image.getRepoImageName()).thenReturn(NAMES[index]);
return image;
}
use of org.ovirt.engine.core.common.businessentities.storage.RepoImage in project ovirt-engine by oVirt.
the class BackendOpenStackImagesResourceTest method getEntity.
@Override
protected RepoImage getEntity(int index) {
RepoImage image = mock(RepoImage.class);
when(image.getRepoImageId()).thenReturn(GUIDS[index].toString());
when(image.getRepoImageName()).thenReturn(NAMES[index]);
return image;
}
Aggregations