Search in sources :

Example 1 with Repeat

use of com.notnoop.apns.utils.junit.Repeat in project java-apns by notnoop.

the class ApnsConnectionTest method sendOneSimple.

@Repeat(count = 50)
@Test(timeout = 2000)
public void sendOneSimple() throws InterruptedException {
    ApnsService service = APNS.newService().withSSLContext(clientContext()).withGatewayDestination(LOCALHOST, gatewayPort).build();
    server.stopAt(msg1.length());
    service.push(msg1);
    server.getMessages().acquire();
    assertArrayEquals(msg1.marshall(), server.getReceived().toByteArray());
}
Also used : ApnsService(com.notnoop.apns.ApnsService) Test(org.junit.Test) Repeat(com.notnoop.apns.utils.junit.Repeat)

Example 2 with Repeat

use of com.notnoop.apns.utils.junit.Repeat in project java-apns by notnoop.

the class ApnsConnectionTest method sendOneQueued.

@Repeat(count = 50)
@Test(timeout = 2000)
public void sendOneQueued() throws InterruptedException {
    ApnsService service = APNS.newService().withSSLContext(clientContext()).withGatewayDestination(LOCALHOST, gatewayPort).asQueued().build();
    server.stopAt(msg1.length());
    service.push(msg1);
    server.getMessages().acquire();
    assertArrayEquals(msg1.marshall(), server.getReceived().toByteArray());
}
Also used : ApnsService(com.notnoop.apns.ApnsService) Test(org.junit.Test) Repeat(com.notnoop.apns.utils.junit.Repeat)

Aggregations

ApnsService (com.notnoop.apns.ApnsService)2 Repeat (com.notnoop.apns.utils.junit.Repeat)2 Test (org.junit.Test)2