QAmqpExchange redeclaration test: Re-open a closed channel.

If the server closes the channel on us, re-open it before removing the
exchange.
This commit is contained in:
Stuart Longland 2015-05-02 20:44:17 +10:00
parent 2b707d53de
commit cd655d3f1d
1 changed files with 6 additions and 0 deletions

View File

@ -129,6 +129,12 @@ void tst_QAMQPExchange::invalidRedeclaration()
// this is for rabbitmq:
QCOMPARE(redeclared->error(), QAMQP::PreconditionFailedError);
// Server has probably closed the channel on us, if so, re-open it.
if (!exchange->isOpen()) {
exchange->reopen();
QVERIFY(waitForSignal(exchange, SIGNAL(opened())));
}
// cleanup
exchange->remove();
QVERIFY(waitForSignal(exchange, SIGNAL(removed())));