Search in sources :

Example 61 with Service

use of com.cloud.legacymodel.network.Network.Service in project cosmic by MissionCriticalCloud.

the class VpcManagerImplTest method prepareVpcManagerForCheckingCapabilityPerService.

protected Set<Network.Provider> prepareVpcManagerForCheckingCapabilityPerService(final Service service, final Map<Capability, String> capabilities) {
    final Set<Network.Provider> providers = new HashSet<>();
    providers.add(Provider.VPCVirtualRouter);
    final NetworkElement nwElement1 = mock(NetworkElement.class);
    this.manager._ntwkModel = mock(NetworkModel.class);
    when(this.manager._ntwkModel.getElementImplementingProvider(Provider.VPCVirtualRouter.getName())).thenReturn(nwElement1);
    final Map<Service, Map<Network.Capability, String>> capabilitiesService1 = new HashMap<>();
    when(nwElement1.getCapabilities()).thenReturn(capabilitiesService1);
    capabilitiesService1.put(service, capabilities);
    return providers;
}
Also used : NetworkElement(com.cloud.network.element.NetworkElement) HashMap(java.util.HashMap) Network(com.cloud.legacymodel.network.Network) NetworkModel(com.cloud.network.NetworkModel) Service(com.cloud.legacymodel.network.Network.Service) HashMap(java.util.HashMap) Map(java.util.Map) Provider(com.cloud.legacymodel.network.Network.Provider) HashSet(java.util.HashSet)

Example 62 with Service

use of com.cloud.legacymodel.network.Network.Service in project cosmic by MissionCriticalCloud.

the class CreateNetworkOfferingTest method createIsolatedNtwkOffWithSpecifyIpRangesAndNoSourceNat.

@Test
public void createIsolatedNtwkOffWithSpecifyIpRangesAndNoSourceNat() {
    final Map<Service, Set<Provider>> serviceProviderMap = new HashMap<>();
    final Set<Network.Provider> vrProvider = new HashSet<>();
    final NetworkOfferingVO off = configMgr.createNetworkOffering("isolated", "isolated", TrafficType.Guest, null, false, Availability.Optional, 200, serviceProviderMap, false, GuestType.Isolated, false, null, null, false, null, true, false, null, false, null, true);
    assertNotNull("Isolated network offering with specifyIpRanges=true and with no sourceNatService, failed to create", off);
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) HashMap(java.util.HashMap) Service(com.cloud.legacymodel.network.Network.Service) NetworkOfferingVO(com.cloud.offerings.NetworkOfferingVO) Provider(com.cloud.legacymodel.network.Network.Provider) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

Service (com.cloud.legacymodel.network.Network.Service)62 HashMap (java.util.HashMap)31 NetworkOrchestrationService (com.cloud.engine.orchestration.service.NetworkOrchestrationService)29 Provider (com.cloud.legacymodel.network.Network.Provider)29 ArrayList (java.util.ArrayList)29 HashSet (java.util.HashSet)29 ResourceLimitService (com.cloud.user.ResourceLimitService)27 Set (java.util.Set)24 InvalidParameterValueException (com.cloud.legacymodel.exceptions.InvalidParameterValueException)18 Map (java.util.Map)15 Network (com.cloud.legacymodel.network.Network)14 NetworkElement (com.cloud.network.element.NetworkElement)14 NetworkService (com.cloud.network.NetworkService)13 SortedSet (java.util.SortedSet)12 Capability (com.cloud.legacymodel.network.Network.Capability)11 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)11 Test (org.junit.Test)11 UserDataServiceProvider (com.cloud.network.element.UserDataServiceProvider)10 ExecutorService (java.util.concurrent.ExecutorService)10 NetworkOfferingVO (com.cloud.offerings.NetworkOfferingVO)9