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());
}
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));
}
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));
}
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));
}
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;
}
Aggregations