use of org.apache.activemq.transport.amqp.client.AmqpFrameValidator in project activemq-artemis by apache.
the class AmqpDurableReceiverTest method testDetachedDurableReceiverRemainsActive.
@Test(timeout = 60000)
public void testDetachedDurableReceiverRemainsActive() throws Exception {
AmqpClient client = createAmqpClient();
AmqpConnection connection = addConnection(client.createConnection());
connection.setContainerId(getContainerID());
connection.connect();
connection.setReceivedFrameInspector(new AmqpFrameValidator() {
@Override
public void inspectDetach(Detach detach, Binary encoded) {
if (detach.getClosed()) {
markAsInvalid("Remote should have detached but closed instead.");
}
}
});
connection.setSentFrameInspector(new AmqpFrameValidator() {
@Override
public void inspectDetach(Detach detach, Binary encoded) {
if (detach.getClosed()) {
markAsInvalid("Client should have detached but closed instead.");
}
}
});
AmqpSession session = connection.createSession();
AmqpReceiver receiver = session.createDurableReceiver(getTopicName(), getSubscriptionName());
assertEquals(getTopicName(), lookupSubscription());
receiver.detach();
assertEquals(getTopicName(), lookupSubscription());
connection.getSentFrameInspector().assertValid();
connection.getReceivedFrameInspector().assertValid();
connection.close();
}
Aggregations