Esempio n. 1
0
 protected void removeAllMessages(final String queueName, final int index) throws Exception {
   ManagementService managementService = server0.getManagementService();
   if (index == 1) {
     managementService = server1.getManagementService();
   }
   JMSQueueControl queueControl =
       (JMSQueueControl) managementService.getResource(ResourceNames.JMS_QUEUE + queueName);
   queueControl.removeMessages(null);
 }
Esempio n. 2
0
 protected void checkNoSubscriptions(final Topic topic, final int index) throws Exception {
   ManagementService managementService = server0.getManagementService();
   if (index == 1) {
     managementService = server1.getManagementService();
   }
   TopicControl topicControl =
       (TopicControl)
           managementService.getResource(ResourceNames.JMS_TOPIC + topic.getTopicName());
   Assert.assertEquals(0, topicControl.getSubscriptionCount());
 }
Esempio n. 3
0
  public boolean checkEmpty(final Queue queue, final int index) throws Exception {
    ManagementService managementService = server0.getManagementService();
    if (index == 1) {
      managementService = server1.getManagementService();
    }
    JMSQueueControl queueControl =
        (JMSQueueControl)
            managementService.getResource(ResourceNames.JMS_QUEUE + queue.getQueueName());

    Long messageCount = queueControl.getMessageCount();

    if (messageCount > 0) {
      queueControl.removeMessages(null);
    }
    return true;
  }