use of com.notnoop.apns.ApnsService in project camel by apache.
the class ApnsConsumerTest method createCamelContext.
protected CamelContext createCamelContext() throws Exception {
CamelContext camelContext = super.createCamelContext();
ApnsServiceFactory apnsServiceFactory = ApnsUtils.createDefaultTestConfiguration(camelContext);
ApnsService apnsService = apnsServiceFactory.getApnsService();
ApnsComponent apnsComponent = new ApnsComponent(apnsService);
camelContext.addComponent("apns", apnsComponent);
return camelContext;
}
use of com.notnoop.apns.ApnsService in project camel by apache.
the class ApnsProducerWithoutTokensHeaderTest method createCamelContext.
protected CamelContext createCamelContext() throws Exception {
CamelContext camelContext = super.createCamelContext();
ApnsServiceFactory apnsServiceFactory = ApnsUtils.createDefaultTestConfiguration(camelContext);
ApnsService apnsService = apnsServiceFactory.getApnsService();
ApnsComponent apnsComponent = new ApnsComponent(apnsService);
camelContext.addComponent("apns", apnsComponent);
return camelContext;
}
use of com.notnoop.apns.ApnsService in project java-apns by notnoop.
the class QueuedApnsServiceTest method newService.
protected ApnsService newService(ApnsConnection connection, ApnsFeedbackConnection feedback) {
ApnsService service = new ApnsServiceImpl(connection, null);
ApnsService queued = new QueuedApnsService(service);
queued.start();
return queued;
}
use of com.notnoop.apns.ApnsService in project java-apns by notnoop.
the class ApnsConnectionTest method sendOneSimpleWithTimeout.
/**
* Unlike in the feedback case, push messages won't expose the socket timeout,
* as the read is done in a separate monitoring thread.
*
* Therefore, normal behavior is expected in this test.
*
* @throws InterruptedException
*/
@Test
public void sendOneSimpleWithTimeout() throws InterruptedException {
server.getToWaitBeforeSend().set(5000);
ApnsService service = APNS.newService().withSSLContext(clientContext()).withGatewayDestination(LOCALHOST, gatewayPort).withReadTimeout(1000).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 ApnsConnectionTest method sendOneSimpleWithoutTimeout.
@Test
public void sendOneSimpleWithoutTimeout() throws InterruptedException {
server.getToWaitBeforeSend().set(2000);
ApnsService service = APNS.newService().withSSLContext(clientContext()).withGatewayDestination(LOCALHOST, gatewayPort).withReadTimeout(5000).build();
server.stopAt(msg1.length());
service.push(msg1);
server.getMessages().acquire();
assertArrayEquals(msg1.marshall(), server.getReceived().toByteArray());
}
Aggregations