diff --git a/client/tomcatconf/applicationContext.xml.in b/client/tomcatconf/applicationContext.xml.in index cffe6829712..de52c36d117 100644 --- a/client/tomcatconf/applicationContext.xml.in +++ b/client/tomcatconf/applicationContext.xml.in @@ -740,6 +740,12 @@ + + + + + + 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 bddf713e3a8..7c231043ad8 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() { 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 52a204a6c07..b4b25443512 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); } diff --git a/server/test/com/cloud/configuration/ConfigurationManagerTest.java b/server/test/com/cloud/configuration/ConfigurationManagerTest.java index e6f415c8d08..4897855af39 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); diff --git a/server/test/org/apache/cloudstack/lb/ChildTestConfiguration.java b/server/test/org/apache/cloudstack/lb/ChildTestConfiguration.java index a5b84ed6206..0cd4ef9cd74 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); diff --git a/server/test/org/apache/cloudstack/networkoffering/ChildTestConfiguration.java b/server/test/org/apache/cloudstack/networkoffering/ChildTestConfiguration.java index 37bd1f7ae7c..145fc1d89fa 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; @@ -308,6 +309,11 @@ public class ChildTestConfiguration { return Mockito.mock(NetworkManager.class); } + @Bean + public IpAddressManager ipAddressManager() { + return Mockito.mock(IpAddressManager.class); + } + @Bean public NetworkOfferingDao networkOfferingDao() { return Mockito.mock(NetworkOfferingDao.class);