use of org.ovirt.engine.core.common.businessentities.network.NetworkCluster in project ovirt-engine by oVirt.
the class NetworkClusterDaoTest method testSetGluster.
@Test
public void testSetGluster() {
dao.setNetworkExclusivelyAsGluster(existingNetworkCluster.getClusterId(), existingNetworkCluster.getNetworkId());
List<NetworkCluster> allForCluster = dao.getAllForCluster(existingNetworkCluster.getClusterId());
for (NetworkCluster net : allForCluster) {
if (net.getId().equals(existingNetworkCluster.getId())) {
assertTrue(net.isGluster());
} else {
assertFalse(net.isGluster());
}
}
}
use of org.ovirt.engine.core.common.businessentities.network.NetworkCluster in project ovirt-engine by oVirt.
the class NetworkClusterDaoTest method testSetMigration.
@Test
public void testSetMigration() {
dao.setNetworkExclusivelyAsMigration(existingNetworkCluster.getClusterId(), existingNetworkCluster.getNetworkId());
List<NetworkCluster> allForCluster = dao.getAllForCluster(existingNetworkCluster.getClusterId());
for (NetworkCluster net : allForCluster) {
if (net.getId().equals(existingNetworkCluster.getId())) {
assertTrue(net.isMigration());
} else {
assertFalse(net.isMigration());
}
}
}
use of org.ovirt.engine.core.common.businessentities.network.NetworkCluster in project ovirt-engine by oVirt.
the class NetworkClusterDaoTest method testSetGlusterAsNull.
@Test
public void testSetGlusterAsNull() {
dao.setNetworkExclusivelyAsGluster(existingNetworkCluster.getClusterId(), null);
List<NetworkCluster> allForCluster = dao.getAllForCluster(existingNetworkCluster.getClusterId());
for (NetworkCluster net : allForCluster) {
assertFalse(net.isGluster());
}
}
use of org.ovirt.engine.core.common.businessentities.network.NetworkCluster in project ovirt-engine by oVirt.
the class NetworkClusterDaoTest method testGetAllForCluster.
/**
* Ensures that retrieving all for a specific cluster works as expected.
*/
@Test
public void testGetAllForCluster() {
List<NetworkCluster> result = dao.getAllForCluster(cluster.getId());
assertNotNull(result);
assertFalse(result.isEmpty());
for (NetworkCluster thiscluster : result) {
assertEquals(cluster.getId(), thiscluster.getClusterId());
}
}
use of org.ovirt.engine.core.common.businessentities.network.NetworkCluster in project ovirt-engine by oVirt.
the class NetworkDaoTest method testSave.
/**
* Ensures that saving a network works as expected.
*/
@Test
public void testSave() {
List<NetworkCluster> clustersFromDB = dbFacade.getNetworkClusterDao().getAllForCluster(FixturesTool.CLUSTER);
DnsResolverConfiguration dnsResolverConfiguration = dbFacade.getDnsResolverConfigurationDao().get(FixturesTool.EXISTING_DNS_RESOLVER_CONFIGURATION);
NetworkCluster clusterFromDB = clustersFromDB.get(0);
assertNotNull(clusterFromDB);
newNet.setCluster(clusterFromDB);
newNet.setId(Guid.newGuid());
newNet.setDnsResolverConfiguration(dnsResolverConfiguration);
dao.save(newNet);
Network result = dao.getByNameAndDataCenter(newNet.getName(), FixturesTool.DATA_CENTER);
assertNotNull(result);
assertEquals(newNet, result);
}
Aggregations