cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prachida...@apache.org
Subject git commit: Fixing VPC unit test to use Spring
Date Fri, 25 Jan 2013 07:18:18 GMT
Updated Branches:
  refs/heads/javelin f56b96ad1 -> df5c4c304


Fixing VPC unit test to use Spring


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/df5c4c30
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/df5c4c30
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/df5c4c30

Branch: refs/heads/javelin
Commit: df5c4c3048b30cd3b9de5ed556d411047a77f044
Parents: f56b96a
Author: Prachi Damle <prachi@cloud.com>
Authored: Thu Jan 24 23:02:27 2013 -0800
Committer: Prachi Damle <prachi@cloud.com>
Committed: Thu Jan 24 23:05:31 2013 -0800

----------------------------------------------------------------------
 .../src/com/cloud/network/NetworkManagerImpl.java  |    3 +-
 .../cloud/vpc/MockConfigurationManagerImpl.java    |    3 +-
 .../test/com/cloud/vpc/MockNetworkModelImpl.java   |  825 +++++++++++++++
 server/test/com/cloud/vpc/VpcApiUnitTest.java      |   13 +-
 .../test/com/cloud/vpc/VpcTestConfiguration.java   |  231 ++++
 .../cloud/vpc/dao/MockNetworkOfferingDaoImpl.java  |    3 +-
 .../dao/MockNetworkOfferingServiceMapDaoImpl.java  |    5 +
 server/test/resources/VpcTestContext.xml           |   76 ++
 8 files changed, 1153 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/df5c4c30/server/src/com/cloud/network/NetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java
