@Override
 public void tearDown(ManagementClient managementClient, String containerId) throws Exception {
   if (jmsAdminOperations != null) {
     jmsAdminOperations.removeJmsQueue(queueName);
     jmsAdminOperations.close();
   }
 }
  protected static void waitForHornetQServerActivation(
      JMSOperations operations, boolean expectedActive) throws IOException {
    long start = System.currentTimeMillis();
    long now;
    do {
      ModelNode operation = new ModelNode();
      operation.get(OP_ADDR).set(operations.getServerAddress());
      operation.get(OP).set(READ_RESOURCE_OPERATION);
      operation.get(INCLUDE_RUNTIME).set(true);
      operation.get(RECURSIVE).set(true);
      try {
        ModelNode result = execute(operations.getControllerClient(), operation);
        boolean started = result.get("started").asBoolean();
        boolean active = result.get("active").asBoolean();
        if (started && expectedActive == active) {
          // leave some time to the hornetq children resources to be installed after the server is
          // activated
          Thread.sleep(TimeoutUtil.adjust(500));

          return;
        }
      } catch (Exception e) {
      }
      try {
        Thread.sleep(100);
      } catch (InterruptedException e) {
      }
      now = System.currentTimeMillis();
    } while (now - start < ACTIVATION_TIMEOUT);

    fail("Server did not become active in the imparted time.");
  }
 @Override
 public void setup(ManagementClient managementClient, String containerId) throws Exception {
   jmsAdminOperations =
       JMSOperationsProvider.getInstance(managementClient.getControllerClient());
   jmsAdminOperations.createJmsQueue("ejb2x/queue", "java:jboss/ejb2x/queue");
   jmsAdminOperations.createJmsQueue("ejb2x/replyQueueA", "java:jboss/ejb2x/replyQueueA");
   jmsAdminOperations.createJmsQueue("ejb2x/replyQueueB", "java:jboss/ejb2x/replyQueueB");
 }
 @Override
 public void tearDown(ManagementClient managementClient, String containerId) throws Exception {
   if (jmsAdminOperations != null) {
     jmsAdminOperations.removeJmsQueue("messagedestinationtest/queue");
     jmsAdminOperations.removeJmsQueue("messagedestinationtest/replyQueue");
     jmsAdminOperations.close();
   }
 }
 @Override
 public void setup(ManagementClient managementClient, String containerId) throws Exception {
   jmsAdminOperations = JMSOperationsProvider.getInstance(managementClient);
   jmsAdminOperations.createJmsQueue(
       "messagedestinationtest/queue", "java:jboss/mdbtest/messageDestinationQueue");
   jmsAdminOperations.createJmsQueue(
       "messagedestinationtest/replyQueue", "java:jboss/mdbtest/messageDestinationReplyQueue");
 }
 protected static void checkHornetQServerStartedAndActiveAttributes(
     JMSOperations operations, boolean expectedStarted, boolean expectedActive) throws Exception {
   ModelNode operation = new ModelNode();
   ModelNode address = operations.getServerAddress();
   operation.get(OP_ADDR).set(address);
   operation.get(OP).set(READ_RESOURCE_OPERATION);
   operation.get(INCLUDE_RUNTIME).set(true);
   ModelNode result = execute(operations.getControllerClient(), operation);
   assertEquals(expectedStarted, result.get("started").asBoolean());
   assertEquals(expectedActive, result.get("active").asBoolean());
 }
  @After
  public void tearDown() throws Exception {
    try (ModelControllerClient client = createClient1()) {
      JMSOperations jmsOperations = JMSOperationsProvider.getInstance(client);
      jmsOperations.removeJmsQueue(jmsQueueName);
      jmsOperations.removeJmsTopic(jmsTopicName);
    }
    try (ModelControllerClient client = createClient2()) {
      JMSOperations jmsOperations = JMSOperationsProvider.getInstance(client);
      jmsOperations.removeJmsQueue(jmsQueueName);
      jmsOperations.removeJmsTopic(jmsTopicName);
    }

    container.stop(CONTAINER_0);
    container.stop(CONTAINER_1);
  }
  @Before
  public void setUp() throws Exception {

    container.start(CONTAINER_0);
    container.start(CONTAINER_1);

    // both servers are started and configured
    assertTrue(container.isStarted(CONTAINER_0));
    assertTrue(container.isStarted(CONTAINER_1));

    try (ModelControllerClient client = createClient1()) {
      JMSOperations jmsOperations = JMSOperationsProvider.getInstance(client);
      jmsOperations.createJmsQueue(jmsQueueName, "java:jboss/exported/" + jmsQueueLookup);
      jmsOperations.createJmsTopic(jmsTopicName, "java:jboss/exported/" + jmsTopicLookup);
    }
    try (ModelControllerClient client = createClient2()) {
      JMSOperations jmsOperations = JMSOperationsProvider.getInstance(client);
      jmsOperations.createJmsQueue(jmsQueueName, "java:jboss/exported/" + jmsQueueLookup);
      jmsOperations.createJmsTopic(jmsTopicName, "java:jboss/exported/" + jmsTopicLookup);
    }
  }
 @Override
 public void setup(ManagementClient managementClient, String containerId) throws Exception {
   jmsAdminOperations = JMSOperationsProvider.getInstance(managementClient);
   jmsAdminOperations.createJmsQueue(queueName, "java:jboss/" + queueName);
 }
示例#10
0
 @Override
 public void tearDown(final ManagementClient managementClient, final String containerId)
     throws Exception {
   final JMSOperations ops = JMSOperationsProvider.getInstance(managementClient);
   ops.removeJmsQueue(QUEUE_NAME);
 }
示例#11
0
 @Override
 public void setup(final ManagementClient managementClient, final String containerId)
     throws Exception {
   final JMSOperations ops = JMSOperationsProvider.getInstance(managementClient);
   ops.createJmsQueue(QUEUE_NAME, "java:jboss/exported/" + QUEUE_NAME);
 }
 protected static void checkJMSQueue(JMSOperations operations, String jmsQueueName, boolean active)
     throws Exception {
   ModelNode address = operations.getServerAddress().add("jms-queue", jmsQueueName);
   checkQueue0(operations.getControllerClient(), address, "queue-address", active);
 }