cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajani Karuturi <>
Subject spring unittests
Date Thu, 27 Mar 2014 09:50:36 GMT
Hi All,

I am trying to write unit tests for ApiAsyncJobDispatcher. This is how I defined by Test class
@ server/test/com/cloud/api

@ContextConfiguration(locations = "classpath:/testContext.xml")
public class ApiAsyncJobDispatcherTest {
    private ApiDispatcher _dispatcher;

    private AsyncJobManager _asyncJobMgr;

    private EntityManager _entityMgr;

    private ApiAsyncJobDispatcher apiAsyncJobDispatcher = new ApiAsyncJobDispatcher();

    public void setUp() throws Exception {

    public void testRunJob() throws Exception {
        AsyncJob asyncJob = new AsyncJobVO("", User.UID_SYSTEM, 1, DetachVolumeCmdByAdmin.class.getCanonicalName(),
null, null, null);

I am getting failed to load ApplicationContext error. The exact error message is
java.lang.ClassNotFoundException: org.apache.cloudstack.framework.eventbus.EventBusBase

I think, that class is moved to Once I make
that change in the application context file, I am getting
Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying
bean of type [] is defined: expected single matching bean but
found 4: mockAccountManagerImpl,accountService,accountManager,acctMgr

Am I miss something?

I did go through
But, didn’t understand Note: #4 of it.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message