add auto test for unbinding from an exchange

This commit is contained in:
Matt Broadstone 2014-06-06 14:40:05 -04:00
parent bad40ac83b
commit f11caabb14
1 changed files with 15 additions and 0 deletions

View File

@ -21,6 +21,7 @@ private Q_SLOTS:
void remove();
void removeIfUnused();
void unbind();
private: // disabled
void removeIfEmpty();
@ -131,5 +132,19 @@ void tst_QAMQPQueue::removeIfEmpty()
QVERIFY(!queue->errorString().isEmpty());
}
void tst_QAMQPQueue::unbind()
{
Queue *queue = client->createQueue("test-unbind");
queue->declare();
QVERIFY(waitForSignal(queue, SIGNAL(declared())));
queue->consume(); // required because AutoDelete will not delete if
// there was never a consumer
queue->bind("amq.topic", "routingKey");
QVERIFY(waitForSignal(queue, SIGNAL(bound())));
queue->unbind("amq.topic", "routingKey");
QVERIFY(waitForSignal(queue, SIGNAL(unbound())));
}
QTEST_MAIN(tst_QAMQPQueue)
#include "tst_qamqpqueue.moc"