Examples of proxyHost()


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

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

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

        RestClient rc = new RestClient(conf);
        ClientConfig config = rc.getConfig();

        // test configuration locking
        try {
            config.proxyHost("localhost");
            fail("Configuration is locked - IllegalStateException must be thrown");
        } catch (ClientConfigException e) {
            // Success - Configuration is locked
        }
    }
View Full Code Here

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

        // if we specify the server port as the proxy port, we in essence test
        // that the connection is going through the proxy, because we
        // specify a different port for the server in the resource URL
        server.setMockResponseCode(200);
        ClientConfig config = new ClientConfig();
        config.proxyHost("localhost").proxyPort(serverPort);
        RestClient client = new RestClient(config);
        String resourceUrl = "http://googoo:" + (serverPort + 1) + "/some/service";
        Resource resource = client.resource(resourceUrl);
        resource.get(String.class);
        assertEquals(resourceUrl, server.getRequestUrl());
View Full Code Here

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

    private GoogleDocsClient(CLIHelper cliHelper) {
        ClientConfig config = new ClientConfig();

        if (cliHelper.hasProxy()) {
            config.proxyHost(cliHelper.getProxyHost());
            config.proxyPort(Integer.valueOf(cliHelper.getProxyPort()));
        }

        // add google authentication handler
        config.handlers(new GoogleAuthHandler(cliHelper.getEmail(), cliHelper.getPassword()));
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.