test binding to Exchange objects

improve test coverage for binding using objects rather than strings
This commit is contained in:
Matt Broadstone 2014-07-29 12:47:26 -04:00
parent 75f7882d1c
commit 254a0fbf54
1 changed files with 11 additions and 3 deletions

View File

@ -28,7 +28,7 @@ private Q_SLOTS:
void remove(); void remove();
void removeIfUnused(); void removeIfUnused();
void removeIfEmpty(); void removeIfEmpty();
void unbind(); void bindUnbind();
void purge(); void purge();
void canOnlyStartConsumingOnce(); void canOnlyStartConsumingOnce();
void cancel(); void cancel();
@ -257,15 +257,23 @@ void tst_QAMQPQueue::removeIfEmpty()
QVERIFY(waitForSignal(queue, SIGNAL(removed()))); QVERIFY(waitForSignal(queue, SIGNAL(removed())));
} }
void tst_QAMQPQueue::unbind() void tst_QAMQPQueue::bindUnbind()
{ {
Queue *queue = client->createQueue("test-unbind"); Queue *queue = client->createQueue("test-bind-unbind");
declareQueueAndVerifyConsuming(queue); declareQueueAndVerifyConsuming(queue);
queue->bind("amq.topic", "routingKey"); queue->bind("amq.topic", "routingKey");
QVERIFY(waitForSignal(queue, SIGNAL(bound()))); QVERIFY(waitForSignal(queue, SIGNAL(bound())));
queue->unbind("amq.topic", "routingKey"); queue->unbind("amq.topic", "routingKey");
QVERIFY(waitForSignal(queue, SIGNAL(unbound()))); QVERIFY(waitForSignal(queue, SIGNAL(unbound())));
Exchange *amqTopic = client->createExchange("amq.topic");
amqTopic->declare(Exchange::Direct, Exchange::Passive);
QVERIFY(waitForSignal(amqTopic, SIGNAL(declared())));
queue->bind(amqTopic, "routingKey");
QVERIFY(waitForSignal(queue, SIGNAL(bound())));
queue->unbind(amqTopic, "routingKey");
QVERIFY(waitForSignal(queue, SIGNAL(unbound())));
} }
void tst_QAMQPQueue::purge() void tst_QAMQPQueue::purge()