Examples of HttpHost


Examples of org.apache.http.HttpHost

       
        DefaultHttpClient client = new DefaultHttpClient(mgr, params);

        // Get some random data
        HttpGet httpget = new HttpGet("/random/20000");
        HttpHost target = getServerHttp();
       
        HttpResponse response = client.execute(target, httpget);

        ClientConnectionRequest connreq = mgr.requestConnection(new HttpRoute(target), null);
        try {
View Full Code Here

Examples of org.apache.http.HttpHost

       
        DefaultHttpClient client = new DefaultHttpClient(mgr, params);

        // Get some random data
        HttpGet httpget = new HttpGet("/random/20000");
        HttpHost target = getServerHttp();
       
        HttpResponse response = client.execute(target, httpget);

        ClientConnectionRequest connreq = mgr.requestConnection(new HttpRoute(target), null);
        try {
View Full Code Here

Examples of org.apache.http.HttpHost

       
        DefaultHttpClient client = new DefaultHttpClient(mgr, params);

        // Get some random data
        HttpGet httpget = new HttpGet("/dropdead");
        HttpHost target = getServerHttp();
       
        HttpResponse response = client.execute(target, httpget);

        ClientConnectionRequest connreq = mgr.requestConnection(new HttpRoute(target), null);
        try {
View Full Code Here

Examples of org.apache.http.HttpHost

     *
     * @return  the test server host, with a scheme name of "http"
     */
    protected HttpHost getServerHttp() {

        return new HttpHost(LocalTestServer.TEST_SERVER_ADDR.getHostName(),
                            localServer.getServicePort(),
                            "http");
    }
View Full Code Here

Examples of org.apache.http.HttpHost

            e.consumeContent();
        }
       
        HttpRequest reqWrapper = (HttpRequest) context.getAttribute(
                ExecutionContext.HTTP_REQUEST);
        HttpHost targetHost = (HttpHost) context.getAttribute(
                ExecutionContext.HTTP_TARGET_HOST);

        assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
        assertEquals("/relativelocation/", reqWrapper.getRequestLine().getUri());
        assertEquals(host, targetHost.getHostName());
        assertEquals(port, targetHost.getPort());
    }
View Full Code Here

Examples of org.apache.http.HttpHost

            e.consumeContent();
        }
       
        HttpRequest reqWrapper = (HttpRequest) context.getAttribute(
                ExecutionContext.HTTP_REQUEST);
        HttpHost targetHost = (HttpHost) context.getAttribute(
                ExecutionContext.HTTP_TARGET_HOST);

        assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
        assertEquals("/test/relativelocation", reqWrapper.getRequestLine().getUri());
        assertEquals(host, targetHost.getHostName());
        assertEquals(port, targetHost.getPort());
    }
View Full Code Here

Examples of org.apache.http.HttpHost

        ThreadSafeClientConnManager mgr = new ThreadSafeClientConnManager(
                params, supportedSchemes);

        DefaultHttpClient client = new DefaultHttpClient(mgr, params);

        HttpHost target = new HttpHost(saddress.getHostName(), saddress.getPort(), "http");
       
        WorkerThread[] workers = new WorkerThread[10];
        for (int i = 0; i < workers.length; i++) {
            workers[i] = new WorkerThread(
                    client,
View Full Code Here

Examples of org.apache.http.HttpHost

        ThreadSafeClientConnManager mgr = new ThreadSafeClientConnManager(
                params, supportedSchemes);

        DefaultHttpClient client = new DefaultHttpClient(mgr, params);

        HttpHost target = new HttpHost(saddress.getHostName(), saddress.getPort(), "http");
       
        WorkerThread[] workers = new WorkerThread[10];
        for (int i = 0; i < workers.length; i++) {
            workers[i] = new WorkerThread(
                    client,
View Full Code Here

Examples of org.apache.http.HttpHost

        ThreadSafeClientConnManager mgr = new ThreadSafeClientConnManager(
                params, supportedSchemes);

        DefaultHttpClient client = new DefaultHttpClient(mgr, params);

        HttpHost target = new HttpHost(saddress.getHostName(), saddress.getPort(), "http");
       
        WorkerThread[] workers = new WorkerThread[10];
        for (int i = 0; i < workers.length; i++) {
            workers[i] = new WorkerThread(
                    client,
View Full Code Here

Examples of org.apache.http.HttpHost

       
        ThreadSafeClientConnManager mgr = new ThreadSafeClientConnManager(
                params, supportedSchemes);

        DefaultHttpClient client = new DefaultHttpClient(mgr, params);
        HttpHost target = new HttpHost(saddress.getHostName(), saddress.getPort(), "http");
       
        HttpResponse response = client.execute(target, new HttpGet("/random/2000"));
        if(response.getEntity() != null)
            response.getEntity().consumeContent();
       
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.