Package org.apache.wink.client

Examples of org.apache.wink.client.ClientConfig.connectTimeout()


public class ConfigurationTest extends BaseTest {

    public void testConfiguration() {
        ClientConfig conf = new ClientConfig();
        conf.proxyHost("localhost").proxyPort(8080);
        conf.connectTimeout(6000);
        conf.followRedirects(true);

        assertEquals(conf.getProxyHost(), "localhost");
        assertEquals(conf.getProxyPort(), 8080);
        assertEquals(conf.getConnectTimeout(), 6000);
View Full Code Here


    public void testConnectTimeout() {
        int connectTimeout = 2000;
        ClientConfig config = new ClientConfig();

        // set the connect timeout
        config.connectTimeout(connectTimeout);
        RestClient client = new RestClient(config);

        // shouldn't be able to connect
        Resource resource = client.resource("http://localhost:1111/koko");
        long before = System.currentTimeMillis();
View Full Code Here

        return new RestClient(config);
    }

    public RestClient getConnectTimeoutClient() {
        ClientConfig config = new ClientConfig();
        config.connectTimeout(20000);
        return new RestClient(config);
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.