コード例 #1
0
ファイル: BridgeTestBase.java プロジェクト: kabuky/hornetq
 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);
 }
コード例 #2
0
ファイル: BridgeTestBase.java プロジェクト: kabuky/hornetq
 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());
 }
コード例 #3
0
ファイル: BridgeTestBase.java プロジェクト: kabuky/hornetq
  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;
  }