Package org.apache.commons.httpclient.params

Examples of org.apache.commons.httpclient.params.HttpParams


    public void testInvalidChallenge() throws Exception {
        List authPrefs = new ArrayList(3);
        authPrefs.add("unsupported1");
        authPrefs.add("unsupported2");
        HttpParams httpparams = new DefaultHttpParams();
        httpparams.setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY, authPrefs);
       
        AuthChallengeProcessor processor = new AuthChallengeProcessor(httpparams);

        Map map = new HashMap();
        map.put("unsupported1", "unsupported1 realm=\"whatever\"");
View Full Code Here


    public void testUnsupportedChallenge() throws Exception {
        List authPrefs = new ArrayList(3);
        authPrefs.add(AuthPolicy.NTLM);
        authPrefs.add(AuthPolicy.BASIC);
        authPrefs.add(AuthPolicy.DIGEST);
        HttpParams httpparams = new DefaultHttpParams();
        httpparams.setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY, authPrefs);
       
        AuthChallengeProcessor processor = new AuthChallengeProcessor(httpparams);

        Map map = new HashMap();
        map.put("unsupported1", "unsupported1 realm=\"whatever\"");
View Full Code Here

            //expected
        }
    }

    public void testChallengeProcessing() throws Exception {
        HttpParams httpparams = new DefaultHttpParams();
        AuthChallengeProcessor processor = new AuthChallengeProcessor(httpparams);

        Map map = new HashMap();
        map.put("basic", "basic realm=\"whatever\", param=\"value\"");
       
View Full Code Here

        assertEquals(authscheme, authstate.getAuthScheme());
        assertEquals("value", authscheme.getParameter("param"));
    }

    public void testInvalidChallengeProcessing() throws Exception {
        HttpParams httpparams = new DefaultHttpParams();
        AuthChallengeProcessor processor = new AuthChallengeProcessor(httpparams);

        Map map = new HashMap();
        map.put("basic", "basic realm=\"whatever\", param=\"value\"");
       
View Full Code Here

    public void testChallengeSelection() throws Exception {
        List authPrefs = new ArrayList(3);
        authPrefs.add(AuthPolicy.NTLM);
        authPrefs.add(AuthPolicy.DIGEST);
        authPrefs.add(AuthPolicy.BASIC);
        HttpParams httpparams = new DefaultHttpParams();
        httpparams.setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY, authPrefs);
       
        AuthChallengeProcessor processor = new AuthChallengeProcessor(httpparams);

        Map map = new HashMap();
        map.put("unknown", "unknown realm=\"whatever\"");
View Full Code Here

    public void testInvalidChallenge() throws Exception {
        List authPrefs = new ArrayList(3);
        authPrefs.add("unsupported1");
        authPrefs.add("unsupported2");
        HttpParams httpparams = new DefaultHttpParams();
        httpparams.setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY, authPrefs);
       
        AuthChallengeProcessor processor = new AuthChallengeProcessor(httpparams);

        Map map = new HashMap();
        map.put("unsupported1", "unsupported1 realm=\"whatever\"");
View Full Code Here

    public void testUnsupportedChallenge() throws Exception {
        List authPrefs = new ArrayList(3);
        authPrefs.add(AuthPolicy.NTLM);
        authPrefs.add(AuthPolicy.BASIC);
        authPrefs.add(AuthPolicy.DIGEST);
        HttpParams httpparams = new DefaultHttpParams();
        httpparams.setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY, authPrefs);
       
        AuthChallengeProcessor processor = new AuthChallengeProcessor(httpparams);

        Map map = new HashMap();
        map.put("unsupported1", "unsupported1 realm=\"whatever\"");
View Full Code Here

            //expected
        }
    }

    public void testChallengeProcessing() throws Exception {
        HttpParams httpparams = new DefaultHttpParams();
        AuthChallengeProcessor processor = new AuthChallengeProcessor(httpparams);

        Map map = new HashMap();
        map.put("basic", "basic realm=\"whatever\", param=\"value\"");
       
View Full Code Here

        assertEquals(authscheme, authstate.getAuthScheme());
        assertEquals("value", authscheme.getParameter("param"));
    }

    public void testInvalidChallengeProcessing() throws Exception {
        HttpParams httpparams = new DefaultHttpParams();
        AuthChallengeProcessor processor = new AuthChallengeProcessor(httpparams);

        Map map = new HashMap();
        map.put("basic", "basic realm=\"whatever\", param=\"value\"");
       
View Full Code Here

        setDefaultParams();
  }

    // Set default parameters as needed
    private static void setDefaultParams(){
        HttpParams params = DefaultHttpParams.getDefaultParams();
       
        // Process httpclient parameters file
        String file=JMeterUtils.getProperty("httpclient.parameters.file"); // $NON-NLS-1$
        if (file != null) {
            HttpClientDefaultParameters.load(file,params);
        }
       
        // If the pre-emptive parameter is undefined, then we cans set it as needed
        // otherwise we should do what the user requested.
        canSetPreEmptive =  params.getParameter(HTTP_AUTHENTICATION_PREEMPTIVE) == null;

        // Handle old-style JMeter properties
        // Default to HTTP version 1.1
        String ver=JMeterUtils.getPropDefault("httpclient.version","1.1"); // $NON-NLS-1$ $NON-NLS-2$
        try {
            params.setParameter(HttpMethodParams.PROTOCOL_VERSION, HttpVersion.parse("HTTP/"+ver));
        } catch (ProtocolException e) {
            log.warn("Problem setting protocol version "+e.getLocalizedMessage());
        }
        String to= JMeterUtils.getProperty("httpclient.timeout");
        if (to != null){
            params.setIntParameter(HttpMethodParams.SO_TIMEOUT, Integer.parseInt(to));
        }

        // This must be done last, as must not be overridden
        params.setParameter(HttpMethodParams.COOKIE_POLICY,CookiePolicy.IGNORE_COOKIES);
        // We do our own cookie handling
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.httpclient.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.