Search in sources :

Example 6 with NetworkCluster

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

the class JsonImmutableSerializeDeserializeTest method serializeCollectionsSingleton.

@Test
public void serializeCollectionsSingleton() {
    ManageNetworkClustersParameters params = new ManageNetworkClustersParameters(Collections.singleton(new NetworkCluster(Guid.createGuidFromString("f455686a-79cc-11e6-8c65-54ee755c6cc7"), Guid.createGuidFromString("f970c5f6-79cc-11e6-bc8f-54ee755c6cc7"), NetworkStatus.NON_OPERATIONAL, false, false, false, false, false, false)));
    JsonObjectSerializer serializer = new JsonObjectSerializer();
    String json = serializer.serialize(params);
    assertTrue(json.length() > 0);
    ManageNetworkClustersParameters deserializedParams = new JsonObjectDeserializer().deserialize(json, ManageNetworkClustersParameters.class);
    assertEquals(params.getExecutionReason(), deserializedParams.getExecutionReason());
}
Also used : ManageNetworkClustersParameters(org.ovirt.engine.core.common.action.ManageNetworkClustersParameters) NetworkCluster(org.ovirt.engine.core.common.businessentities.network.NetworkCluster) Test(org.junit.Test)

Example 7 with NetworkCluster

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

the class NetworkUtilsTest method isRoleNetworkMigration.

@Test
public void isRoleNetworkMigration() {
    NetworkCluster networkCluster = createNetworkCluster(false, true, false);
    assertTrue(NetworkUtils.isRoleNetwork(networkCluster));
}
Also used : NetworkCluster(org.ovirt.engine.core.common.businessentities.network.NetworkCluster) Test(org.junit.Test)

Example 8 with NetworkCluster

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

the class NetworkUtilsTest method isRoleNetworkGluster.

@Test
public void isRoleNetworkGluster() {
    NetworkCluster networkCluster = createNetworkCluster(false, false, true);
    assertTrue(NetworkUtils.isRoleNetwork(networkCluster));
}
Also used : NetworkCluster(org.ovirt.engine.core.common.businessentities.network.NetworkCluster) Test(org.junit.Test)

Example 9 with NetworkCluster

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

the class NetworkUtilsTest method isRoleNetworkDisplay.

@Test
public void isRoleNetworkDisplay() {
    NetworkCluster networkCluster = createNetworkCluster(true, false, false);
    assertTrue(NetworkUtils.isRoleNetwork(networkCluster));
}
Also used : NetworkCluster(org.ovirt.engine.core.common.businessentities.network.NetworkCluster) Test(org.junit.Test)

Example 10 with NetworkCluster

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

the class Cloner method cloneNetworkCluster.

private static NetworkCluster cloneNetworkCluster(NetworkCluster instance) {
    NetworkCluster obj = new NetworkCluster();
    obj.setId(instance.getId());
    obj.setStatus(instance.getStatus());
    obj.setDisplay(instance.isDisplay());
    obj.setRequired(instance.isRequired());
    obj.setMigration(instance.isMigration());
    obj.setManagement(instance.isManagement());
    obj.setDefaultRoute(instance.isDefaultRoute());
    obj.setGluster(instance.isGluster());
    return obj;
}
Also used : NetworkCluster(org.ovirt.engine.core.common.businessentities.network.NetworkCluster)

Aggregations

NetworkCluster (org.ovirt.engine.core.common.businessentities.network.NetworkCluster)62 Test (org.junit.Test)19 Network (org.ovirt.engine.core.common.businessentities.network.Network)17 ArrayList (java.util.ArrayList)15 NetworkClusterId (org.ovirt.engine.core.common.businessentities.network.NetworkClusterId)7 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)6 VdsNetworkInterface (org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface)6 ManageNetworkClustersParameters (org.ovirt.engine.core.common.action.ManageNetworkClustersParameters)5 List (java.util.List)4 Map (java.util.Map)4 PairQueryable (org.ovirt.engine.core.common.utils.PairQueryable)4 Guid (org.ovirt.engine.core.compat.Guid)4 HashMap (java.util.HashMap)3 LinkedHashMap (java.util.LinkedHashMap)3 ValidationResult (org.ovirt.engine.core.bll.ValidationResult)3 NetworkAttachment (org.ovirt.engine.core.common.businessentities.network.NetworkAttachment)3 SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)2 Collection (java.util.Collection)2 Collections (java.util.Collections)2 HashSet (java.util.HashSet)2