Example usage for org.apache.commons.httpclient.params HttpMethodParams getIntParameter

List of usage examples for org.apache.commons.httpclient.params HttpMethodParams getIntParameter

Introduction

In this page you can find the example usage for org.apache.commons.httpclient.params HttpMethodParams getIntParameter.

Prototype

public int getIntParameter(String paramString, int paramInt) 

Source Link

Usage

From source file:org.apache.maven.wagon.providers.webdav.AbstractHttpClientWagonTest.java

public void testSetMaxRedirectsParamViaConfig() {
    HttpMethodConfiguration methodConfig = new HttpMethodConfiguration();
    int maxRedirects = 2;
    methodConfig.addParam(HttpClientParams.MAX_REDIRECTS, "%i," + maxRedirects);

    HttpConfiguration config = new HttpConfiguration();
    config.setAll(methodConfig);/*w  ww  .  ja  v  a  2 s  .c om*/

    TestWagon wagon = new TestWagon();
    wagon.setHttpConfiguration(config);

    HeadMethod method = new HeadMethod();
    wagon.setParameters(method);

    HttpMethodParams params = method.getParams();
    assertNotNull(params);
    assertEquals(maxRedirects, params.getIntParameter(HttpClientParams.MAX_REDIRECTS, -1));
}