Search in sources :

Example 6 with MessageSubscriber

use of org.apache.cloudstack.framework.messagebus.MessageSubscriber in project cloudstack by apache.

the class TestMessageBus method testRootSubjectMatch.

@Test
public void testRootSubjectMatch() {
    _messageBus.subscribe("/", new MessageSubscriber() {

        @Override
        public void onPublishMessage(String senderAddress, String subject, Object args) {
            Assert.assertTrue(subject.equals("Host") || subject.equals("VM"));
        }
    });
    _messageBus.publish(null, "Host", PublishScope.LOCAL, null);
    _messageBus.publish(null, "VM", PublishScope.LOCAL, null);
    _messageBus.clearAll();
}
Also used : MessageSubscriber(org.apache.cloudstack.framework.messagebus.MessageSubscriber) Test(org.junit.Test)

Aggregations

MessageSubscriber (org.apache.cloudstack.framework.messagebus.MessageSubscriber)6 Test (org.junit.Test)3 Domain (com.cloud.domain.Domain)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 CleanUpDomainCommand (com.cloud.agent.api.manager.CleanUpDomainCommand)1 SyncDomainCommand (com.cloud.agent.api.sync.SyncDomainCommand)1 DomainVO (com.cloud.domain.DomainVO)1 NuageVspDeviceVO (com.cloud.network.NuageVspDeviceVO)1 AccountVO (com.cloud.user.AccountVO)1 SSHKeyPair (com.cloud.user.SSHKeyPair)1 Pair (com.cloud.utils.Pair)1 DB (com.cloud.utils.db.DB)1 VMInstanceVO (com.cloud.vm.VMInstanceVO)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Timer (java.util.Timer)1 VspDomain (net.nuage.vsp.acs.client.api.model.VspDomain)1 VspDomainCleanUp (net.nuage.vsp.acs.client.api.model.VspDomainCleanUp)1 AccessType (org.apache.cloudstack.acl.SecurityChecker.AccessType)1