use of org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig in project ovirt-engine by oVirt.
the class HostNicVfsConfigDaoTest method testGetByNicWithInvalidNicId.
/**
* Ensures that a null hostNicVfsConfig is returned.
*/
@Test
public void testGetByNicWithInvalidNicId() {
HostNicVfsConfig result = dao.getByNicId(Guid.Empty);
assertNull(result);
}
use of org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig in project ovirt-engine by oVirt.
the class HostNicVfsConfigDaoTest method commonSave.
private void commonSave(boolean allNetworksAllowed) {
HostNicVfsConfig newConfig = new HostNicVfsConfig();
newConfig.setId(Guid.newGuid());
newConfig.setNicId(FixturesTool.VDS_NETWORK_INTERFACE_WITHOUT_QOS);
newConfig.setAllNetworksAllowed(allNetworksAllowed);
if (!allNetworksAllowed) {
addNetworks(newConfig);
addLabels(newConfig);
}
dao.save(newConfig);
HostNicVfsConfig result = dao.get(newConfig.getId());
assertNotNull(result);
assertHostNicVfsConfigEquals(newConfig, result);
}
use of org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig in project ovirt-engine by oVirt.
the class HostNicVfsConfigDaoTest method testGetByIdNotAllNetworksAllowed.
/**
* Ensures that retrieving a hostNicVfsConfig with {@code allNetworkAllowed=false} by id works as expected.
*/
@Test
public void testGetByIdNotAllNetworksAllowed() {
HostNicVfsConfig result = dao.get(FixturesTool.HOST_NIC_VFS_CONFIG_NOT_ALL_NETWORKS_ALLOWED_1);
assertNotNull(result);
assertEquals(FixturesTool.HOST_NIC_VFS_CONFIG_NOT_ALL_NETWORKS_ALLOWED_1, result.getId());
checkNetworksAndLabels(result, 2, 2);
}
use of org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig in project ovirt-engine by oVirt.
the class HostNicVfsConfigDaoTest method testRemoveLabel.
@Test
public void testRemoveLabel() {
HostNicVfsConfig vfsConfig = dao.get(FixturesTool.HOST_NIC_VFS_CONFIG_NOT_ALL_NETWORKS_ALLOWED_2);
checkLabels(vfsConfig, 3);
dao.removeLabel(FixturesTool.HOST_NIC_VFS_CONFIG_NOT_ALL_NETWORKS_ALLOWED_2, vfsConfig.getNetworkLabels().iterator().next());
vfsConfig = dao.get(FixturesTool.HOST_NIC_VFS_CONFIG_NOT_ALL_NETWORKS_ALLOWED_2);
checkLabels(vfsConfig, 2);
}
use of org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig in project ovirt-engine by oVirt.
the class HostNicVfsConfigDaoTest method commonRemove.
private void commonRemove(Guid id) {
HostNicVfsConfig result = dao.get(id);
assertNotNull(result);
dao.remove(result.getId());
result = dao.get(id);
assertNull(result);
}
Aggregations