Package javax.net

Examples of javax.net.SocketFactory


    }

    /** With Connection **/
    @Test
    public void connectionParsedOne() {
        SocketFactory sf = MockingUtils.mockSocketFactory(null, simpleStream);
        ApnsFeedbackConnection connection = new ApnsFeedbackConnection(sf, "localhost", 80);
        checkParsedSimple(connection.getInactiveDevices());
    }
View Full Code Here


        checkParsedSimple(connection.getInactiveDevices());
    }

    @Test
    public void connectionParsedThree() {
        SocketFactory sf = MockingUtils.mockSocketFactory(null, threeStream);
        ApnsFeedbackConnection connection = new ApnsFeedbackConnection(sf, "localhost", 80);
        checkParsedThree(connection.getInactiveDevices());
    }
View Full Code Here

    }

    /** Check error recover **/
    @Test
    public void feedbackWithClosedSocket() {
        SocketFactory sf = mockClosedThenOpenSocket(null, simpleStream, true, 1);
        ApnsFeedbackConnection connection = new ApnsFeedbackConnection(sf, "localhost", 80);
        connection.DELAY_IN_MS = 0;
        checkParsedSimple(connection.getInactiveDevices());
    }
View Full Code Here

        checkParsedSimple(connection.getInactiveDevices());
    }

    @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());
    }
View Full Code Here

    /**
     * Connection fails after three retries
     */
    @Test(expected = Exception.class)
    public void feedbackWithErrorTwice() {
        SocketFactory sf = mockClosedThenOpenSocket(null, simpleStream, true, 3);
        ApnsFeedbackConnection connection = new ApnsFeedbackConnection(sf, "localhost", 80);
        connection.DELAY_IN_MS = 0;
        checkParsedSimple(connection.getInactiveDevices());
    }
View Full Code Here

    private SimpleApnsNotification msg = new SimpleApnsNotification ("a87d8878d878a79", "{\"aps\":{}}");

    @Test
    public void simpleSocket() {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        SocketFactory factory = mockSocketFactory(baos, null);
        packetSentRegardless(factory, baos);
    }
View Full Code Here

    @Test
    @Ignore
    public void closedSocket() {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        SocketFactory factory = mockClosedThenOpenSocket(baos, null, true, 1);
        packetSentRegardless(factory, baos);
    }
View Full Code Here

    }

    @Test
    public void errorOnce() {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        SocketFactory factory = mockClosedThenOpenSocket(baos, null, false, 1);
        packetSentRegardless(factory, baos);
    }
View Full Code Here

    }

    @Test
    public void errorTwice() {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        SocketFactory factory = mockClosedThenOpenSocket(baos, null, false, 2);
        packetSentRegardless(factory, baos);
    }
View Full Code Here

     * 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);
    }
View Full Code Here

TOP

Related Classes of javax.net.SocketFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.