Search in sources :

Example 11 with ExchangeBoundOkBody

use of org.apache.qpid.server.protocol.v0_8.transport.ExchangeBoundOkBody in project qpid-broker-j by apache.

the class ExchangeTest method exchangeDeclareAutoDelete.

/**
 * Qpid specific extension
 */
@Test
public void exchangeDeclareAutoDelete() throws Exception {
    getBrokerAdmin().createQueue(BrokerAdmin.TEST_QUEUE_NAME);
    try (FrameTransport transport = new FrameTransport(getBrokerAdmin()).connect()) {
        final Interaction interaction = transport.newInteraction();
        interaction.negotiateOpen().channel().open().consumeResponse(ChannelOpenOkBody.class).exchange().declareName(TEST_EXCHANGE).declareAutoDelete(true).declare().consumeResponse(ExchangeDeclareOkBody.class).queue().bindName(TEST_EXCHANGE).bindQueueName(BrokerAdmin.TEST_QUEUE_NAME).bind().consumeResponse(QueueBindOkBody.class).queue().deleteName(BrokerAdmin.TEST_QUEUE_NAME).delete().consumeResponse(QueueDeleteOkBody.class);
        ExchangeBoundOkBody boundResponse = interaction.exchange().boundExchangeName(TEST_EXCHANGE).bound().consumeResponse().getLatestResponse(ExchangeBoundOkBody.class);
        assertThat(boundResponse.getReplyCode(), is(equalTo(ExchangeBoundOkBody.EXCHANGE_NOT_FOUND)));
    }
}
Also used : ExchangeDeclareOkBody(org.apache.qpid.server.protocol.v0_8.transport.ExchangeDeclareOkBody) ExchangeBoundOkBody(org.apache.qpid.server.protocol.v0_8.transport.ExchangeBoundOkBody) Test(org.junit.Test) SpecificationTest(org.apache.qpid.tests.protocol.SpecificationTest)

Aggregations

ExchangeBoundOkBody (org.apache.qpid.server.protocol.v0_8.transport.ExchangeBoundOkBody)11 Test (org.junit.Test)11 SpecificationTest (org.apache.qpid.tests.protocol.SpecificationTest)10 ChannelOpenOkBody (org.apache.qpid.server.protocol.v0_8.transport.ChannelOpenOkBody)6 AMQShortString (org.apache.qpid.server.protocol.v0_8.AMQShortString)5 Matchers.emptyString (org.hamcrest.Matchers.emptyString)5 ExchangeDeclareOkBody (org.apache.qpid.server.protocol.v0_8.transport.ExchangeDeclareOkBody)3 QueueDeclareOkBody (org.apache.qpid.server.protocol.v0_8.transport.QueueDeclareOkBody)2 ChannelCloseBody (org.apache.qpid.server.protocol.v0_8.transport.ChannelCloseBody)1 QueueUnbindOkBody (org.apache.qpid.server.protocol.v0_8.transport.QueueUnbindOkBody)1 FrameTransport (org.apache.qpid.tests.protocol.v0_8.FrameTransport)1 Interaction (org.apache.qpid.tests.protocol.v0_8.Interaction)1