use of com.notnoop.apns.ApnsService in project java-apns by notnoop.
the class ApnsConnectionTest method sendOneSimpleMultiKey.
@Test(timeout = 2000)
public void sendOneSimpleMultiKey() throws InterruptedException {
ApnsService service = APNS.newService().withSSLContext(clientMultiKeyContext("notnoop-client")).withGatewayDestination(LOCALHOST, gatewayPort).build();
server.stopAt(msg1.length());
service.push(msg1);
server.getMessages().acquire();
assertArrayEquals(msg1.marshall(), server.getReceived().toByteArray());
}
use of com.notnoop.apns.ApnsService in project java-apns by notnoop.
the class FeedbackTest method threeFeedback.
@Test
public void threeFeedback() throws IOException {
server.getToSend().write(three);
ApnsService service = APNS.newService().withSSLContext(clientContext).withGatewayDestination(LOCALHOST, server.getEffectiveGatewayPort()).withFeedbackDestination(LOCALHOST, server.getEffectiveFeedbackPort()).build();
checkParsedThree(service.getInactiveDevices());
}
use of com.notnoop.apns.ApnsService in project java-apns by notnoop.
the class FeedbackTest method simpleFeedbackWithoutTimeout.
@Test
public void simpleFeedbackWithoutTimeout() throws IOException {
server.getToSend().write(simple);
server.getToWaitBeforeSend().set(2000);
ApnsService service = APNS.newService().withSSLContext(clientContext).withGatewayDestination(LOCALHOST, server.getEffectiveGatewayPort()).withFeedbackDestination(LOCALHOST, server.getEffectiveFeedbackPort()).withReadTimeout(3000).build();
checkParsedSimple(service.getInactiveDevices());
}
use of com.notnoop.apns.ApnsService in project java-apns by notnoop.
the class FeedbackTest method simpleQueuedFeedback.
@Test
public void simpleQueuedFeedback() throws IOException {
server.getToSend().write(simple);
ApnsService service = APNS.newService().withSSLContext(clientContext).withGatewayDestination(LOCALHOST, server.getEffectiveGatewayPort()).withFeedbackDestination(LOCALHOST, server.getEffectiveFeedbackPort()).asQueued().build();
checkParsedSimple(service.getInactiveDevices());
}
use of com.notnoop.apns.ApnsService in project java-apns by notnoop.
the class FeedbackTest method threeQueuedFeedback.
@Test
public void threeQueuedFeedback() throws IOException {
server.getToSend().write(three);
ApnsService service = APNS.newService().withSSLContext(clientContext).withGatewayDestination(LOCALHOST, server.getEffectiveGatewayPort()).withFeedbackDestination(LOCALHOST, server.getEffectiveFeedbackPort()).asQueued().build();
checkParsedThree(service.getInactiveDevices());
}
Aggregations