Package com.volantis.shared.net.impl.http.client.jdk14

Examples of com.volantis.shared.net.impl.http.client.jdk14.ProtocolSocketChannelFactory


        // =====================================================================

        // =====================================================================
        //   Test Expectations
        // =====================================================================
        ProtocolSocketChannelFactory factory =
                new ProtocolSocketChannelFactory(Period.INDEFINITELY);

        String host = "-unknown-host-";
        try {
            factory.createSocket(host, 8080);
            fail("Did not detect unknown host");
        } catch (UnknownHostException expected) {
            assertEquals(host, expected.getMessage());
        }

        try {
            factory.createSocket(host, 8080, InetAddress.getLocalHost(), 0);
            fail("Did not detect unknown host");
        } catch (UnknownHostException expected) {
            assertEquals(host, expected.getMessage());
        }
    }
View Full Code Here


        // =====================================================================

        // =====================================================================
        //   Test Expectations
        // =====================================================================
        ProtocolSocketChannelFactory factory =
                new ProtocolSocketChannelFactory(Period.INDEFINITELY);

        String host = "localhost";
        int port = serverMock.getServerPort();
        Socket socket = factory.createSocket(host, port);
        socket.close();
    }
View Full Code Here

TOP

Related Classes of com.volantis.shared.net.impl.http.client.jdk14.ProtocolSocketChannelFactory

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.