use of org.ovirt.engine.core.common.businessentities.network.NetworkCluster in project ovirt-engine by oVirt.
the class AutodefineExternalNetworkCommandTest method createNetworkClusters.
private List<NetworkCluster> createNetworkClusters() {
NetworkCluster networkCluster = new NetworkCluster();
networkCluster.setNetworkId(PHYSICAL_NETWORK_ID);
networkCluster.setClusterId(CLUSTER_ID);
List<NetworkCluster> networkClusters = new ArrayList<>();
networkClusters.add(networkCluster);
return networkClusters;
}
use of org.ovirt.engine.core.common.businessentities.network.NetworkCluster in project ovirt-engine by oVirt.
the class NetworkClusterDaoTest method testUpdate.
/**
* Ensures that updating a cluster works as expected.
*/
@Test
public void testUpdate() {
existingNetworkCluster.setRequired(!existingNetworkCluster.isRequired());
existingNetworkCluster.setDisplay(!existingNetworkCluster.isDisplay());
existingNetworkCluster.setMigration(!existingNetworkCluster.isMigration());
existingNetworkCluster.setManagement(!existingNetworkCluster.isManagement());
existingNetworkCluster.setStatus(invert(existingNetworkCluster.getStatus()));
dao.update(existingNetworkCluster);
NetworkCluster result = dao.get(existingNetworkCluster.getId());
assertNetworkClustersEqual(existingNetworkCluster, result);
}
use of org.ovirt.engine.core.common.businessentities.network.NetworkCluster in project ovirt-engine by oVirt.
the class NetworkClusterDaoTest method testSetDisplay.
@Test
public void testSetDisplay() {
dao.setNetworkExclusivelyAsDisplay(existingNetworkCluster.getClusterId(), existingNetworkCluster.getNetworkId());
List<NetworkCluster> allForCluster = dao.getAllForCluster(existingNetworkCluster.getClusterId());
for (NetworkCluster net : allForCluster) {
if (net.getClusterId().equals(existingNetworkCluster.getClusterId()) && net.getNetworkId().equals(existingNetworkCluster.getNetworkId())) {
assertTrue(net.isDisplay());
} else {
assertFalse(net.isDisplay());
}
}
}
use of org.ovirt.engine.core.common.businessentities.network.NetworkCluster in project ovirt-engine by oVirt.
the class NetworkClusterDaoTest method testSetManagement.
@Test
public void testSetManagement() {
dao.setNetworkExclusivelyAsManagement(existingNetworkCluster.getClusterId(), existingNetworkCluster.getNetworkId());
List<NetworkCluster> allForCluster = dao.getAllForCluster(existingNetworkCluster.getClusterId());
for (NetworkCluster net : allForCluster) {
if (net.getId().equals(existingNetworkCluster.getId())) {
assertTrue(net.isManagement());
} else {
assertFalse(net.isManagement());
}
}
}
use of org.ovirt.engine.core.common.businessentities.network.NetworkCluster in project ovirt-engine by oVirt.
the class NetworkClusterDaoTest method createNewNetworkCluster.
private void createNewNetworkCluster() {
newNetworkCluster = new NetworkCluster();
newNetworkCluster.setNetworkId(networkNoCluster.getId());
newNetworkCluster.setClusterId(freeCluster.getId());
newNetworkCluster.setStatus(NetworkStatus.OPERATIONAL);
newNetworkCluster.setManagement(true);
newNetworkCluster.setRequired(true);
newNetworkCluster.setDisplay(true);
newNetworkCluster.setMigration(true);
}
Aggregations