cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kelv...@apache.org
Subject git commit: updated refs/heads/master to 370a7fd
Date Fri, 12 Apr 2013 00:26:03 GMT
Updated Branches:
  refs/heads/master 4958070b9 -> 370a7fdfd


CLOUDSTACK-1884: fix the unit test issue


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

Branch: refs/heads/master
Commit: 370a7fdfd66cefbd38c3bc8f2844d4f889bfee51
Parents: 4958070
Author: Kelven Yang <kelveny@gmail.com>
Authored: Thu Apr 11 17:23:49 2013 -0700
Committer: Kelven Yang <kelveny@gmail.com>
Committed: Thu Apr 11 17:23:49 2013 -0700

----------------------------------------------------------------------
 server/pom.xml                                     |    3 --
 .../affinity/AffinityApiTestConfiguration.java     |   18 ++++++++++++--
 .../cloudstack/affinity/AffinityApiUnitTest.java   |   10 +++++---
 .../networkoffering/ChildTestConfiguration.java    |    7 +++++-
 .../networkoffering/CreateNetworkOfferingTest.java |    1 -
 5 files changed, 27 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/370a7fdf/server/pom.xml
----------------------------------------------------------------------
diff --git a/server/pom.xml b/server/pom.xml
index a4f315b..ca56851 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -158,9 +158,6 @@
             <exclude>com/cloud/network/vpn/RemoteAccessVpnTest.java</exclude>
             <exclude>com/cloud/network/security/SecurityGroupManagerImpl2Test.java</exclude>
             <exclude>com/cloud/network/security/SecurityGroupManagerImpl2Test.java</exclude>
-            <!-- see CLOUDSTACK-1884 -->
-            <exclude>org/apache/cloudstack/networkoffering/CreateNetworkOfferingTest.java</exclude>
-            <exclude>org/apache/cloudstack/affinity/AffinityApiUnitTest.java</exclude>
           </excludes>
         </configuration>
       </plugin>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/370a7fdf/server/test/org/apache/cloudstack/affinity/AffinityApiTestConfiguration.java
----------------------------------------------------------------------
diff --git a/server/test/org/apache/cloudstack/affinity/AffinityApiTestConfiguration.java
b/server/test/org/apache/cloudstack/affinity/AffinityApiTestConfiguration.java
index c6a0755..fb29469 100644
--- a/server/test/org/apache/cloudstack/affinity/AffinityApiTestConfiguration.java
+++ b/server/test/org/apache/cloudstack/affinity/AffinityApiTestConfiguration.java
@@ -42,6 +42,7 @@ 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.DataCenterLinkLocalIpAddressDao;
 import com.cloud.dc.dao.DataCenterLinkLocalIpAddressDaoImpl;
 import com.cloud.dc.dao.DataCenterVnetDaoImpl;
 import com.cloud.dc.dao.DcDetailsDaoImpl;
@@ -51,6 +52,7 @@ import com.cloud.dc.dao.PodVlanMapDaoImpl;
 import com.cloud.dc.dao.VlanDaoImpl;
 import com.cloud.domain.dao.DomainDaoImpl;
 import com.cloud.event.EventUtils;
+import com.cloud.event.dao.EventDao;
 import com.cloud.event.dao.EventDaoImpl;
 import com.cloud.event.dao.UsageEventDaoImpl;
 import com.cloud.host.dao.HostDaoImpl;
@@ -122,15 +124,15 @@ import com.cloud.vm.dao.VMInstanceDaoImpl;
         UserAccountJoinDaoImpl.class, CapacityDaoImpl.class, SnapshotDaoImpl.class, HostDaoImpl.class,
         VMInstanceDaoImpl.class, HostTransferMapDaoImpl.class, PortForwardingRulesDaoImpl.class,
         PrivateIpDaoImpl.class, UsageEventDaoImpl.class, PodVlanMapDaoImpl.class, DiskOfferingDaoImpl.class,
-        DataCenterDaoImpl.class, DataCenterIpAddressDaoImpl.class, DataCenterLinkLocalIpAddressDaoImpl.class,
+        DataCenterDaoImpl.class, DataCenterIpAddressDaoImpl.class, 
         DataCenterVnetDaoImpl.class, PodVlanDaoImpl.class, DcDetailsDaoImpl.class, NicSecondaryIpDaoImpl.class,
         UserIpv6AddressDaoImpl.class, S3DaoImpl.class, UserDaoImpl.class, NicDaoImpl.class,
NetworkDomainDaoImpl.class,
         HostDetailsDaoImpl.class, HostTagsDaoImpl.class, ClusterDaoImpl.class, FirewallRulesDaoImpl.class,
         FirewallRulesCidrsDaoImpl.class, PhysicalNetworkDaoImpl.class, PhysicalNetworkTrafficTypeDaoImpl.class,
         PhysicalNetworkServiceProviderDaoImpl.class, LoadBalancerDaoImpl.class, NetworkServiceMapDaoImpl.class,
         PrimaryDataStoreDaoImpl.class, StoragePoolDetailsDaoImpl.class, AffinityGroupServiceImpl.class,
