Package org.apache.http.params

Examples of org.apache.http.params.HttpParams


        }
       
        DefaultHttpAsyncClient dhac = new DefaultHttpAsyncClient(connectionManager) {
            @Override
            protected HttpParams createHttpParams() {
                HttpParams params = new SyncBasicHttpParams();
                HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
                HttpConnectionParams.setTcpNoDelay(params, true);
                int bufSize = c.getClient().getChunkLength() > 0 ? c.getClient().getChunkLength() : 16332;
                HttpConnectionParams.setSocketBufferSize(params, bufSize);
                HttpConnectionParams.setConnectionTimeout(params, (int)c.getClient().getConnectionTimeout());
View Full Code Here


    }


    public void testCloseExpiredConnections() throws Exception {

        HttpParams mgrpar = defaultParams.copy();
        ConnManagerParams.setMaxTotalConnections(mgrpar, 1);

        ThreadSafeClientConnManager mgr = createTSCCM(mgrpar, null);

        final HttpHost target = getServerHttp();
View Full Code Here

     * Tests releasing connection from #abort method called from the
     * main execution thread while there is no blocking I/O operation.
     */
    public void testReleaseConnectionOnAbort() throws Exception {

        HttpParams mgrpar = defaultParams.copy();
        ConnManagerParams.setMaxTotalConnections(mgrpar, 1);

        ThreadSafeClientConnManager mgr = createTSCCM(mgrpar, null);

        final HttpHost target = getServerHttp();
View Full Code Here

     * Tests GC of an unreferenced connection.
     */
    public void testConnectionGC() throws Exception {
        // 3.x: TestHttpConnectionManager.testReclaimUnusedConnection

        HttpParams mgrpar = defaultParams.copy();
        ConnManagerParams.setMaxTotalConnections(mgrpar, 1);

        ThreadSafeClientConnManager mgr = createTSCCM(mgrpar, null);

        final HttpHost target = getServerHttp();
View Full Code Here

        assertNull("TSCCM not garbage collected", wref.get());
    }
   
    public void testAbortDuringConnecting() throws Exception {
        HttpParams mgrpar = defaultParams.copy();
        ConnManagerParams.setMaxTotalConnections(mgrpar, 1);
       
        final CountDownLatch connectLatch = new CountDownLatch(1);       
        final StallingSocketFactory stallingSocketFactory = new StallingSocketFactory(connectLatch, WaitPolicy.BEFORE_CONNECT, PlainSocketFactory.getSocketFactory());
        Scheme scheme = new Scheme("http", stallingSocketFactory, 80);
View Full Code Here

        mgr.releaseConnection(conn2, -1, null);
        mgr.shutdown();
    }
   
    public void testAbortBeforeSocketCreate() throws Exception {
        HttpParams mgrpar = defaultParams.copy();
        ConnManagerParams.setMaxTotalConnections(mgrpar, 1);
       
        final CountDownLatch connectLatch = new CountDownLatch(1);       
        final StallingSocketFactory stallingSocketFactory = new StallingSocketFactory(connectLatch, WaitPolicy.BEFORE_CREATE, PlainSocketFactory.getSocketFactory());
        Scheme scheme = new Scheme("http", stallingSocketFactory, 80);
View Full Code Here

        mgr.releaseConnection(conn2, -1, null);
        mgr.shutdown();
    }
   
    public void testAbortAfterSocketConnect() throws Exception {
        HttpParams mgrpar = defaultParams.copy();
        ConnManagerParams.setMaxTotalConnections(mgrpar, 1);
       
        final CountDownLatch connectLatch = new CountDownLatch(1);       
        final StallingSocketFactory stallingSocketFactory = new StallingSocketFactory(connectLatch, WaitPolicy.AFTER_CONNECT, PlainSocketFactory.getSocketFactory());
        Scheme scheme = new Scheme("http", stallingSocketFactory, 80);
View Full Code Here

        mgr.releaseConnection(conn2, -1, null);
        mgr.shutdown();
    }
   
    public void testAbortAfterOperatorOpen() throws Exception {
        HttpParams mgrpar = defaultParams.copy();
        ConnManagerParams.setMaxTotalConnections(mgrpar, 1);
       
        final CountDownLatch connectLatch = new CountDownLatch(1);
        final AtomicReference<StallingOperator> operatorRef = new AtomicReference<StallingOperator>();
       
View Full Code Here

    }



    public void testSetGet() {
        HttpParams params = new BasicHttpParams();

        assertNull("phantom proxy",
                   ConnRouteParams.getDefaultProxy(params));
        assertNull("phantom route",
                   ConnRouteParams.getForcedRoute(params));
View Full Code Here

                   ConnRouteParams.getLocalAddress(params));
    }


    public void testSetNull() {
        HttpParams params = new BasicHttpParams();

        ConnRouteParams.setDefaultProxy(params, null);
        ConnRouteParams.setForcedRoute(params, null);
        ConnRouteParams.setLocalAddress(params, null);
View Full Code Here

TOP

Related Classes of org.apache.http.params.HttpParams

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.