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/vmsync to 7ad0722
Date Fri, 26 Apr 2013 20:12:31 GMT
Updated Branches:
  refs/heads/vmsync f1ba6586b -> 7ad0722b8


Unit test to added method to AsyncJobManager


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

Branch: refs/heads/vmsync
Commit: 7ad0722b86d1b5aff6763cfe1f1cc263292ac18d
Parents: f1ba658
Author: Kelven Yang <kelveny@gmail.com>
Authored: Fri Apr 26 13:09:19 2013 -0700
Committer: Kelven Yang <kelveny@gmail.com>
Committed: Fri Apr 26 13:09:19 2013 -0700

----------------------------------------------------------------------
 api/src/com/cloud/async/AsyncJob.java              |   31 ---------------
 .../com/cloud/vm/VirtualMachineManagerImpl.java    |    2 +-
 .../test/com/cloud/async/TestAsyncJobManager.java  |   12 +++--
 3 files changed, 8 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7ad0722b/api/src/com/cloud/async/AsyncJob.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/async/AsyncJob.java b/api/src/com/cloud/async/AsyncJob.java
index 44d7339..c8dc642 100644
--- a/api/src/com/cloud/async/AsyncJob.java
+++ b/api/src/com/cloud/async/AsyncJob.java
@@ -22,37 +22,6 @@ import org.apache.cloudstack.api.InternalIdentity;
 import java.util.Date;
 
 public interface AsyncJob extends Identity, InternalIdentity {
-/*	
-    public enum Type {
-        None,
-        VirtualMachine,
-        DomainRouter,
-        Volume,
-        ConsoleProxy,
-        Snapshot,
-        Template,
-        Iso,
-        SystemVm,
-        Host,
-        StoragePool,
-        IpAddress,
-        SecurityGroup,
-        PhysicalNetwork,
-        TrafficType,
-        PhysicalNetworkServiceProvider,
-        FirewallRule,
-        Account,
-        User,
-        PrivateGateway,
-        StaticRoute,
-        Counter,
-        Condition,
-        AutoScalePolicy,
-        AutoScaleVmProfile,
-        AutoScaleVmGroup,
-        GlobalLoadBalancerRule
-    }
- */   
     Long getParentId();
     
     String getType();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7ad0722b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
index 353a024..a34e02c 100755
--- a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -1433,7 +1433,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements
VirtualMac
         HypervisorGuru hvGuru = _hvGuruMgr.getGuru(profile.getVirtualMachine().getHypervisorType());
         VirtualMachineTO to = hvGuru.implement(profile);
         return to;
-    }
+    	}
 
     protected void cancelWorkItems(long nodeId) {
         GlobalLock scanLock = GlobalLock.getInternLock("vmmgr.cancel.workitem");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7ad0722b/server/test/com/cloud/async/TestAsyncJobManager.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/async/TestAsyncJobManager.java b/server/test/com/cloud/async/TestAsyncJobManager.java
index 1b23937..7a0840a 100644
--- a/server/test/com/cloud/async/TestAsyncJobManager.java
+++ b/server/test/com/cloud/async/TestAsyncJobManager.java
@@ -19,7 +19,8 @@ package com.cloud.async;
 import javax.inject.Inject;
 import junit.framework.TestCase;
 
-import org.apache.log4j.Logger;
+import org.apache.cloudstack.framework.messagebus.MessageBus;
+import org.apache.cloudstack.framework.messagebus.PublishScope;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -30,20 +31,20 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 
 import com.cloud.async.AsyncJobManager;
 import com.cloud.cluster.ClusterManager;
+import com.cloud.utils.Predicate;
 import com.cloud.utils.component.ComponentContext;
 import com.cloud.utils.db.Transaction;
 
 @RunWith(SpringJUnit4ClassRunner.class)
 @ContextConfiguration(locations="classpath:/AsyncJobTestContext.xml")
 public class TestAsyncJobManager extends TestCase {
-    public static final Logger s_logger = Logger.getLogger(TestAsyncJobManager.class.getName());
 
     @Inject AsyncJobManager asyncMgr;
     @Inject ClusterManager clusterMgr;
     @Inject MessageBus messageBus;
 
     @Before                                                  
-    public void setUp() {                                    
+    public void setUp() {
     	ComponentContext.initComponentsLifeCycle();
     	Mockito.when(clusterMgr.getManagementNodeId()).thenReturn(1L);
     	
@@ -65,15 +66,16 @@ public class TestAsyncJobManager extends TestCase {
 						Thread.sleep(1000);
 					} catch (InterruptedException e) {
 					}
+					System.out.println("Publish wakeup message");
 					messageBus.publish(null, "VM", PublishScope.GLOBAL, null);
 				}
 			}
 		});
 		thread.start();
     	
-    	asyncMgr.waitAndCheck("VM", 5000, 10000, new Predicate() {
+    	asyncMgr.waitAndCheck(new String[] {"VM"}, 5000L, 10000L, new Predicate() {
     		public boolean checkCondition() {
-    			s_logger.info("Check condition to exit");
+    			System.out.println("Check condition to exit");
     			return false;
     		}
     	});


Mime
View raw message