use of org.apache.activemq.transport.amqp.client.AmqpValidator in project activemq-artemis by apache.
the class AmqpBrokerReuqestedHearbeatsTest method testBrokerSendsHalfConfiguredIdleTimeoutWhenClientSendsTimeout.
@Test(timeout = 60000)
public void testBrokerSendsHalfConfiguredIdleTimeoutWhenClientSendsTimeout() throws Exception {
AmqpClient client = createAmqpClient();
assertNotNull(client);
client.setValidator(new AmqpValidator() {
@Override
public void inspectOpenedResource(Connection connection) {
assertEquals("Broker did not send half the idle timeout", TEST_IDLE_TIMEOUT / 2, connection.getTransport().getRemoteIdleTimeout());
}
});
AmqpConnection connection = addConnection(client.createConnection());
connection.setIdleTimeout(TEST_IDLE_TIMEOUT * 4);
assertNotNull(connection);
connection.connect();
connection.getStateInspector().assertValid();
connection.close();
}
Aggregations