cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject [01/18] git commit: updated refs/heads/object_store to c476d78
Date Thu, 16 May 2013 02:42:14 GMT
Updated Branches:
  refs/heads/object_store b66c48490 -> c476d7866


CLOUDSTACK-2459 Fix the scale vm tests


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

Branch: refs/heads/object_store
Commit: 4c9ca2b50231d1df203d93df82280b8021f18a4d
Parents: c75b189
Author: Nitin Mehta <nitin.mehta@citrix.com>
Authored: Wed May 15 14:25:39 2013 +0530
Committer: Edison Su <sudison@gmail.com>
Committed: Wed May 15 19:41:47 2013 -0700

----------------------------------------------------------------------
 server/test/com/cloud/vm/UserVmManagerTest.java |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4c9ca2b5/server/test/com/cloud/vm/UserVmManagerTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vm/UserVmManagerTest.java b/server/test/com/cloud/vm/UserVmManagerTest.java
index 939ecdc..6a97114 100755
--- a/server/test/com/cloud/vm/UserVmManagerTest.java
+++ b/server/test/com/cloud/vm/UserVmManagerTest.java
@@ -246,8 +246,8 @@ public class UserVmManagerTest {
 
     }
 
-    // Test scaleVm on incompatible HV.
-    //@Test(expected=InvalidParameterValueException.class)
+    // Test scaleVm on equal service offerings.
+    @Test(expected=InvalidParameterValueException.class)
     public void testScaleVMF2()  throws Exception {
 
         ScaleVMCmd cmd = new ScaleVMCmd();
@@ -261,14 +261,11 @@ public class UserVmManagerTest {
         serviceOfferingIdField.setAccessible(true);
         serviceOfferingIdField.set(cmd, 1L);
 
-        //UserContext.current().setEventDetails("Vm Id: "+getId());
-       // Account account = (Account) new AccountVO("testaccount", 1L, "networkdomain", (short)
0, 1);
-        //AccountVO(String accountName, long domainId, String networkDomain, short type,
int regionId)
-       // UserContext.registerContext(1, account, null, true);
 
         when(_vmInstanceDao.findById(anyLong())).thenReturn(_vmInstance);
         doReturn(Hypervisor.HypervisorType.XenServer).when(_vmInstance).getHypervisorType();
 
+        doReturn(VirtualMachine.State.Running).when(_vmInstance).getState();
 
         doNothing().when(_accountMgr).checkAccess(_account, null, true, _templateMock);
 
@@ -285,8 +282,8 @@ public class UserVmManagerTest {
 
     }
 
-    // Test scaleVm for Stopped vm. Full positive test.
-    //@Test
+    // Test scaleVm for Stopped vm.
+    @Test(expected=InvalidParameterValueException.class)
     public void testScaleVMF3()  throws Exception {
 
         ScaleVMCmd cmd = new ScaleVMCmd();
@@ -316,10 +313,12 @@ public class UserVmManagerTest {
         when(_configMgr.getServiceOffering(1L)).thenReturn(so1);
 
         doReturn(VirtualMachine.State.Stopped).when(_vmInstance).getState();
+        when(_vmDao.findById(anyLong())).thenReturn(null);
+
 
         doReturn(true).when(_itMgr).upgradeVmDb(anyLong(),anyLong());
 
-        when(_vmDao.findById(anyLong())).thenReturn(_vmMock);
+        //when(_vmDao.findById(anyLong())).thenReturn(_vmMock);
 
         _userVmMgr.upgradeVirtualMachine(cmd);
 


Mime
View raw message