You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ah...@apache.org on 2013/08/19 23:12:20 UTC

[12/16] git commit: updated refs/heads/master to 494ea50

Fixed up the unit tests


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

Branch: refs/heads/master
Commit: 9f62df580eaaabb3ec250acd41bb65b3be927e25
Parents: 45d2398
Author: Alex Huang <al...@citrix.com>
Authored: Thu Aug 15 19:46:05 2013 -0700
Committer: Alex Huang <al...@citrix.com>
Committed: Mon Aug 19 14:13:30 2013 -0700

----------------------------------------------------------------------
 client/tomcatconf/applicationContext.xml.in      |  6 ++++++
 .../ElementChildTestConfiguration.java           | 17 +++++++++++------
 .../LbChildTestConfiguration.java                | 19 ++++++++++++-------
 .../configuration/ConfigurationManagerTest.java  |  1 +
 .../cloudstack/lb/ChildTestConfiguration.java    | 14 ++++++++++----
 .../networkoffering/ChildTestConfiguration.java  |  6 ++++++
 6 files changed, 46 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9f62df58/client/tomcatconf/applicationContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/applicationContext.xml.in b/client/tomcatconf/applicationContext.xml.in
index cffe682..de52c36 100644
--- a/client/tomcatconf/applicationContext.xml.in
+++ b/client/tomcatconf/applicationContext.xml.in
@@ -740,6 +740,12 @@
     <property name="DhcpProviders" value="#{dhcpProviders.Adapters}" />
   </bean>
 
+  <bean id="ipAddressManagerImpl" class="com.cloud.network.IpAddressManagerImpl" >
+    <property name="NetworkGurus" value="#{networkGurus.Adapters}" />
+    <property name="NetworkElements" value="#{networkElements.Adapters}" />
+    <property name="IpDeployers" value="#{ipDeployers.Adapters}" />
+    <property name="DhcpProviders" value="#{dhcpProviders.Adapters}" />
+  </bean>
   <bean id="networkModelImpl" class="com.cloud.network.NetworkModelImpl">
     <property name="NetworkElements" value="#{networkElements.Adapters}" />
   </bean>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9f62df58/plugins/network-elements/internal-loadbalancer/test/org/apache/cloudstack/internallbelement/ElementChildTestConfiguration.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/internal-loadbalancer/test/org/apache/cloudstack/internallbelement/ElementChildTestConfiguration.java b/plugins/network-elements/internal-loadbalancer/test/org/apache/cloudstack/internallbelement/ElementChildTestConfiguration.java
index bddf713..7c23104 100644
--- a/plugins/network-elements/internal-loadbalancer/test/org/apache/cloudstack/internallbelement/ElementChildTestConfiguration.java
+++ b/plugins/network-elements/internal-loadbalancer/test/org/apache/cloudstack/internallbelement/ElementChildTestConfiguration.java
@@ -5,7 +5,7 @@
 // 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,
@@ -18,9 +18,6 @@ package org.apache.cloudstack.internallbelement;
 
 import java.io.IOException;
 
-import org.apache.cloudstack.lb.dao.ApplicationLoadBalancerRuleDao;
-import org.apache.cloudstack.network.lb.InternalLoadBalancerVMManager;
-import org.apache.cloudstack.test.utils.SpringUtils;
 import org.mockito.Mockito;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
@@ -31,9 +28,13 @@ import org.springframework.core.type.classreading.MetadataReader;
 import org.springframework.core.type.classreading.MetadataReaderFactory;
 import org.springframework.core.type.filter.TypeFilter;
 
+import org.apache.cloudstack.lb.dao.ApplicationLoadBalancerRuleDao;
+import org.apache.cloudstack.network.lb.InternalLoadBalancerVMManager;
+import org.apache.cloudstack.test.utils.SpringUtils;
+
 import com.cloud.configuration.ConfigurationManager;
-import com.cloud.dc.dao.AccountVlanMapDaoImpl;
 import com.cloud.dc.dao.DataCenterDao;
