use of javax.net.SocketFactory in project java-apns by notnoop.
the class ApnsConnectionTest method errorTwice.
@Test
public void errorTwice() {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
SocketFactory factory = mockClosedThenOpenSocket(baos, null, false, 2);
packetSentRegardless(factory, baos);
}
use of javax.net.SocketFactory in project java-apns by notnoop.
the class ApnsConnectionTest method closedSocket.
@Test
@Ignore
public void closedSocket() {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
SocketFactory factory = mockClosedThenOpenSocket(baos, null, true, 1);
packetSentRegardless(factory, baos);
}
use of javax.net.SocketFactory in project java-apns by notnoop.
the class ApnsConnectionTest method errorThrice.
/**
* Connection fails after three retries
*/
@Test(expected = Exception.class)
public void errorThrice() {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
SocketFactory factory = mockClosedThenOpenSocket(baos, null, false, 3);
packetSentRegardless(factory, baos);
}
use of javax.net.SocketFactory in project java-apns by notnoop.
the class ApnsFeedbackConnectionTest method feedbackWithErrorOnce.
@Test
public void feedbackWithErrorOnce() {
SocketFactory sf = mockClosedThenOpenSocket(null, simpleStream, true, 2);
ApnsFeedbackConnection connection = new ApnsFeedbackConnection(sf, "localhost", 80);
connection.DELAY_IN_MS = 0;
checkParsedSimple(connection.getInactiveDevices());
}
use of javax.net.SocketFactory in project java-apns by notnoop.
the class ApnsFeedbackConnectionTest method connectionParsedOne.
/** With Connection **/
@Test
public void connectionParsedOne() {
SocketFactory sf = MockingUtils.mockSocketFactory(null, simpleStream);
ApnsFeedbackConnection connection = new ApnsFeedbackConnection(sf, "localhost", 80);
checkParsedSimple(connection.getInactiveDevices());
}
Aggregations