@Test()
public void simpleFeedbackWithTimeout() throws IOException {
server.getToSend().write(simple);
server.getToWaitBeforeSend().set(5000);
ApnsService service =
APNS.newService().withSSLContext(clientContext)
.withGatewayDestination(LOCALHOST, server.getEffectiveGatewayPort())
.withFeedbackDestination(LOCALHOST, server.getEffectiveFeedbackPort())
.withReadTimeout(1000)
.build();
try {
service.getInactiveDevices();
fail("RuntimeException expected");
}
catch(RuntimeException e) {
assertEquals("Socket timeout exception expected",
SocketTimeoutException.class, e.getCause().getClass() );