Search in sources :

Example 6 with VmIcon

use of org.ovirt.engine.core.common.businessentities.VmIcon in project ovirt-engine by oVirt.

the class VmIconDaoTest method testRemoveIfUnusedWithUnused.

@Test
public void testRemoveIfUnusedWithUnused() {
    prepareDao().removeIfUnused(UNUSED_ICON_ID);
    final VmIcon nothing = prepareDao().get(UNUSED_ICON_ID);
    assertNull(nothing);
}
Also used : VmIcon(org.ovirt.engine.core.common.businessentities.VmIcon) Test(org.junit.Test)

Example 7 with VmIcon

use of org.ovirt.engine.core.common.businessentities.VmIcon in project ovirt-engine by oVirt.

the class VmIconDaoTest method testDeleteAllUnusedIcons.

@Test
public void testDeleteAllUnusedIcons() {
    reinitializeDatabase();
    prepareDao().removeAllUnusedIcons();
    final VmIcon unusedIcon = prepareDao().get(UNUSED_ICON_ID);
    assertNull(unusedIcon);
    final VmIcon usedIcon = prepareDao().get(FixturesTool.SMALL_ICON_ID);
    assertNotNull(usedIcon);
    reinitializeDatabase();
}
Also used : VmIcon(org.ovirt.engine.core.common.businessentities.VmIcon) Test(org.junit.Test)

Example 8 with VmIcon

use of org.ovirt.engine.core.common.businessentities.VmIcon in project ovirt-engine by oVirt.

the class VmIconDaoTest method testGetVmIconByDataUrlWithValidUrl.

@Test
public void testGetVmIconByDataUrlWithValidUrl() {
    final List<VmIcon> result = prepareDao().getByDataUrl(OTHER_SMALL_DATAURL);
    assertEquals(1, result.size());
    assertEquals(new VmIcon(FixturesTool.SMALL_ICON_ID, OTHER_SMALL_DATAURL), result.get(0));
}
Also used : VmIcon(org.ovirt.engine.core.common.businessentities.VmIcon) Test(org.junit.Test)

Aggregations

VmIcon (org.ovirt.engine.core.common.businessentities.VmIcon)8 Test (org.junit.Test)4 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Icon (org.ovirt.engine.api.model.Icon)1 Guid (org.ovirt.engine.core.compat.Guid)1