Package com.cloud.offerings

Examples of com.cloud.offerings.NetworkOfferingVO


        ComponentContext.initComponentsLifeCycle();

        ConfigurationVO configVO = new ConfigurationVO("200", "200", "200", "200", "200", "200");
        Mockito.when(configDao.findByName(Matchers.anyString())).thenReturn(configVO);

        Mockito.when(offDao.persist(Matchers.any(NetworkOfferingVO.class))).thenReturn(new NetworkOfferingVO());
        Mockito.when(offDao.persist(Matchers.any(NetworkOfferingVO.class), Matchers.anyMap())).thenReturn(new NetworkOfferingVO());
        Mockito.when(mapDao.persist(Matchers.any(NetworkOfferingServiceMapVO.class))).thenReturn(new NetworkOfferingServiceMapVO());
        Mockito.when(accountMgr.getSystemUser()).thenReturn(new UserVO(1));
        Mockito.when(accountMgr.getSystemAccount()).thenReturn(new AccountVO(2));

        CallContext.register(accountMgr.getSystemUser(), accountMgr.getSystemAccount());
View Full Code Here


    }

    //Test Shared network offerings
    @Test
    public void createSharedNtwkOffWithVlan() {
        NetworkOfferingVO off =
            configMgr.createNetworkOffering("shared", "shared", TrafficType.Guest, null, true, Availability.Optional, 200, null, false, Network.GuestType.Shared, false,
                null, false, null, true, false, null, false, null, true);
        assertNotNull("Shared network offering with specifyVlan=true failed to create ", off);
    }
View Full Code Here

    }

    @Test
    public void createSharedNtwkOffWithNoVlan() {
        try {
            NetworkOfferingVO off =
                configMgr.createNetworkOffering("shared", "shared", TrafficType.Guest, null, false, Availability.Optional, 200, null, false, Network.GuestType.Shared,
                    false, null, false, null, true, false, null, false, null, true);
            assertNull("Shared network offering with specifyVlan=false was created", off);
        } catch (InvalidParameterValueException ex) {
        }
View Full Code Here

        }
    }

    @Test
    public void createSharedNtwkOffWithSpecifyIpRanges() {
        NetworkOfferingVO off =
            configMgr.createNetworkOffering("shared", "shared", TrafficType.Guest, null, true, Availability.Optional, 200, null, false, Network.GuestType.Shared, false,
                null, false, null, true, false, null, false, null, true);

        assertNotNull("Shared network offering with specifyIpRanges=true failed to create ", off);
    }
View Full Code Here

    }

    @Test
    public void createSharedNtwkOffWithoutSpecifyIpRanges() {
        try {
            NetworkOfferingVO off =
                configMgr.createNetworkOffering("shared", "shared", TrafficType.Guest, null, true, Availability.Optional, 200, null, false, Network.GuestType.Shared,
                    false, null, false, null, false, false, null, false, null, true);
            assertNull("Shared network offering with specifyIpRanges=false was created", off);
        } catch (InvalidParameterValueException ex) {
        }
View Full Code Here

    public void createIsolatedNtwkOffWithNoVlan() {
        Map<Service, Set<Provider>> serviceProviderMap = new HashMap<Network.Service, Set<Network.Provider>>();
        Set<Network.Provider> vrProvider = new HashSet<Network.Provider>();
        vrProvider.add(Provider.VirtualRouter);
        serviceProviderMap.put(Network.Service.SourceNat, vrProvider);
        NetworkOfferingVO off =
            configMgr.createNetworkOffering("isolated", "isolated", TrafficType.Guest, null, false, Availability.Optional, 200, serviceProviderMap, false,
                Network.GuestType.Isolated, false, null, false, null, false, false, null, false, null, true);

        assertNotNull("Isolated network offering with specifyIpRanges=false failed to create ", off);
    }
View Full Code Here

    public void createIsolatedNtwkOffWithVlan() {
        Map<Service, Set<Provider>> serviceProviderMap = new HashMap<Network.Service, Set<Network.Provider>>();
        Set<Network.Provider> vrProvider = new HashSet<Network.Provider>();
        vrProvider.add(Provider.VirtualRouter);
        serviceProviderMap.put(Network.Service.SourceNat, vrProvider);
        NetworkOfferingVO off =
            configMgr.createNetworkOffering("isolated", "isolated", TrafficType.Guest, null, true, Availability.Optional, 200, serviceProviderMap, false,
                Network.GuestType.Isolated, false, null, false, null, false, false, null, false, null, true);
        assertNotNull("Isolated network offering with specifyVlan=true wasn't created", off);

    }
View Full Code Here

        try {
            Map<Service, Set<Provider>> serviceProviderMap = new HashMap<Network.Service, Set<Network.Provider>>();
            Set<Network.Provider> vrProvider = new HashSet<Network.Provider>();
            vrProvider.add(Provider.VirtualRouter);
            serviceProviderMap.put(Network.Service.SourceNat, vrProvider);
            NetworkOfferingVO off =
                configMgr.createNetworkOffering("isolated", "isolated", TrafficType.Guest, null, false, Availability.Optional, 200, serviceProviderMap, false,
                    Network.GuestType.Isolated, false, null, false, null, true, false, null, false, null, true);
            assertNull("Isolated network offering with specifyIpRanges=true and source nat service enabled, was created", off);
        } catch (InvalidParameterValueException ex) {
        }
View Full Code Here

    @Test
    public void createIsolatedNtwkOffWithSpecifyIpRangesAndNoSourceNat() {

        Map<Service, Set<Provider>> serviceProviderMap = new HashMap<Network.Service, Set<Network.Provider>>();
        Set<Network.Provider> vrProvider = new HashSet<Network.Provider>();
        NetworkOfferingVO off =
            configMgr.createNetworkOffering("isolated", "isolated", TrafficType.Guest, null, false, Availability.Optional, 200, serviceProviderMap, false,
                Network.GuestType.Isolated, false, null, false, null, true, false, null, false, null, true);
        assertNotNull("Isolated network offering with specifyIpRanges=true and with no sourceNatService, failed to create", off);

    }
View Full Code Here

        serviceProviderMap.put(Network.Service.Dns, vrProvider);
        serviceProviderMap.put(Network.Service.Lb, vrProvider);
        serviceProviderMap.put(Network.Service.SourceNat, vrProvider);
        serviceProviderMap.put(Network.Service.Gateway, vrProvider);
        serviceProviderMap.put(Network.Service.Lb, vrProvider);
        NetworkOfferingVO off =
            configMgr.createNetworkOffering("isolated", "isolated", TrafficType.Guest, null, true, Availability.Optional, 200, serviceProviderMap, false,
                Network.GuestType.Isolated, false, null, false, null, false, false, null, false, null, true);
        // System.out.println("Creating Vpc Network Offering");
        assertNotNull("Vpc Isolated network offering with Vpc provider ", off);
    }
View Full Code Here

TOP

Related Classes of com.cloud.offerings.NetworkOfferingVO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.