assertNotNull(pushManager.getName());
}
@Test
public void testRegisterRejectedNotificationListener() throws InterruptedException {
final SimpleApnsPushNotification notification = this.createTestNotification();
final TestRejectedNotificationListener listener = new TestRejectedNotificationListener();
this.getPushManager().registerRejectedNotificationListener(listener);
assertEquals(0, listener.getRejectedNotificationCount());
final int iterations = 100;
// We expect one less because one notification should be rejected
final CountDownLatch latch = this.getApnsServer().getAcceptedNotificationCountDownLatch(iterations - 1);
for (int i = 0; i < iterations; i++) {
if (i == iterations / 2) {
this.getPushManager().getQueue().add(
new SimpleApnsPushNotification(new byte[] {}, "This is a deliberately malformed notification."));
} else {
this.getPushManager().getQueue().add(notification);
}
}