add auto test for immediate publish option

as of RabbitMQ 3.x the immediate publishing bit is no longer supported,
added a test to ensure proper functionality.
This commit is contained in:
Matt Broadstone 2014-06-23 19:21:41 -04:00
parent 4f808bef92
commit 50e38c7455
1 changed files with 9 additions and 0 deletions

View File

@ -23,6 +23,7 @@ private Q_SLOTS:
void invalidRedeclaration(); void invalidRedeclaration();
void removeIfUnused(); void removeIfUnused();
void invalidMandatoryRouting(); void invalidMandatoryRouting();
void invalidImmediateRouting();
private: private:
QScopedPointer<Client> client; QScopedPointer<Client> client;
@ -149,5 +150,13 @@ void tst_QAMQPExchange::invalidMandatoryRouting()
QCOMPARE(defaultExchange->error(), QAMQP::UnroutableKey); QCOMPARE(defaultExchange->error(), QAMQP::UnroutableKey);
} }
void tst_QAMQPExchange::invalidImmediateRouting()
{
Exchange *defaultExchange = client->createExchange();
defaultExchange->publish("some message", "unroutable-key", MessageProperties(), Exchange::poImmediate);
QVERIFY(waitForSignal(client.data(), SIGNAL(error(QAMQP::Error))));
QCOMPARE(client->error(), QAMQP::NotImplementedError);
}
QTEST_MAIN(tst_QAMQPExchange) QTEST_MAIN(tst_QAMQPExchange)
#include "tst_qamqpexchange.moc" #include "tst_qamqpexchange.moc"