예제 #1
0
  public void testCreateQueueAMQQueue() throws Exception {
    AMQQueue queue = createTestQueue(getName(), getName() + "Owner", true);
    _store.createQueue(queue);

    reopenStore();
    verify(_queueRecoveryHandler).queue(_queueId, getName(), getName() + "Owner", true, null, null);
  }
예제 #2
0
  public void testCreateQueueAMQQueueWithAlternateExchange() throws Exception {
    Exchange alternateExchange = createTestAlternateExchange();

    AMQQueue queue = createTestQueue(getName(), getName() + "Owner", true, alternateExchange);
    _store.createQueue(queue);

    reopenStore();
    verify(_queueRecoveryHandler)
        .queue(_queueId, getName(), getName() + "Owner", true, null, alternateExchange.getId());
  }
예제 #3
0
  public void testCreateQueueAMQQueueFieldTable() throws Exception {
    AMQQueue queue = createTestQueue(getName(), getName() + "Owner", true);
    Map<String, Object> attributes = new HashMap<String, Object>();
    attributes.put("x-qpid-dlq-enabled", Boolean.TRUE);
    attributes.put("x-qpid-maximum-delivery-count", new Integer(10));

    FieldTable arguments = FieldTable.convertToFieldTable(attributes);
    _store.createQueue(queue, arguments);

    reopenStore();
    verify(_queueRecoveryHandler)
        .queue(_queueId, getName(), getName() + "Owner", true, arguments, null);
  }
예제 #4
0
  public void testUpdateQueueAlternateExchange() throws Exception {
    // create queue
    AMQQueue queue = createTestQueue(getName(), getName() + "Owner", true);
    Map<String, Object> attributes = new HashMap<String, Object>();
    attributes.put("x-qpid-dlq-enabled", Boolean.TRUE);
    attributes.put("x-qpid-maximum-delivery-count", new Integer(10));
    FieldTable arguments = FieldTable.convertToFieldTable(attributes);
    _store.createQueue(queue, arguments);

    // update the queue to have exclusive=false
    Exchange alternateExchange = createTestAlternateExchange();
    queue = createTestQueue(getName(), getName() + "Owner", false, alternateExchange);
    _store.updateQueue(queue);

    reopenStore();
    verify(_queueRecoveryHandler)
        .queue(
            _queueId, getName(), getName() + "Owner", false, arguments, alternateExchange.getId());
  }
예제 #5
0
  public void testRemoveQueue() throws Exception {
    // create queue
    AMQQueue queue = createTestQueue(getName(), getName() + "Owner", true);
    Map<String, Object> attributes = new HashMap<String, Object>();
    attributes.put("x-qpid-dlq-enabled", Boolean.TRUE);
    attributes.put("x-qpid-maximum-delivery-count", new Integer(10));
    FieldTable arguments = FieldTable.convertToFieldTable(attributes);
    _store.createQueue(queue, arguments);

    // remove queue
    _store.removeQueue(queue);
    reopenStore();
    verify(_queueRecoveryHandler, never())
        .queue(
            any(UUID.class),
            anyString(),
            anyString(),
            anyBoolean(),
            any(FieldTable.class),
            any(UUID.class));
  }