Search in sources :

Example 1 with ExchangeQueryResult

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)));
    }
}
Also used : ExchangeQueryResult(org.apache.qpid.server.protocol.v0_10.transport.ExchangeQueryResult) ExecutionResult(org.apache.qpid.server.protocol.v0_10.transport.ExecutionResult) Test(org.junit.Test) SpecificationTest(org.apache.qpid.tests.protocol.SpecificationTest) SpecificationTest(org.apache.qpid.tests.protocol.SpecificationTest)

Example 2 with ExchangeQueryResult

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)));
    }
}
Also used : ExchangeQueryResult(org.apache.qpid.server.protocol.v0_10.transport.ExchangeQueryResult) ExecutionResult(org.apache.qpid.server.protocol.v0_10.transport.ExecutionResult) Test(org.junit.Test) SpecificationTest(org.apache.qpid.tests.protocol.SpecificationTest) SpecificationTest(org.apache.qpid.tests.protocol.SpecificationTest)

Aggregations

ExchangeQueryResult (org.apache.qpid.server.protocol.v0_10.transport.ExchangeQueryResult)2 ExecutionResult (org.apache.qpid.server.protocol.v0_10.transport.ExecutionResult)2 SpecificationTest (org.apache.qpid.tests.protocol.SpecificationTest)2 Test (org.junit.Test)2