-        ComponentContext.class, AffinityGroupProcessor.class, UserVmVO.class, EventUtils.class,
UserVmVO.class,
-        EventDaoImpl.class }, includeFilters = { @Filter(value = AffinityApiTestConfiguration.Library.class,
type = FilterType.CUSTOM) }, useDefaultFilters = false)
+        ComponentContext.class, AffinityGroupProcessor.class, UserVmVO.class, EventUtils.class,
UserVmVO.class
+        }, includeFilters = { @Filter(value = AffinityApiTestConfiguration.Library.class,
type = FilterType.CUSTOM) }, useDefaultFilters = false)
 public class AffinityApiTestConfiguration {
 
     @Bean
@@ -308,6 +310,11 @@ public class AffinityApiTestConfiguration {
     public NetworkOfferingDao networkOfferingDao() {
         return Mockito.mock(NetworkOfferingDao.class);
     }
+    
+    @Bean
+    public EventDao eventDao() {
+        return Mockito.mock(EventDao.class);
+    }
 
     @Bean
     public NetworkDao networkDao() {
@@ -319,6 +326,11 @@ public class AffinityApiTestConfiguration {
         return Mockito.mock(NetworkOfferingServiceMapDao.class);
     }
 
+    @Bean
+    public DataCenterLinkLocalIpAddressDao datacenterLinkLocalIpAddressDao() {
+    	return Mockito.mock(DataCenterLinkLocalIpAddressDao.class);
+    }
+    
     public static class Library implements TypeFilter {
 
         @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/370a7fdf/server/test/org/apache/cloudstack/affinity/AffinityApiUnitTest.java
----------------------------------------------------------------------
diff --git a/server/test/org/apache/cloudstack/affinity/AffinityApiUnitTest.java b/server/test/org/apache/cloudstack/affinity/AffinityApiUnitTest.java
index a044611..a5e6d15 100644
--- a/server/test/org/apache/cloudstack/affinity/AffinityApiUnitTest.java
+++ b/server/test/org/apache/cloudstack/affinity/AffinityApiUnitTest.java
@@ -21,9 +21,7 @@ import static org.mockito.Matchers.anyLong;
 import static org.mockito.Mockito.*;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 import org.apache.cloudstack.affinity.dao.AffinityGroupDao;
 import org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao;
@@ -36,15 +34,15 @@ import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 
 import com.cloud.event.EventUtils;
+import com.cloud.event.EventVO;
+import com.cloud.event.dao.EventDao;
 import com.cloud.exception.InvalidParameterValueException;
 import com.cloud.exception.ResourceInUseException;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.user.Account;
 import com.cloud.user.AccountManager;
-import com.cloud.user.AccountManagerImpl;
 import com.cloud.user.AccountVO;
 import com.cloud.user.UserContext;
-import com.cloud.user.UserContextInitializer;
 import com.cloud.user.dao.AccountDao;
 import com.cloud.utils.component.ComponentContext;
 import com.cloud.vm.UserVmVO;
@@ -84,6 +82,9 @@ public class AffinityApiUnitTest {
 
     @Inject
     AccountDao _accountDao;
+    
+    @Inject
+    EventDao _eventDao;
 
     private static long domainId = 5L;
 
@@ -113,6 +114,7 @@ public class AffinityApiUnitTest {
         Mockito.when(_affinityGroupDao.findByAccountAndName(Mockito.anyLong(), Mockito.anyString())).thenReturn(group);
         Mockito.when(_affinityGroupDao.lockRow(Mockito.anyLong(), anyBoolean())).thenReturn(group);
         Mockito.when(_affinityGroupDao.expunge(Mockito.anyLong())).thenReturn(true);
+        Mockito.when(_eventDao.persist(Mockito.any(EventVO.class))).thenReturn(new EventVO());
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/370a7fdf/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 895a5d4..f1163ef 100644
--- a/server/test/org/apache/cloudstack/networkoffering/ChildTestConfiguration.java
+++ b/server/test/org/apache/cloudstack/networkoffering/ChildTestConfiguration.java
@@ -41,6 +41,7 @@ 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.DataCenterLinkLocalIpAddressDao;
 import com.cloud.dc.dao.DataCenterLinkLocalIpAddressDaoImpl;
 import com.cloud.dc.dao.DataCenterVnetDaoImpl;
 import com.cloud.dc.dao.DcDetailsDaoImpl;
@@ -135,7 +136,6 @@ import com.cloud.vm.dao.VMInstanceDaoImpl;
         DiskOfferingDaoImpl.class,
         DataCenterDaoImpl.class,
         DataCenterIpAddressDaoImpl.class,
-        DataCenterLinkLocalIpAddressDaoImpl.class,
         DataCenterVnetDaoImpl.class,
         PodVlanDaoImpl.class,
         DcDetailsDaoImpl.class,
@@ -319,6 +319,11 @@ public class ChildTestConfiguration {
         return Mockito.mock(NetworkOfferingServiceMapDao.class);
     }
     
+    @Bean
+    public DataCenterLinkLocalIpAddressDao datacenterLinkLocalIpAddressDao() {
+    	return Mockito.mock(DataCenterLinkLocalIpAddressDao.class);
+    }
+    
     public static class Library implements TypeFilter {
 
         @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/370a7fdf/server/test/org/apache/cloudstack/networkoffering/CreateNetworkOfferingTest.java
----------------------------------------------------------------------
diff --git a/server/test/org/apache/cloudstack/networkoffering/CreateNetworkOfferingTest.java
b/server/test/org/apache/cloudstack/networkoffering/CreateNetworkOfferingTest.java
index 67fae33..cbb6c00 100644
--- a/server/test/org/apache/cloudstack/networkoffering/CreateNetworkOfferingTest.java
+++ b/server/test/org/apache/cloudstack/networkoffering/CreateNetworkOfferingTest.java
@@ -49,7 +49,6 @@ import com.cloud.offerings.dao.NetworkOfferingServiceMapDao;
 import com.cloud.user.AccountManager;
 import com.cloud.user.AccountVO;
 import com.cloud.user.UserContext;
-import com.cloud.user.UserContextInitializer;
 import com.cloud.user.UserVO;
 import com.cloud.utils.component.ComponentContext;
 


Mime
View raw message