From cd655d3f1d68a69b106e94f606fe3ff8f30d9f2e Mon Sep 17 00:00:00 2001 From: Stuart Longland Date: Sat, 2 May 2015 20:44:17 +1000 Subject: [PATCH] QAmqpExchange redeclaration test: Re-open a closed channel. If the server closes the channel on us, re-open it before removing the exchange. --- tests/auto/qamqpexchange/tst_qamqpexchange.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/auto/qamqpexchange/tst_qamqpexchange.cpp b/tests/auto/qamqpexchange/tst_qamqpexchange.cpp index 43d7c3a..e9420b8 100644 --- a/tests/auto/qamqpexchange/tst_qamqpexchange.cpp +++ b/tests/auto/qamqpexchange/tst_qamqpexchange.cpp @@ -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())));