+import com.cloud.network.IpAddressManager;
 import com.cloud.network.NetworkManager;
 import com.cloud.network.NetworkModel;
 import com.cloud.network.dao.NetworkServiceMapDao;
@@ -53,7 +54,7 @@ import com.cloud.vm.dao.DomainRouterDao;
     )
 
 public class ElementChildTestConfiguration {
-    public static class Library implements TypeFilter { 
+    public static class Library implements TypeFilter {
         @Bean
         public AccountManager accountManager() {
             return Mockito.mock(AccountManager.class);
@@ -81,6 +82,10 @@ public class ElementChildTestConfiguration {
             return Mockito.mock(NetworkManager.class);
         }
 
+        @Bean
+        public IpAddressManager ipAddressManager() {
+            return Mockito.mock(IpAddressManager.class);
+        }
         
         @Bean
         public PhysicalNetworkServiceProviderDao physicalNetworkServiceProviderDao() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9f62df58/plugins/network-elements/internal-loadbalancer/test/org/apache/cloudstack/internallbvmmgr/LbChildTestConfiguration.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/internal-loadbalancer/test/org/apache/cloudstack/internallbvmmgr/LbChildTestConfiguration.java b/plugins/network-elements/internal-loadbalancer/test/org/apache/cloudstack/internallbvmmgr/LbChildTestConfiguration.java
index 52a204a..b4b2544 100644
--- a/plugins/network-elements/internal-loadbalancer/test/org/apache/cloudstack/internallbvmmgr/LbChildTestConfiguration.java
+++ b/plugins/network-elements/internal-loadbalancer/test/org/apache/cloudstack/internallbvmmgr/LbChildTestConfiguration.java
@@ -5,7 +5,7 @@
 // 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,
@@ -18,10 +18,6 @@ package org.apache.cloudstack.internallbvmmgr;
 
 import java.io.IOException;
 
-import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
-import org.apache.cloudstack.lb.dao.ApplicationLoadBalancerRuleDao;
-import org.apache.cloudstack.test.utils.SpringUtils;
-
 import org.mockito.Mockito;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
@@ -32,9 +28,13 @@ import org.springframework.core.type.classreading.MetadataReader;
 import org.springframework.core.type.classreading.MetadataReaderFactory;
 import org.springframework.core.type.filter.TypeFilter;
 
+import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
+import org.apache.cloudstack.lb.dao.ApplicationLoadBalancerRuleDao;
+import org.apache.cloudstack.test.utils.SpringUtils;
+
 import com.cloud.agent.AgentManager;
-import com.cloud.dc.dao.AccountVlanMapDaoImpl;
 import com.cloud.dc.dao.DataCenterDao;
+import com.cloud.network.IpAddressManager;
 import com.cloud.network.NetworkManager;
 import com.cloud.network.NetworkModel;
 import com.cloud.network.dao.NetworkDao;
@@ -47,11 +47,11 @@ import com.cloud.server.ConfigurationServer;
 import com.cloud.service.dao.ServiceOfferingDao;
 import com.cloud.storage.dao.VMTemplateDao;
 import com.cloud.user.AccountManager;
+import com.cloud.user.dao.AccountDao;
 import com.cloud.utils.net.NetUtils;
 import com.cloud.vm.VirtualMachineManager;
 import com.cloud.vm.dao.DomainRouterDao;
 import com.cloud.vm.dao.NicDao;
-import com.cloud.user.dao.AccountDao;
 
 
 @Configuration
@@ -124,6 +124,11 @@ import com.cloud.user.dao.AccountDao;
             }
             
             @Bean
+        public IpAddressManager ipAddressManager() {
+            return Mockito.mock(IpAddressManager.class);
+        }
+
+        @Bean
             public ServiceOfferingDao serviceOfferingDao() {
                 return Mockito.mock(ServiceOfferingDao.class);
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9f62df58/server/test/com/cloud/configuration/ConfigurationManagerTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/configuration/ConfigurationManagerTest.java b/server/test/com/cloud/configuration/ConfigurationManagerTest.java
index e6f415c..4897855 100755
--- a/server/test/com/cloud/configuration/ConfigurationManagerTest.java
+++ b/server/test/com/cloud/configuration/ConfigurationManagerTest.java
@@ -107,6 +107,7 @@ public class ConfigurationManagerTest {
         configurationMgr._publicIpAddressDao = _publicIpAddressDao;
         configurationMgr._zoneDao = _zoneDao;
         configurationMgr._firewallDao = _firewallDao;
+        configurationMgr._ipAddrMgr = _ipAddrMgr;
 
         Account account = new AccountVO("testaccount", 1, "networkdomain", (short) 0, UUID.randomUUID().toString());
         when(configurationMgr._accountMgr.getAccount(anyLong())).thenReturn(account);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9f62df58/server/test/org/apache/cloudstack/lb/ChildTestConfiguration.java
----------------------------------------------------------------------
diff --git a/server/test/org/apache/cloudstack/lb/ChildTestConfiguration.java b/server/test/org/apache/cloudstack/lb/ChildTestConfiguration.java
index a5b84ed..0cd4ef9 100644
--- a/server/test/org/apache/cloudstack/lb/ChildTestConfiguration.java
+++ b/server/test/org/apache/cloudstack/lb/ChildTestConfiguration.java
@@ -5,7 +5,7 @@
 // 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,
@@ -18,8 +18,6 @@ package org.apache.cloudstack.lb;
 
 import java.io.IOException;
 
-import org.apache.cloudstack.lb.dao.ApplicationLoadBalancerRuleDao;
-import org.apache.cloudstack.test.utils.SpringUtils;
 import org.mockito.Mockito;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
@@ -30,8 +28,11 @@ import org.springframework.core.type.classreading.MetadataReader;
 import org.springframework.core.type.classreading.MetadataReaderFactory;
 import org.springframework.core.type.filter.TypeFilter;
 
-import com.cloud.dc.dao.AccountVlanMapDaoImpl;
+import org.apache.cloudstack.lb.dao.ApplicationLoadBalancerRuleDao;
+import org.apache.cloudstack.test.utils.SpringUtils;
+
 import com.cloud.event.dao.UsageEventDao;
+import com.cloud.network.IpAddressManager;
 import com.cloud.network.NetworkManager;
 import com.cloud.network.NetworkModel;
 import com.cloud.network.dao.FirewallRulesDao;
@@ -59,6 +60,11 @@ import com.cloud.utils.net.NetUtils;
                 return Mockito.mock(ApplicationLoadBalancerRuleDao.class);
             }
             
+        @Bean
+        IpAddressManager ipAddressManager() {
+            return Mockito.mock(IpAddressManager.class);
+        }
+
             @Bean
             public NetworkModel networkModel() {
                 return Mockito.mock(NetworkModel.class);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9f62df58/server/test/org/apache/cloudstack/networkoffering/ChildTestConfiguration.java
----------------------------------------------------------------------
diff --git a/server/test/org/apache/cloudstack/networkoffering/ChildTestConfiguration.java b/server/test/org/apache/cloudstack/networkoffering/ChildTestConfiguration.java
index 37bd1f7..145fc1d 100644
--- a/server/test/org/apache/cloudstack/networkoffering/ChildTestConfiguration.java
+++ b/server/test/org/apache/cloudstack/networkoffering/ChildTestConfiguration.java
@@ -62,6 +62,7 @@ import com.cloud.event.dao.UsageEventDaoImpl;
 import com.cloud.host.dao.HostDaoImpl;
 import com.cloud.host.dao.HostDetailsDaoImpl;
 import com.cloud.host.dao.HostTagsDaoImpl;
+import com.cloud.network.IpAddressManager;
 import com.cloud.network.Ipv6AddressManager;
 import com.cloud.network.NetworkManager;
 import com.cloud.network.NetworkModel;
@@ -309,6 +310,11 @@ public class ChildTestConfiguration {
     }
 
     @Bean
+    public IpAddressManager ipAddressManager() {
+        return Mockito.mock(IpAddressManager.class);
+    }
+
+    @Bean
     public NetworkOfferingDao networkOfferingDao() {
         return Mockito.mock(NetworkOfferingDao.class);
     }