index 4fa639a..bc2c2e6 100755
--- a/server/src/com/cloud/network/NetworkManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkManagerImpl.java
@@ -239,8 +239,7 @@ public class NetworkManagerImpl implements NetworkManager, Manager, Listener {
     @Inject 
     List<NetworkGuru> _networkGurus;
 
-    @Inject 
-    List<NetworkElement> _networkElements;
+    @Inject  protected List<NetworkElement> _networkElements;
 
     @Inject NetworkDomainDao _networkDomainDao;
     @Inject List<IpDeployer> _ipDeployers;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/df5c4c30/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java b/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
index 63470e8..8b16c3d 100644
--- a/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
@@ -73,6 +73,7 @@ import com.cloud.offering.NetworkOffering.Availability;
 import com.cloud.offering.ServiceOffering;
 import com.cloud.offerings.NetworkOfferingVO;
 import com.cloud.offerings.dao.NetworkOfferingDao;
+import com.cloud.offerings.dao.NetworkOfferingDaoImpl;
 import com.cloud.org.Grouping.AllocationState;
 import com.cloud.service.ServiceOfferingVO;
 import com.cloud.storage.DiskOfferingVO;
@@ -84,7 +85,7 @@ import com.cloud.vm.VirtualMachine.Type;
 @Local(value = { ConfigurationManager.class, ConfigurationService.class })
 public class MockConfigurationManagerImpl implements ConfigurationManager, ConfigurationService, Manager{
     @Inject
-    NetworkOfferingDao _ntwkOffDao;
+    NetworkOfferingDaoImpl _ntwkOffDao;
 
     /* (non-Javadoc)
      * @see com.cloud.configuration.ConfigurationService#updateConfiguration(org.apache.cloudstack.api.commands.UpdateCfgCmd)

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/df5c4c30/server/test/com/cloud/vpc/MockNetworkModelImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockNetworkModelImpl.java b/server/test/com/cloud/vpc/MockNetworkModelImpl.java
new file mode 100644
index 0000000..ddffa01
--- /dev/null
+++ b/server/test/com/cloud/vpc/MockNetworkModelImpl.java
@@ -0,0 +1,825 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package com.cloud.vpc;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+
+import com.cloud.dc.Vlan;
+import com.cloud.exception.InsufficientAddressCapacityException;
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.network.IpAddress;
+import com.cloud.network.Network;
+import com.cloud.network.Network.Capability;
+import com.cloud.network.Network.GuestType;
+import com.cloud.network.Network.Provider;
+import com.cloud.network.Network.Service;
+import com.cloud.network.NetworkModel;
+import com.cloud.network.Networks.TrafficType;
+import com.cloud.network.PhysicalNetwork;
+import com.cloud.network.PhysicalNetworkSetupInfo;
+import com.cloud.network.PublicIpAddress;
+import com.cloud.network.addr.PublicIp;
+import com.cloud.network.dao.IPAddressVO;
+import com.cloud.network.dao.NetworkVO;
+import com.cloud.network.element.NetworkElement;
+import com.cloud.network.element.UserDataServiceProvider;
+import com.cloud.network.rules.FirewallRule;
+import com.cloud.offering.NetworkOffering;
+import com.cloud.offerings.NetworkOfferingVO;
+import com.cloud.offerings.dao.NetworkOfferingServiceMapDao;
+import com.cloud.user.Account;
+import com.cloud.utils.component.Manager;
+import com.cloud.vm.Nic;
+import com.cloud.vm.NicProfile;
+import com.cloud.vm.VirtualMachine;
+
+@Local(value = {NetworkModel.class})
+public class MockNetworkModelImpl implements NetworkModel, Manager {
+
+    @Inject
+    NetworkOfferingServiceMapDao _ntwkOfferingSrvcDao;
+    /* (non-Javadoc)
+     * @see com.cloud.utils.component.Manager#configure(java.lang.String, java.util.Map)
+     */
+    @Override
+    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
+        return true;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.utils.component.Manager#start()
+     */
+    @Override
+    public boolean start() {
+        return true;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.utils.component.Manager#stop()
+     */
+    @Override
+    public boolean stop() {
+        return true;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.utils.component.Manager#getName()
+     */
+    @Override
+    public String getName() {
+        return "MockNetworkModelImpl";
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#listPublicIpsAssignedToGuestNtwk(long, long, java.lang.Boolean)
+     */
+    @Override
+    public List<IPAddressVO> listPublicIpsAssignedToGuestNtwk(long accountId, long associatedNetworkId,
+            Boolean sourceNat) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getSystemAccountNetworkOfferings(java.lang.String[])
+     */
+    @Override
+    public List<NetworkOfferingVO> getSystemAccountNetworkOfferings(String... offeringNames) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getNics(long)
+     */
+    @Override
+    public List<? extends Nic> getNics(long vmId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getNextAvailableMacAddressInNetwork(long)
+     */
+    @Override
+    public String getNextAvailableMacAddressInNetwork(long networkConfigurationId)
+            throws InsufficientAddressCapacityException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getPublicIpAddress(long)
+     */
+    @Override
+    public PublicIpAddress getPublicIpAddress(long ipAddressId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#listPodVlans(long)
+     */
+    @Override
+    public List<? extends Vlan> listPodVlans(long podId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#listNetworksUsedByVm(long, boolean)
+     */
+    @Override
+    public List<NetworkVO> listNetworksUsedByVm(long vmId, boolean isSystem) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getNicInNetwork(long, long)
+     */
+    @Override
+    public Nic getNicInNetwork(long vmId, long networkId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getNicsForTraffic(long, com.cloud.network.Networks.TrafficType)
+     */
+    @Override
+    public List<? extends Nic> getNicsForTraffic(long vmId, TrafficType type) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getDefaultNetworkForVm(long)
+     */
+    @Override
+    public Network getDefaultNetworkForVm(long vmId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getDefaultNic(long)
+     */
+    @Override
+    public Nic getDefaultNic(long vmId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getUserDataUpdateProvider(com.cloud.network.Network)
+     */
+    @Override
+    public UserDataServiceProvider getUserDataUpdateProvider(Network network) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#networkIsConfiguredForExternalNetworking(long, long)
+     */
+    @Override
+    public boolean networkIsConfiguredForExternalNetworking(long zoneId, long networkId) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getNetworkServiceCapabilities(long, com.cloud.network.Network.Service)
+     */
+    @Override
+    public Map<Capability, String> getNetworkServiceCapabilities(long networkId, Service service) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#areServicesSupportedByNetworkOffering(long, com.cloud.network.Network.Service[])
+     */
+    @Override
+    public boolean areServicesSupportedByNetworkOffering(long networkOfferingId, Service... services) {
+        return (_ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(networkOfferingId, services));
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getNetworkWithSecurityGroupEnabled(java.lang.Long)
+     */
+    @Override
+    public NetworkVO getNetworkWithSecurityGroupEnabled(Long zoneId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getIpOfNetworkElementInVirtualNetwork(long, long)
+     */
+    @Override
+    public String getIpOfNetworkElementInVirtualNetwork(long accountId, long dataCenterId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#listNetworksForAccount(long, long, com.cloud.network.Network.GuestType)
+     */
+    @Override
+    public List<NetworkVO> listNetworksForAccount(long accountId, long zoneId, GuestType type) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#listAllNetworksInAllZonesByType(com.cloud.network.Network.GuestType)
+     */
+    @Override
+    public List<NetworkVO> listAllNetworksInAllZonesByType(GuestType type) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getGlobalGuestDomainSuffix()
+     */
+    @Override
+    public String getGlobalGuestDomainSuffix() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getStartIpAddress(long)
+     */
+    @Override
+    public String getStartIpAddress(long networkId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getIpInNetwork(long, long)
+     */
+    @Override
+    public String getIpInNetwork(long vmId, long networkId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getIpInNetworkIncludingRemoved(long, long)
+     */
+    @Override
+    public String getIpInNetworkIncludingRemoved(long vmId, long networkId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getPodIdForVlan(long)
+     */
+    @Override
+    public Long getPodIdForVlan(long vlanDbId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#listNetworkOfferingsForUpgrade(long)
+     */
+    @Override
+    public List<Long> listNetworkOfferingsForUpgrade(long networkId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#isSecurityGroupSupportedInNetwork(com.cloud.network.Network)
+     */
+    @Override
+    public boolean isSecurityGroupSupportedInNetwork(Network network) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#isProviderSupportServiceInNetwork(long, com.cloud.network.Network.Service, com.cloud.network.Network.Provider)
+     */
+    @Override
+    public boolean isProviderSupportServiceInNetwork(long networkId, Service service, Provider provider) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#isProviderEnabledInPhysicalNetwork(long, java.lang.String)
+     */
+    @Override
+    public boolean isProviderEnabledInPhysicalNetwork(long physicalNetowrkId, String providerName) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getNetworkTag(com.cloud.hypervisor.Hypervisor.HypervisorType, com.cloud.network.Network)
+     */
+    @Override
+    public String getNetworkTag(HypervisorType hType, Network network) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getElementServices(com.cloud.network.Network.Provider)
+     */
+    @Override
+    public List<Service> getElementServices(Provider provider) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#canElementEnableIndividualServices(com.cloud.network.Network.Provider)
+     */
+    @Override
+    public boolean canElementEnableIndividualServices(Provider provider) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#areServicesSupportedInNetwork(long, com.cloud.network.Network.Service[])
+     */
+    @Override
+    public boolean areServicesSupportedInNetwork(long networkId, Service... services) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#isNetworkSystem(com.cloud.network.Network)
+     */
+    @Override
+    public boolean isNetworkSystem(Network network) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getNetworkOfferingServiceCapabilities(com.cloud.offering.NetworkOffering, com.cloud.network.Network.Service)
+     */
+    @Override
+    public Map<Capability, String> getNetworkOfferingServiceCapabilities(NetworkOffering offering, Service service) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getPhysicalNetworkId(com.cloud.network.Network)
+     */
+    @Override
+    public Long getPhysicalNetworkId(Network network) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getAllowSubdomainAccessGlobal()
+     */
+    @Override
+    public boolean getAllowSubdomainAccessGlobal() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#isProviderForNetwork(com.cloud.network.Network.Provider, long)
+     */
+    @Override
+    public boolean isProviderForNetwork(Provider provider, long networkId) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#isProviderForNetworkOffering(com.cloud.network.Network.Provider, long)
+     */
+    @Override
+    public boolean isProviderForNetworkOffering(Provider provider, long networkOfferingId) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#canProviderSupportServices(java.util.Map)
+     */
+    @Override
+    public void canProviderSupportServices(Map<Provider, Set<Service>> providersMap) {
+        // TODO Auto-generated method stub
+
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getPhysicalNetworkInfo(long, com.cloud.hypervisor.Hypervisor.HypervisorType)
+     */
+    @Override
+    public List<PhysicalNetworkSetupInfo> getPhysicalNetworkInfo(long dcId, HypervisorType hypervisorType) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#canAddDefaultSecurityGroup()
+     */
+    @Override
+    public boolean canAddDefaultSecurityGroup() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#listNetworkOfferingServices(long)
+     */
+    @Override
+    public List<Service> listNetworkOfferingServices(long networkOfferingId) {
+        if (networkOfferingId == 2) {
+            return new ArrayList<Service>();
+        }
+
+        List<Service> services = new ArrayList<Service>();
+        services.add(Service.SourceNat);
+        return services;
+
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#areServicesEnabledInZone(long, com.cloud.offering.NetworkOffering, java.util.List)
+     */
+    @Override
+    public boolean areServicesEnabledInZone(long zoneId, NetworkOffering offering, List<Service> services) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#checkIpForService(com.cloud.network.IPAddressVO, com.cloud.network.Network.Service, java.lang.Long)
+     */
+    @Override
+    public boolean checkIpForService(IpAddress ip, Service service, Long networkId) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#checkCapabilityForProvider(java.util.Set, com.cloud.network.Network.Service, com.cloud.network.Network.Capability, java.lang.String)
+     */
+    @Override
+    public void checkCapabilityForProvider(Set<Provider> providers, Service service, Capability cap, String capValue) {
+        // TODO Auto-generated method stub
+
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getDefaultUniqueProviderForService(java.lang.String)
+     */
+    @Override
+    public Provider getDefaultUniqueProviderForService(String serviceName) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#checkNetworkPermissions(com.cloud.user.Account, com.cloud.network.Network)
+     */
+    @Override
+    public void checkNetworkPermissions(Account owner, Network network) {
+        // TODO Auto-generated method stub
+
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getDefaultManagementTrafficLabel(long, com.cloud.hypervisor.Hypervisor.HypervisorType)
+     */
+    @Override
+    public String getDefaultManagementTrafficLabel(long zoneId, HypervisorType hypervisorType) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getDefaultStorageTrafficLabel(long, com.cloud.hypervisor.Hypervisor.HypervisorType)
+     */
+    @Override
+    public String getDefaultStorageTrafficLabel(long zoneId, HypervisorType hypervisorType) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getDefaultPublicTrafficLabel(long, com.cloud.hypervisor.Hypervisor.HypervisorType)
+     */
+    @Override
+    public String getDefaultPublicTrafficLabel(long dcId, HypervisorType vmware) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getDefaultGuestTrafficLabel(long, com.cloud.hypervisor.Hypervisor.HypervisorType)
+     */
+    @Override
+    public String getDefaultGuestTrafficLabel(long dcId, HypervisorType vmware) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getElementImplementingProvider(java.lang.String)
+     */
+    @Override
+    public NetworkElement getElementImplementingProvider(String providerName) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getAccountNetworkDomain(long, long)
+     */
+    @Override
+    public String getAccountNetworkDomain(long accountId, long zoneId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getDefaultNetworkDomain()
+     */
+    @Override
+    public String getDefaultNetworkDomain() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getNtwkOffDistinctProviders(long)
+     */
+    @Override
+    public List<Provider> getNtwkOffDistinctProviders(long ntwkOffId) {
+        return new ArrayList<Provider>();
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#listPublicIpsAssignedToAccount(long, long, java.lang.Boolean)
+     */
+    @Override
+    public List<IPAddressVO> listPublicIpsAssignedToAccount(long accountId, long dcId, Boolean sourceNat) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getPhysicalNtwksSupportingTrafficType(long, com.cloud.network.Networks.TrafficType)
+     */
+    @Override
+    public List<? extends PhysicalNetwork> getPhysicalNtwksSupportingTrafficType(long zoneId, TrafficType trafficType) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#isPrivateGateway(com.cloud.vm.Nic)
+     */
+    @Override
+    public boolean isPrivateGateway(Nic guestNic) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getNetworkCapabilities(long)
+     */
+    @Override
+    public Map<Service, Map<Capability, String>> getNetworkCapabilities(long networkId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getSystemNetworkByZoneAndTrafficType(long, com.cloud.network.Networks.TrafficType)
+     */
+    @Override
+    public Network getSystemNetworkByZoneAndTrafficType(long zoneId, TrafficType trafficType) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getDedicatedNetworkDomain(long)
+     */
+    @Override
+    public Long getDedicatedNetworkDomain(long networkId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getNetworkOfferingServiceProvidersMap(long)
+     */
+    @Override
+    public Map<Service, Set<Provider>> getNetworkOfferingServiceProvidersMap(long networkOfferingId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#listSupportedNetworkServiceProviders(java.lang.String)
+     */
+    @Override
+    public List<? extends Provider> listSupportedNetworkServiceProviders(String serviceName) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#listNetworksByVpc(long)
+     */
+    @Override
+    public List<? extends Network> listNetworksByVpc(long vpcId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#canUseForDeploy(com.cloud.network.Network)
+     */
+    @Override
+    public boolean canUseForDeploy(Network network) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getExclusiveGuestNetwork(long)
+     */
+    @Override
+    public Network getExclusiveGuestNetwork(long zoneId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#findPhysicalNetworkId(long, java.lang.String, com.cloud.network.Networks.TrafficType)
+     */
+    @Override
+    public long findPhysicalNetworkId(long zoneId, String tag, TrafficType trafficType) {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getNetworkRate(long, java.lang.Long)
+     */
+    @Override
+    public Integer getNetworkRate(long networkId, Long vmId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#isVmPartOfNetwork(long, long)
+     */
+    @Override
+    public boolean isVmPartOfNetwork(long vmId, long ntwkId) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getDefaultPhysicalNetworkByZoneAndTrafficType(long, com.cloud.network.Networks.TrafficType)
+     */
+    @Override
+    public PhysicalNetwork getDefaultPhysicalNetworkByZoneAndTrafficType(long zoneId, TrafficType trafficType) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getNetwork(long)
+     */
+    @Override
+    public Network getNetwork(long networkId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getIp(long)
+     */
+    @Override
+    public IpAddress getIp(long sourceIpAddressId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#isNetworkAvailableInDomain(long, long)
+     */
+    @Override
+    public boolean isNetworkAvailableInDomain(long networkId, long domainId) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getNicProfile(com.cloud.vm.VirtualMachine, long, java.lang.String)
+     */
+    @Override
+    public NicProfile getNicProfile(VirtualMachine vm, long networkId, String broadcastUri) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getAvailableIps(com.cloud.network.Network, java.lang.String)
+     */
+    @Override
+    public Set<Long> getAvailableIps(Network network, String requestedIp) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getDomainNetworkDomain(long, long)
+     */
+    @Override
+    public String getDomainNetworkDomain(long domainId, long zoneId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getIpToServices(java.util.List, boolean, boolean)
+     */
+    @Override
+    public Map<PublicIpAddress, Set<Service>> getIpToServices(List<? extends PublicIpAddress> publicIps, boolean rulesRevoked,
+            boolean includingFirewall) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getProviderToIpList(com.cloud.network.Network, java.util.Map)
+     */
+    @Override
+    public Map<Provider, ArrayList<PublicIpAddress>> getProviderToIpList(Network network,
+            Map<PublicIpAddress, Set<Service>> ipToServices) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#getSourceNatIpAddressForGuestNetwork(com.cloud.user.Account, com.cloud.network.Network)
+     */
+    @Override
+    public PublicIpAddress getSourceNatIpAddressForGuestNetwork(Account owner, Network guestNetwork) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see com.cloud.network.NetworkModel#isNetworkInlineMode(com.cloud.network.Network)
+     */
+    @Override
+    public boolean isNetworkInlineMode(Network network) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/df5c4c30/server/test/com/cloud/vpc/VpcApiUnitTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/VpcApiUnitTest.java b/server/test/com/cloud/vpc/VpcApiUnitTest.java
index 9693f44..8e64ab1 100644
--- a/server/test/com/cloud/vpc/VpcApiUnitTest.java
+++ b/server/test/com/cloud/vpc/VpcApiUnitTest.java
@@ -25,6 +25,10 @@ import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
 import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 
 import com.cloud.configuration.dao.ConfigurationDaoImpl;
 import com.cloud.configuration.dao.ResourceCountDaoImpl;
@@ -47,6 +51,7 @@ import com.cloud.tags.dao.ResourceTagsDaoImpl;
 import com.cloud.user.AccountVO;
 import com.cloud.user.MockAccountManagerImpl;
 import com.cloud.user.dao.AccountDaoImpl;
+import com.cloud.utils.component.ComponentContext;
 
 import com.cloud.vm.dao.DomainRouterDaoImpl;
 import com.cloud.vpc.dao.MockNetworkDaoImpl;
@@ -57,15 +62,19 @@ import com.cloud.vpc.dao.MockVpcDaoImpl;
 import com.cloud.vpc.dao.MockVpcOfferingDaoImpl;
 import com.cloud.vpc.dao.MockVpcOfferingServiceMapDaoImpl;
 
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration(locations = "classpath:/VpcTestContext.xml")
 public class VpcApiUnitTest extends TestCase{
     private static final Logger s_logger = Logger.getLogger(VpcApiUnitTest.class);
-    @Inject VpcManager _vpcService;
+    @Inject VpcManagerImpl _vpcService = null;
 
     @Override
     @Before
     public void setUp() throws Exception {
+        ComponentContext.initComponentsLifeCycle();
     }
     
+    @Test
     public void test() {
         s_logger.debug("Starting test for VpcService interface");
         //Vpc service methods
@@ -250,7 +259,7 @@ public class VpcApiUnitTest extends TestCase{
             msg = ex.getMessage();
         } finally {
             if (!result) {
-                s_logger.debug("Test passed: " + msg);
+                s_logger.debug("Test passed : " + msg);
             } else {
                 s_logger.error("Validate network offering: TEST FAILED, can't use network offering with guest type = Shared");
             }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/df5c4c30/server/test/com/cloud/vpc/VpcTestConfiguration.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/VpcTestConfiguration.java b/server/test/com/cloud/vpc/VpcTestConfiguration.java
new file mode 100644
index 0000000..e250cd1
--- /dev/null
+++ b/server/test/com/cloud/vpc/VpcTestConfiguration.java
@@ -0,0 +1,231 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// the License.  You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package com.cloud.vpc;
+
+import java.io.IOException;
+
+import org.mockito.Mockito;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.ComponentScan.Filter;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.FilterType;
+import org.springframework.core.type.classreading.MetadataReader;
+import org.springframework.core.type.classreading.MetadataReaderFactory;
+import org.springframework.core.type.filter.TypeFilter;
+
+import com.cloud.alert.AlertManager;
+import com.cloud.cluster.agentlb.dao.HostTransferMapDaoImpl;
+import com.cloud.configuration.dao.ConfigurationDaoImpl;
+import com.cloud.configuration.dao.ResourceLimitDaoImpl;
+import com.cloud.dao.EntityManagerImpl;
+import com.cloud.dc.dao.AccountVlanMapDaoImpl;
+import com.cloud.dc.dao.ClusterDaoImpl;
+import com.cloud.dc.dao.DataCenterDaoImpl;
+import com.cloud.dc.dao.DataCenterIpAddressDaoImpl;
+import com.cloud.dc.dao.DataCenterLinkLocalIpAddressDaoImpl;
+import com.cloud.dc.dao.DataCenterVnetDaoImpl;
+import com.cloud.dc.dao.DcDetailsDaoImpl;
+import com.cloud.dc.dao.HostPodDaoImpl;
+import com.cloud.dc.dao.PodVlanDaoImpl;
+import com.cloud.dc.dao.PodVlanMapDaoImpl;
+import com.cloud.domain.dao.DomainDaoImpl;
+import com.cloud.event.dao.UsageEventDao;
+import com.cloud.host.dao.HostDaoImpl;
+import com.cloud.host.dao.HostDetailsDaoImpl;
+import com.cloud.host.dao.HostTagsDaoImpl;
+import com.cloud.vpc.MockNetworkModelImpl;
+import com.cloud.network.StorageNetworkManager;
+import com.cloud.network.dao.IPAddressDaoImpl;
+import com.cloud.network.lb.LoadBalancingRulesManager;
+import com.cloud.network.rules.RulesManager;
+import com.cloud.network.vpc.VpcManagerImpl;
+import com.cloud.network.vpc.dao.PrivateIpDaoImpl;
+import com.cloud.network.vpc.dao.StaticRouteDaoImpl;
+import com.cloud.network.vpc.dao.VpcDao;
+import com.cloud.network.vpc.dao.VpcGatewayDaoImpl;
+import com.cloud.network.vpc.dao.VpcOfferingDao;
+import com.cloud.utils.component.SpringComponentScanUtils;
+import com.cloud.vm.UserVmManager;
+import com.cloud.vm.dao.DomainRouterDaoImpl;
+import com.cloud.vm.dao.NicDaoImpl;
+import com.cloud.vm.dao.UserVmDaoImpl;
+import com.cloud.vm.dao.UserVmDetailsDaoImpl;
+import com.cloud.vm.dao.VMInstanceDaoImpl;
+import com.cloud.vpc.dao.MockNetworkOfferingDaoImpl;
+import com.cloud.vpc.dao.MockNetworkOfferingServiceMapDaoImpl;
+import com.cloud.vpc.dao.MockNetworkServiceMapDaoImpl;
+import com.cloud.vpc.dao.MockVpcOfferingDaoImpl;
+import com.cloud.vpc.dao.MockVpcOfferingServiceMapDaoImpl;
+
+
+import com.cloud.configuration.dao.ResourceCountDaoImpl;
+import com.cloud.dc.dao.VlanDaoImpl;
+import com.cloud.network.dao.FirewallRulesCidrsDaoImpl;
+import com.cloud.network.dao.FirewallRulesDaoImpl;
+import com.cloud.network.dao.LoadBalancerDaoImpl;
+import com.cloud.network.dao.NetworkDao;
+import com.cloud.network.dao.PhysicalNetworkDaoImpl;
+import com.cloud.network.dao.PhysicalNetworkTrafficTypeDaoImpl;
+import com.cloud.network.dao.RouterNetworkDaoImpl;
+import com.cloud.network.dao.Site2SiteVpnGatewayDaoImpl;
+import com.cloud.network.dao.VirtualRouterProviderDaoImpl;
+import com.cloud.network.element.NetworkElement;
+import com.cloud.network.element.Site2SiteVpnServiceProvider;
+import com.cloud.network.vpn.RemoteAccessVpnService;
+import com.cloud.network.vpn.Site2SiteVpnManager;
+import com.cloud.projects.dao.ProjectAccountDaoImpl;
+import com.cloud.projects.dao.ProjectDaoImpl;
+import com.cloud.resourcelimit.ResourceLimitManagerImpl;
+import com.cloud.storage.dao.SnapshotDaoImpl;
+import com.cloud.storage.dao.VMTemplateDaoImpl;
+import com.cloud.storage.dao.VMTemplateDetailsDaoImpl;
+import com.cloud.storage.dao.VMTemplateZoneDaoImpl;
+import com.cloud.storage.dao.VolumeDaoImpl;
+import com.cloud.tags.dao.ResourceTagsDaoImpl;
+import com.cloud.user.AccountManager;
+import com.cloud.user.dao.AccountDaoImpl;
+import com.cloud.user.dao.UserStatisticsDaoImpl;
+
+
+@Configuration
+@ComponentScan(basePackageClasses={VpcManagerImpl.class, NetworkElement.class,
+        VpcOfferingDao.class,
+        ConfigurationDaoImpl.class,
+        IPAddressDaoImpl.class,
+        DomainRouterDaoImpl.class,
+        VpcGatewayDaoImpl.class,
+        PrivateIpDaoImpl.class,
+        StaticRouteDaoImpl.class,
+        PhysicalNetworkDaoImpl.class,
+        ResourceTagsDaoImpl.class,
+        FirewallRulesDaoImpl.class,
+        VlanDaoImpl.class,
+        AccountDaoImpl.class,
+        ResourceCountDaoImpl.class,
+        Site2SiteVpnGatewayDaoImpl.class,
+        PodVlanMapDaoImpl.class,
+        AccountVlanMapDaoImpl.class,
+        HostDaoImpl.class,
+        HostDetailsDaoImpl.class,
+        HostTagsDaoImpl.class,
+        HostTransferMapDaoImpl.class,
+        ClusterDaoImpl.class,
+        HostPodDaoImpl.class,
+        RouterNetworkDaoImpl.class,
+        UserStatisticsDaoImpl.class,
+        PhysicalNetworkTrafficTypeDaoImpl.class,
+        FirewallRulesCidrsDaoImpl.class,
+        ResourceLimitManagerImpl.class,
+        ResourceLimitDaoImpl.class,
+        ResourceCountDaoImpl.class,
+        DomainDaoImpl.class,
+        UserVmDaoImpl.class,
+        UserVmDetailsDaoImpl.class,
+        NicDaoImpl.class,
+        SnapshotDaoImpl.class,
+        VMInstanceDaoImpl.class,
+        VolumeDaoImpl.class,
+        VMTemplateDaoImpl.class,VMTemplateZoneDaoImpl.class,VMTemplateDetailsDaoImpl.class,DataCenterDaoImpl.class,DataCenterIpAddressDaoImpl.class,DataCenterLinkLocalIpAddressDaoImpl.class,DataCenterVnetDaoImpl.class,PodVlanDaoImpl.class,
+        DcDetailsDaoImpl.class,MockNetworkManagerImpl.class,MockVpcVirtualNetworkApplianceManager.class,
+        EntityManagerImpl.class,LoadBalancerDaoImpl.class,FirewallRulesCidrsDaoImpl.class,VirtualRouterProviderDaoImpl.class,
+        ProjectDaoImpl.class,ProjectAccountDaoImpl.class,MockVpcOfferingDaoImpl.class,
+        MockConfigurationManagerImpl.class, MockNetworkOfferingServiceMapDaoImpl.class,
+        MockNetworkServiceMapDaoImpl.class,MockVpcOfferingServiceMapDaoImpl.class,MockNetworkOfferingDaoImpl.class, MockNetworkModelImpl.class},
+        includeFilters={@Filter(value=VpcTestConfiguration.VpcLibrary.class, type=FilterType.CUSTOM)},
+        useDefaultFilters=false
+        )
+public class VpcTestConfiguration {
+    
+    
+
+    @Bean
+    public RulesManager rulesManager() {
+        return Mockito.mock(RulesManager.class);
+    }
+
+    
+    @Bean
+    public StorageNetworkManager storageNetworkManager() {
+        return Mockito.mock(StorageNetworkManager.class);
+    }
+    
+    @Bean
+    public LoadBalancingRulesManager loadBalancingRulesManager() {
+        return Mockito.mock(LoadBalancingRulesManager.class);
+    }
+
+    
+    @Bean
+    public AlertManager alertManager() {
+        return Mockito.mock(AlertManager.class);
+    }
+    
+
+
+    @Bean
+    public UserVmManager userVmManager() {
+        return Mockito.mock(UserVmManager.class);
+    }
+
+
+    @Bean
+    public AccountManager accountManager() {
+        return Mockito.mock(AccountManager.class);
+    }
+
+    @Bean
+    public Site2SiteVpnServiceProvider site2SiteVpnServiceProvider() {
+        return Mockito.mock(Site2SiteVpnServiceProvider.class);
+    }
+
+    @Bean
+    public Site2SiteVpnManager site2SiteVpnManager() {
+        return Mockito.mock(Site2SiteVpnManager.class);
+    }
+
+    
+    @Bean
+    public UsageEventDao usageEventDao() {
+        return Mockito.mock(UsageEventDao.class);
+    }
+    
+    @Bean
+    public RemoteAccessVpnService remoteAccessVpnService() {
+        return Mockito.mock(RemoteAccessVpnService.class);
+    }
+    
+    @Bean
+    public VpcDao vpcDao() {
+        return Mockito.mock(VpcDao.class);
+    }
+
+    @Bean
+    public NetworkDao networkDao() {
+        return Mockito.mock(NetworkDao.class);
+    }
+    
+    public static class VpcLibrary implements TypeFilter {
+        @Override
+        public boolean match(MetadataReader mdr, MetadataReaderFactory arg1) throws IOException {
+            mdr.getClassMetadata().getClassName();
+            ComponentScan cs = VpcTestConfiguration.class.getAnnotation(ComponentScan.class);
+            return SpringComponentScanUtils.includedInBasePackageClasses(mdr.getClassMetadata().getClassName(), cs);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/df5c4c30/server/test/com/cloud/vpc/dao/MockNetworkOfferingDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/dao/MockNetworkOfferingDaoImpl.java b/server/test/com/cloud/vpc/dao/MockNetworkOfferingDaoImpl.java
index 496864b..1a93275 100644
--- a/server/test/com/cloud/vpc/dao/MockNetworkOfferingDaoImpl.java
+++ b/server/test/com/cloud/vpc/dao/MockNetworkOfferingDaoImpl.java
@@ -31,12 +31,13 @@ import com.cloud.offering.NetworkOffering.Availability;
 import com.cloud.offering.NetworkOffering.State;
 import com.cloud.offerings.NetworkOfferingVO;
 import com.cloud.offerings.dao.NetworkOfferingDao;
+import com.cloud.offerings.dao.NetworkOfferingDaoImpl;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.GenericDaoBase;
 
 @Local(value = NetworkOfferingDao.class)
 @DB(txn = false)
-public class MockNetworkOfferingDaoImpl extends GenericDaoBase<NetworkOfferingVO, Long> implements NetworkOfferingDao {
+public class MockNetworkOfferingDaoImpl extends NetworkOfferingDaoImpl implements NetworkOfferingDao{
     private static final Logger s_logger = Logger.getLogger(MockNetworkOfferingDaoImpl.class);
 
     /* (non-Javadoc)

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/df5c4c30/server/test/com/cloud/vpc/dao/MockNetworkOfferingServiceMapDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/dao/MockNetworkOfferingServiceMapDaoImpl.java b/server/test/com/cloud/vpc/dao/MockNetworkOfferingServiceMapDaoImpl.java
index 178f42b..d1e8354 100644
--- a/server/test/com/cloud/vpc/dao/MockNetworkOfferingServiceMapDaoImpl.java
+++ b/server/test/com/cloud/vpc/dao/MockNetworkOfferingServiceMapDaoImpl.java
@@ -16,12 +16,16 @@
 // under the License.
 package com.cloud.vpc.dao;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import javax.ejb.Local;
 
 import com.cloud.network.Network.Service;
 import com.cloud.offerings.dao.NetworkOfferingServiceMapDao;
 import com.cloud.offerings.dao.NetworkOfferingServiceMapDaoImpl;
 import com.cloud.utils.db.DB;
+import com.cloud.utils.db.SearchCriteria;
 
 @Local(value = NetworkOfferingServiceMapDao.class)
 @DB(txn = false)
@@ -36,4 +40,5 @@ public class MockNetworkOfferingServiceMapDaoImpl extends NetworkOfferingService
         }
         return false;
     }
+    
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/df5c4c30/server/test/resources/VpcTestContext.xml
----------------------------------------------------------------------
diff --git a/server/test/resources/VpcTestContext.xml b/server/test/resources/VpcTestContext.xml
new file mode 100644
index 0000000..7ed5f57
--- /dev/null
+++ b/server/test/resources/VpcTestContext.xml
@@ -0,0 +1,76 @@
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
+  license agreements. See the NOTICE file distributed with this work for additional 
+  information regarding copyright ownership. The ASF licenses this file to 
+  you under the Apache License, Version 2.0 (the "License"); you may not use 
+  this file except in compliance with the License. You may obtain a copy of 
+  the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
+  by applicable law or agreed to in writing, software distributed under the 
+  License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
+  OF ANY KIND, either express or implied. See the License for the specific 
+  language governing permissions and limitations under the License. -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+  xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/tx 
+                      http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
+                      http://www.springframework.org/schema/aop
+                      http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+  <context:annotation-config />
+    <!-- @DB support -->
+  <aop:config proxy-target-class="true">
+    <aop:aspect id="dbContextBuilder" ref="transactionContextBuilder">
+      <aop:pointcut id="captureAnyMethod" expression="execution(* *(..))" />
+
+      <aop:around pointcut-ref="captureAnyMethod" method="AroundAnyMethod" />
+    </aop:aspect>
+
+  </aop:config>
+
+  <!--
+      Network Elements
+  -->
+  <bean id="SecurityGroupProvider" class="com.cloud.network.element.SecurityGroupElement">
+    <property name="name" value="SecurityGroupProvider"/>
+  </bean>
+  <bean id="VirtualRouter" class="com.cloud.network.element.VirtualRouterElement">
+    <property name="name" value="VirtualRouter"/>
+  </bean>
+  <bean id="VpcVirtualRouter" class="com.cloud.vpc.dao.MockVpcVirtualRouterElement">
+    <property name="name" value="VpcVirtualRouter"/>
+  </bean>
+  
+  <!--
+    Network Gurus
+  -->
+  <bean id="PublicNetworkGuru" class="com.cloud.network.guru.PublicNetworkGuru">
+    <property name="name" value="PublicNetworkGuru"/>
+  </bean>
+  <bean id="PodBasedNetworkGuru" class="com.cloud.network.guru.PodBasedNetworkGuru">
+    <property name="name" value="PodBasedNetworkGuru"/>
+  </bean>
+  <bean id="ControlNetworkGuru" class="com.cloud.network.guru.ControlNetworkGuru">
+    <property name="name" value="ControlNetworkGuru"/>
+  </bean>
+  <bean id="DirectNetworkGuru" class="com.cloud.network.guru.DirectNetworkGuru">
+    <property name="name" value="DirectNetworkGuru"/>
+  </bean>
+  <bean id="DirectPodBasedNetworkGuru" class="com.cloud.network.guru.DirectPodBasedNetworkGuru">
+    <property name="name" value="DirectPodBasedNetworkGuru"/>
+  </bean>
+  <bean id="PrivateNetworkGuru" class="com.cloud.network.guru.PrivateNetworkGuru">
+    <property name="name" value="PrivateNetworkGuru"/>
+  </bean>
+  
+  <bean id="transactionContextBuilder" class="com.cloud.utils.db.TransactionContextBuilder" />
+  <bean id="componentContext" class="com.cloud.utils.component.ComponentContext"/>
+  <bean id="TestConfiguration"
+    class="com.cloud.vpc.VpcTestConfiguration" />
+  <bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor">
+    <property name="requiredParameterValue" value="false" />
+  </bean>
+</beans>


Mime
View raw message