use of org.apache.qpid.server.protocol.v0_10.transport.ExchangeQueryResult in project qpid-broker-j by apache.
the class ExchangeTest method exchangeDelete.
@Test
@SpecificationTest(section = "10.exchange.delete", description = "delete an exchange")
public void exchangeDelete() throws Exception {
String exchangeName = "myexch";
try (FrameTransport transport = new FrameTransport(getBrokerAdmin()).connect()) {
final Interaction interaction = transport.newInteraction();
interaction.negotiateOpen().channelId(1).attachSession(SESSION_NAME).exchange().declareExchange(exchangeName).declareType(ExchangeDefaults.DIRECT_EXCHANGE_CLASS).declareId(0).declare().session().flushCompleted().flush().consumeResponse(SessionCompleted.class);
interaction.exchange().deleteExchange(exchangeName).deleteId(1).delete().session().flushCompleted().flush().consumeResponse(SessionCompleted.class);
ExecutionResult result = interaction.exchange().queryExchange(exchangeName).queryId(2).query().session().flushCompleted().flush().consumeResponse(SessionCommandPoint.class).consumeResponse().getLatestResponse(ExecutionResult.class);
ExchangeQueryResult queryResult = (ExchangeQueryResult) result.getValue();
assertThat(queryResult.getNotFound(), is(equalTo(true)));
}
}
use of org.apache.qpid.server.protocol.v0_10.transport.ExchangeQueryResult in project qpid-broker-j by apache.
the class ExchangeTest method exchangeQuery.
@Test
@SpecificationTest(section = "10.exchange.query", description = "request information about an exchange")
public void exchangeQuery() throws Exception {
String exchangeName = "myexch";
try (FrameTransport transport = new FrameTransport(getBrokerAdmin()).connect()) {
final Interaction interaction = transport.newInteraction();
ExecutionResult result = interaction.negotiateOpen().channelId(1).attachSession(SESSION_NAME).exchange().declareId(0).declareExchange(exchangeName).declareType(ExchangeDefaults.DIRECT_EXCHANGE_CLASS).declare().exchange().queryId(1).queryExchange(exchangeName).query().session().flushCompleted().flush().consumeResponse(SessionCommandPoint.class).consumeResponse().getLatestResponse(ExecutionResult.class);
ExchangeQueryResult queryResult = (ExchangeQueryResult) result.getValue();
assertThat(queryResult.getNotFound(), is(equalTo(false)));
}
}
Aggregations