use of org.apache.qpid.server.protocol.v0_8.transport.QueueDeleteOkBody in project qpid-broker-j by apache.
the class QueueTest method queueDelete.
@Test
@SpecificationTest(section = "1.7.2.9", description = "delete a queue")
public void queueDelete() throws Exception {
getBrokerAdmin().createQueue(BrokerAdmin.TEST_QUEUE_NAME);
getBrokerAdmin().putMessageOnQueue(BrokerAdmin.TEST_QUEUE_NAME, "message");
try (FrameTransport transport = new FrameTransport(_brokerAddress).connect()) {
final Interaction interaction = transport.newInteraction();
QueueDeleteOkBody response = interaction.openAnonymousConnection().channel().open().consumeResponse(ChannelOpenOkBody.class).queue().deleteName(BrokerAdmin.TEST_QUEUE_NAME).delete().consumeResponse().getLatestResponse(QueueDeleteOkBody.class);
assertThat(response.getMessageCount(), is(equalTo(1L)));
}
}
use of org.apache.qpid.server.protocol.v0_8.transport.QueueDeleteOkBody in project qpid-broker-j by apache.
the class QueueTest method queueDeleteDefaultQueue.
@Test
@SpecificationTest(section = "1.7.2.9", description = "The client MUST either specify a queue name or have previously declared a queue on the " + "same channel")
public void queueDeleteDefaultQueue() throws Exception {
getBrokerAdmin().createQueue(BrokerAdmin.TEST_QUEUE_NAME);
getBrokerAdmin().putMessageOnQueue(BrokerAdmin.TEST_QUEUE_NAME, "message");
try (FrameTransport transport = new FrameTransport(_brokerAddress).connect()) {
final Interaction interaction = transport.newInteraction();
QueueDeleteOkBody deleteResponse = interaction.openAnonymousConnection().channel().open().consumeResponse(ChannelOpenOkBody.class).queue().declareName(BrokerAdmin.TEST_QUEUE_NAME).declare().consumeResponse(QueueDeclareOkBody.class).queue().delete().consumeResponse().getLatestResponse(QueueDeleteOkBody.class);
assertThat(deleteResponse.getMessageCount(), is(equalTo(1L)));
}
}
Aggregations