Index: contrib/org/apache/commons/httpclient/contrib/utils/HttpMethodCloner.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/utils/HttpMethodCloner.java,v retrieving revision 1.2 diff -u -r1.2 HttpMethodCloner.java --- contrib/org/apache/commons/httpclient/contrib/utils/HttpMethodCloner.java 1 Apr 2003 19:04:18 -0000 1.2 +++ contrib/org/apache/commons/httpclient/contrib/utils/HttpMethodCloner.java 2 Oct 2003 13:53:37 -0000 @@ -64,6 +64,7 @@ import org.apache.commons.httpclient.HttpMethod; import org.apache.commons.httpclient.HttpMethodBase; import org.apache.commons.httpclient.methods.EntityEnclosingMethod; +import org.apache.commons.httpclient.params.HttpMethodParams; /** * In this class are only methods to copy a HttpMethod: @@ -83,7 +84,6 @@ throws java.io.IOException { copy.setRequestBody(m.getRequestBodyAsString()); - copy.setUseExpectHeader(m.getUseExpectHeader()); } private static void copyHttpMethodBase( @@ -92,8 +92,11 @@ copy.setHostConfiguration( new HostConfiguration(m.getHostConfiguration())); } - copy.setHttp11(m.isHttp11()); - copy.setStrictMode(m.isStrictMode()); + try { + copy.setParams((HttpMethodParams)m.getParams().clone()); + } catch (CloneNotSupportedException e) { + // Should never happen + } } /** Index: examples/ClientApp.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/examples/ClientApp.java,v retrieving revision 1.11 diff -u -r1.11 ClientApp.java --- examples/ClientApp.java 20 Feb 2003 09:23:29 -0000 1.11 +++ examples/ClientApp.java 2 Oct 2003 13:53:38 -0000 @@ -121,7 +121,7 @@ public HttpClientFrame() { client = new HttpClient(new MultiThreadedHttpConnectionManager()); - client.setConnectionTimeout(30000); + client.getParams().setConnectionTimeout(30000); JPanel panInput = new JPanel(new FlowLayout()); Index: examples/CookieDemoApp.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/examples/CookieDemoApp.java,v retrieving revision 1.10 diff -u -r1.10 CookieDemoApp.java --- examples/CookieDemoApp.java 25 Feb 2003 23:33:48 -0000 1.10 +++ examples/CookieDemoApp.java 2 Oct 2003 13:53:38 -0000 @@ -124,7 +124,7 @@ // Get HTTP client instance HttpClient httpclient = new HttpClient(); - httpclient.setConnectionTimeout(30000); + httpclient.getParams().setConnectionTimeout(30000); httpclient.setState(initialState); // Get HTTP GET method GetMethod httpget = new GetMethod(strURL); Index: examples/MultipartFileUploadApp.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/examples/MultipartFileUploadApp.java,v retrieving revision 1.6 diff -u -r1.6 MultipartFileUploadApp.java --- examples/MultipartFileUploadApp.java 8 Sep 2003 01:15:11 -0000 1.6 +++ examples/MultipartFileUploadApp.java 2 Oct 2003 13:53:38 -0000 @@ -83,6 +83,7 @@ import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpStatus; import org.apache.commons.httpclient.methods.MultipartPostMethod; +import org.apache.commons.httpclient.params.HttpMethodParams; /** * @@ -181,18 +182,13 @@ MultipartPostMethod filePost = new MultipartPostMethod(targetURL); - if (cbxExpectHeader.isSelected()) { - filePost.setUseExpectHeader(true); - } - else { - filePost.setUseExpectHeader(false); - } - + filePost.getParams().setBooleanParameter(HttpMethodParams.USE_EXPECT_CONTINUE, + cbxExpectHeader.isSelected()); try { appendMessage("Uploading " + targetFile.getName() + " to " + targetURL); filePost.addParameter(targetFile.getName(), targetFile); HttpClient client = new HttpClient(); - client.setConnectionTimeout(5000); + client.getParams().setConnectionTimeout(5000); int status = client.executeMethod(filePost); if (status == HttpStatus.SC_OK) { appendMessage( Index: examples/TrivialApp.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/examples/TrivialApp.java,v retrieving revision 1.13 diff -u -r1.13 TrivialApp.java --- examples/TrivialApp.java 8 May 2003 18:39:07 -0000 1.13 +++ examples/TrivialApp.java 2 Oct 2003 13:53:38 -0000 @@ -110,7 +110,7 @@ HttpClient client = new HttpClient(); //establish a connection within 5 seconds - client.setConnectionTimeout(5000); + client.getParams().setConnectionTimeout(5000); //set the default credentials if (creds != null) { Index: java/org/apache/commons/httpclient/HttpClient.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpClient.java,v retrieving revision 1.84 diff -u -r1.84 HttpClient.java --- java/org/apache/commons/httpclient/HttpClient.java 23 Sep 2003 19:51:48 -0000 1.84 +++ java/org/apache/commons/httpclient/HttpClient.java 2 Oct 2003 13:53:39 -0000 @@ -534,8 +534,26 @@ this.httpConnectionManager = httpConnectionManager; } - public HttpParams getParams() { + /** + * Returns {@link HttpClientParams HTTP protocol parameters} associated with this HttpClient. + * + * @since 2.1 + * + * @see HttpClientParams + */ + public HttpClientParams getParams() { return this.params; + } + + /** + * Assigns {@link HttpClientParams HTTP protocol parameters} for this HttpClient. + * + * @since 2.1 + * + * @see HttpClientParams + */ + public void setParams(final HttpClientParams params) { + this.params = params; } } Index: java/org/apache/commons/httpclient/HttpMethod.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethod.java,v retrieving revision 1.29 diff -u -r1.29 HttpMethod.java --- java/org/apache/commons/httpclient/HttpMethod.java 11 Sep 2003 20:08:32 -0000 1.29 +++ java/org/apache/commons/httpclient/HttpMethod.java 2 Oct 2003 13:53:39 -0000 @@ -523,12 +523,21 @@ /** - * Returns a collection of parameters associated with this method + * Returns {@link HttpMethodParams HTTP protocol parameters} associated with this method. * * @since 2.1 * * @see HttpMethodParams */ public HttpMethodParams getParams(); + + /** + * Assigns {@link HttpMethodParams HTTP protocol parameters} for this method. + * + * @since 2.1 + * + * @see HttpMethodParams + */ + public void setParams(final HttpMethodParams params); } Index: java/org/apache/commons/httpclient/HttpMethodBase.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java,v retrieving revision 1.180 diff -u -r1.180 HttpMethodBase.java --- java/org/apache/commons/httpclient/HttpMethodBase.java 11 Sep 2003 20:08:32 -0000 1.180 +++ java/org/apache/commons/httpclient/HttpMethodBase.java 2 Oct 2003 13:53:40 -0000 @@ -2073,7 +2073,7 @@ } /** - * Returns {@link HttpParams HTTP protocol parameters}. + * Returns {@link HttpMethodParams HTTP protocol parameters} associated with this method. * * @return HTTP parameters. * @@ -2081,6 +2081,17 @@ */ public HttpMethodParams getParams() { return this.params; + } + + /** + * Assigns {@link HttpMethodParams HTTP protocol parameters} for this method. + * + * @since 2.1 + * + * @see HttpMethodParams + */ + public void setParams(final HttpMethodParams params) { + this.params = params; } /** Index: java/org/apache/commons/httpclient/auth/DigestScheme.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/auth/DigestScheme.java,v retrieving revision 1.9 diff -u -r1.9 DigestScheme.java --- java/org/apache/commons/httpclient/auth/DigestScheme.java 18 Sep 2003 13:56:21 -0000 1.9 +++ java/org/apache/commons/httpclient/auth/DigestScheme.java 2 Oct 2003 13:53:41 -0000 @@ -82,7 +82,7 @@ * is unsupported. If auth and auth-int are provided, auth is * used. *

- * @TODO: make class more stateful regarding repeated authentication requests + * TODO: make class more stateful regarding repeated authentication requests * * @author Remy Maucherat * @author Rodney Waldhoff @@ -110,7 +110,7 @@ 'e', 'f' }; - //@TODO: supply a real nonce-count, currently a server will interprete a repeated request as a replay + //TODO: supply a real nonce-count, currently a server will interprete a repeated request as a replay private static final String NC = "00000001"; //nonce-count is always 1 private static final int QOP_MISSING = 0; private static final int QOP_AUTH_INT = 1; @@ -310,7 +310,7 @@ if (qopVariant == QOP_AUTH_INT) { LOG.error("Unhandled qop auth-int"); //we do not have access to the entity-body or its hash - //@TODO: add Method ":" digest-uri-value ":" H(entity-body) + //TODO: add Method ":" digest-uri-value ":" H(entity-body) } else { a2 = method + ":" + uri; } Index: java/org/apache/commons/httpclient/methods/ExpectContinueMethod.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods/ExpectContinueMethod.java,v retrieving revision 1.9 diff -u -r1.9 ExpectContinueMethod.java --- java/org/apache/commons/httpclient/methods/ExpectContinueMethod.java 9 Aug 2003 19:37:58 -0000 1.9 +++ java/org/apache/commons/httpclient/methods/ExpectContinueMethod.java 2 Oct 2003 13:53:41 -0000 @@ -69,6 +69,7 @@ import org.apache.commons.httpclient.HttpMethodBase; import org.apache.commons.httpclient.HttpState; import org.apache.commons.httpclient.HttpVersion; +import org.apache.commons.httpclient.params.HttpMethodParams; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -102,10 +103,6 @@ public abstract class ExpectContinueMethod extends HttpMethodBase { - /** This flag specifies whether "expect: 100-continue" handshake is - * to be used prior to sending the request body */ - private boolean useExpectHeader = false; - /** LOG object for this class. */ private static final Log LOG = LogFactory.getLog(ExpectContinueMethod.class); @@ -143,9 +140,15 @@ * be used, false otherwise. * * @since 2.0beta1 + * + * @deprecated Use {@link HttpMethodParams} + * + * @see #getParams() + * @see HttpMethodParams + * @see HttpMethodParams#USE_EXPECT_CONTINUE */ public boolean getUseExpectHeader() { - return this.useExpectHeader; + return getParams().getBooleanParameter(HttpMethodParams.USE_EXPECT_CONTINUE, false); } /** @@ -172,11 +175,16 @@ * * @param value boolean value * - * * @since 2.0beta1 + * + * @deprecated Use {@link HttpMethodParams} + * + * @see #getParams() + * @see HttpMethodParams + * @see HttpMethodParams#USE_EXPECT_CONTINUE */ public void setUseExpectHeader(boolean value) { - this.useExpectHeader = value; + getParams().setBooleanParameter(HttpMethodParams.USE_EXPECT_CONTINUE, value); } /** @@ -214,7 +222,7 @@ // = HTTP/1.1 or higher // = request body present - if (getUseExpectHeader() + if (getParams().isParameterTrue(HttpMethodParams.USE_EXPECT_CONTINUE) && getHttpVersion().greaterEquals(HttpVersion.HTTP_1_1) && hasRequestContent()) { Index: java/org/apache/commons/httpclient/methods/HeadMethod.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods/HeadMethod.java,v retrieving revision 1.25 diff -u -r1.25 HeadMethod.java --- java/org/apache/commons/httpclient/methods/HeadMethod.java 11 Sep 2003 20:08:33 -0000 1.25 +++ java/org/apache/commons/httpclient/methods/HeadMethod.java 2 Oct 2003 13:53:41 -0000 @@ -105,8 +105,6 @@ /** Log object for this class. */ private static final Log LOG = LogFactory.getLog(HeadMethod.class); - private int bodyCheckTimeout = -1; /* Disabled per default */ - //~ Constructors /** @@ -182,16 +180,19 @@ LOG.trace( "enter HeadMethod.readResponseBody(HttpState, HttpConnection)"); - if (this.bodyCheckTimeout < 0) { + int bodyCheckTimeout = + getParams().getIntParameter(HttpMethodParams.HEAD_BODY_CHECK_TIMEOUT, -1); + + if (bodyCheckTimeout < 0) { responseBodyConsumed(); } else { if (LOG.isDebugEnabled()) { LOG.debug("Check for non-compliant response body. Timeout in " - + this.bodyCheckTimeout + " ms"); + + bodyCheckTimeout + " ms"); } boolean responseAvailable = false; try { - responseAvailable = conn.isResponseAvailable(this.bodyCheckTimeout); + responseAvailable = conn.isResponseAvailable(bodyCheckTimeout); } catch (IOException e) { LOG.debug("An IOException occurred while testing if a response was available," + " we will assume one is not.", @@ -212,25 +213,37 @@ } /** - * Return non-compliant response body check timeout. + * Returns non-compliant response body check timeout. * * @return The period of time in milliseconds to wait for a response * body from a non-compliant server. -1 returned when * non-compliant response body check is disabled + * + * @deprecated Use {@link HttpMethodParams} + * + * @see #getParams() + * @see HttpMethodParams + * @see HttpMethodParams#HEAD_BODY_CHECK_TIMEOUT */ public int getBodyCheckTimeout() { - return this.bodyCheckTimeout; + return getParams().getIntParameter(HttpMethodParams.HEAD_BODY_CHECK_TIMEOUT, -1); } /** - * Set non-compliant response body check timeout. + * Sets non-compliant response body check timeout. * * @param timeout The period of time in milliseconds to wait for a response * body from a non-compliant server. -1 can be used to - * disable non-compliant response body check + * disable non-compliant response body check + * + * @deprecated Use {@link HttpMethodParams} + * + * @see #getParams() + * @see HttpMethodParams + * @see HttpMethodParams#HEAD_BODY_CHECK_TIMEOUT */ public void setBodyCheckTimeout(int timeout) { - this.bodyCheckTimeout = timeout; + getParams().setIntParameter(HttpMethodParams.HEAD_BODY_CHECK_TIMEOUT, timeout); } } Index: java/org/apache/commons/httpclient/params/DefaultHttpParams.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/params/DefaultHttpParams.java,v retrieving revision 1.3 diff -u -r1.3 DefaultHttpParams.java --- java/org/apache/commons/httpclient/params/DefaultHttpParams.java 23 Sep 2003 19:51:49 -0000 1.3 +++ java/org/apache/commons/httpclient/params/DefaultHttpParams.java 2 Oct 2003 13:53:42 -0000 @@ -273,6 +273,7 @@ if (this.parameters != null) { clone.parameters = (HashMap)this.parameters.clone(); } + clone.setDefaults(this.defaults); return clone; } } Index: java/org/apache/commons/httpclient/params/HttpMethodParams.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/params/HttpMethodParams.java,v retrieving revision 1.2 diff -u -r1.2 HttpMethodParams.java --- java/org/apache/commons/httpclient/params/HttpMethodParams.java 23 Sep 2003 19:51:49 -0000 1.2 +++ java/org/apache/commons/httpclient/params/HttpMethodParams.java 2 Oct 2003 13:53:42 -0000 @@ -127,6 +127,43 @@ public static final String REJECT_HEAD_BODY = "http.protocol.reject-head-body"; /** + * Sets period of time in milliseconds to wait for a content body sent in response to + * {@link org.apache.commons.httpclient.methods.HeadMethod HEAD method} from a + * non-compliant server. If the parameter is not set or set to -1 non-compliant + * response body check is disabled. + * This parameter expects a value of type {@link Integer}. + */ + public static final String HEAD_BODY_CHECK_TIMEOUT = "http.protocol.head-body-timeout"; + + /** + *

+ * Activates 'Expect: 100-Continue' handshake for the + * {@link org.apache.commons.httpclient.methods.ExpectContinueMethod + * entity enclosing methods}. The purpose of the 'Expect: 100-Continue' + * handshake to allow a client that is sending a request message with + * a request body to determine if the origin server is willing to + * accept the request (based on the request headers) before the client + * sends the request body. + *

+ * + *

+ * The use of the 'Expect: 100-continue' handshake can result in + * noticable peformance improvement for entity enclosing requests + * (such as POST and PUT) that require the target server's + * authentication. + *

+ * + *

+ * 'Expect: 100-continue' handshake should be used with + * caution, as it may cause problems with HTTP servers and + * proxies that do not support HTTP/1.1 protocol. + *

+ * + * This parameter expects a value of type {@link Boolean}. + */ + public static final String USE_EXPECT_CONTINUE = "http.protocol.expect-continue"; + + /** * Creates a new collection of parameters with the collection returned * by {@link #getDefaultParams()} as a parent. The collection will defer * to its parent for a default value if a particular parameter is not Index: test/org/apache/commons/httpclient/TestAuthenticator.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestAuthenticator.java,v retrieving revision 1.31 diff -u -r1.31 TestAuthenticator.java --- test/org/apache/commons/httpclient/TestAuthenticator.java 18 Sep 2003 13:56:22 -0000 1.31 +++ test/org/apache/commons/httpclient/TestAuthenticator.java 2 Oct 2003 13:53:43 -0000 @@ -225,7 +225,6 @@ HttpState state = new HttpState(); HttpMethod method = new SimpleHttpMethod(); - state.setAuthenticationPreemptive(true); assertTrue(!HttpAuthenticator.authenticateDefault(method, null, state)); assertTrue(null == method.getRequestHeader("Authorization")); } @@ -235,7 +234,6 @@ HttpMethod method = new SimpleHttpMethod(); state.setCredentials(null, null, new UsernamePasswordCredentials("username","password")); - state.setAuthenticationPreemptive(true); assertTrue(HttpAuthenticator.authenticateDefault(method, null, state)); assertTrue(null != method.getRequestHeader("Authorization")); String expected = "Basic " + HttpConstants.getString(Base64.encode(HttpConstants.getBytes("username:password"))); Index: test/org/apache/commons/httpclient/TestGetMethodLocal.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestGetMethodLocal.java,v retrieving revision 1.12 diff -u -r1.12 TestGetMethodLocal.java --- test/org/apache/commons/httpclient/TestGetMethodLocal.java 17 Jul 2003 21:57:42 -0000 1.12 +++ test/org/apache/commons/httpclient/TestGetMethodLocal.java 2 Oct 2003 13:53:43 -0000 @@ -201,12 +201,10 @@ GetMethod method1 = new GetMethod(path); method1.addRequestHeader("Connection", "close"); client.executeMethod(method1); - assertEquals(0, method1.getRecoverableExceptionCount() ); // issue another GET. GetMethod method2 = new GetMethod(path); client.executeMethod(method2); - assertEquals(0, method2.getRecoverableExceptionCount() ); } catch (Exception ioe) { Index: test/org/apache/commons/httpclient/TestHttpConnection.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestHttpConnection.java,v retrieving revision 1.10 diff -u -r1.10 TestHttpConnection.java --- test/org/apache/commons/httpclient/TestHttpConnection.java 17 Sep 2003 03:53:25 -0000 1.10 +++ test/org/apache/commons/httpclient/TestHttpConnection.java 2 Oct 2003 13:53:43 -0000 @@ -129,7 +129,7 @@ connectionManager.setConnection(new HttpConnection(getHost(), getPort(), testProtocol)); HttpClient client = createHttpClient(connectionManager); client.getHostConfiguration().setHost(getHost(), getPort(), testProtocol); - client.setConnectionTimeout(1); + client.getParams().setConnectionTimeout(1); try { GetMethod get = new GetMethod(); Index: test/org/apache/commons/httpclient/TestHttpConnectionManager.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestHttpConnectionManager.java,v retrieving revision 1.10 diff -u -r1.10 TestHttpConnectionManager.java --- test/org/apache/commons/httpclient/TestHttpConnectionManager.java 12 Aug 2003 02:35:17 -0000 1.10 +++ test/org/apache/commons/httpclient/TestHttpConnectionManager.java 2 Oct 2003 13:53:44 -0000 @@ -230,7 +230,7 @@ HttpClient client = createHttpClient(connectionManager); // we shouldn't have to wait if a connection is available - client.setHttpConnectionFactoryTimeout(1); + client.getParams().setConnectionManagerTimeout(1); GetMethod getMethod = new GetMethod("/"); @@ -279,7 +279,7 @@ HttpClient client = createHttpClient(connectionManager); // we shouldn't have to wait if a connection is available - client.setHttpConnectionFactoryTimeout( 1 ); + client.getParams().setConnectionManagerTimeout( 1 ); GetMethod getMethod = new GetMethod("/"); @@ -430,7 +430,7 @@ HttpClient client = createHttpClient(connectionManager); // we shouldn't have to wait if a connection is available - client.setHttpConnectionFactoryTimeout( 1 ); + client.getParams().setConnectionManagerTimeout( 1 ); GetMethod getMethod = new GetMethod("/"); @@ -462,7 +462,7 @@ HttpClient client = createHttpClient(connectionManager); // we shouldn't have to wait if a connection is available - client.setHttpConnectionFactoryTimeout( 30000 ); + client.getParams().setConnectionManagerTimeout( 30000 ); GetMethod getMethod = new GetMethod("/"); Index: test/org/apache/commons/httpclient/TestWebappCookie.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestWebappCookie.java,v retrieving revision 1.11 diff -u -r1.11 TestWebappCookie.java --- test/org/apache/commons/httpclient/TestWebappCookie.java 5 Mar 2003 04:02:56 -0000 1.11 +++ test/org/apache/commons/httpclient/TestWebappCookie.java 2 Oct 2003 13:53:44 -0000 @@ -66,6 +66,7 @@ import org.apache.commons.httpclient.cookie.CookiePolicy; import org.apache.commons.httpclient.methods.*; +import org.apache.commons.httpclient.params.HttpMethodParams; /** * This suite of tests depends upon the httpclienttest webapp, @@ -109,7 +110,7 @@ public void testSetCookieGet() throws Exception { HttpClient client = createHttpClient(); - client.setStrictMode(true); + client.getParams().setBooleanParameter(HttpMethodParams.SINGLE_COOKIE_HEADER, true); GetMethod method = new GetMethod("/" + getWebappContext() + "/cookie/write"); method.setQueryString("simple=set"); @@ -130,7 +131,7 @@ public void testSetCookiePost() throws Exception { HttpClient client = createHttpClient(); - client.setStrictMode(true); + client.getParams().setBooleanParameter(HttpMethodParams.SINGLE_COOKIE_HEADER, true); PostMethod method = new PostMethod("/" + getWebappContext() + "/cookie/write"); method.setRequestBody(new NameValuePair[] { new NameValuePair("simple","set") } ); @@ -151,7 +152,7 @@ public void testSetCookiePut() throws Exception { HttpClient client = createHttpClient(); - client.setStrictMode(true); + client.getParams().setBooleanParameter(HttpMethodParams.SINGLE_COOKIE_HEADER, true); PutMethod method = new PutMethod("/" + getWebappContext() + "/cookie/write"); method.setQueryString("simple=set"); @@ -172,7 +173,7 @@ public void testSetExpiredCookieGet() throws Exception { HttpClient client = createHttpClient(); - client.setStrictMode(true); + client.getParams().setBooleanParameter(HttpMethodParams.SINGLE_COOKIE_HEADER, true); GetMethod method = new GetMethod("/" + getWebappContext() + "/cookie/write"); method.setQueryString("simple=unset"); @@ -191,7 +192,7 @@ public void testSetExpiredCookiePut() throws Exception { HttpClient client = createHttpClient(); - client.setStrictMode(true); + client.getParams().setBooleanParameter(HttpMethodParams.SINGLE_COOKIE_HEADER, true); PutMethod method = new PutMethod("/" + getWebappContext() + "/cookie/write"); method.setQueryString("simple=unset"); @@ -210,7 +211,7 @@ public void testSetUnsetCookieGet() throws Exception { HttpClient client = createHttpClient(); - client.setStrictMode(true); + client.getParams().setBooleanParameter(HttpMethodParams.SINGLE_COOKIE_HEADER, true); GetMethod method = new GetMethod("/" + getWebappContext() + "/cookie/write"); method.setQueryString("simple=set"); @@ -246,7 +247,7 @@ public void testSetMultiCookieGetStrict() throws Exception { HttpClient client = createHttpClient(); - client.setStrictMode(true); + client.getParams().setBooleanParameter(HttpMethodParams.SINGLE_COOKIE_HEADER, true); GetMethod method = new GetMethod("/" + getWebappContext() + "/cookie/write"); method.setQueryString("simple=set&domain=set"); @@ -309,7 +310,7 @@ public void testSetMultiCookiePut() throws Exception { HttpClient client = createHttpClient(); - client.setStrictMode(true); + client.getParams().setBooleanParameter(HttpMethodParams.SINGLE_COOKIE_HEADER, true); PutMethod method = new PutMethod("/" + getWebappContext() + "/cookie/write"); method.setQueryString("simple=set&domain=set"); @@ -333,7 +334,7 @@ public void testSendCookieGet() throws Exception { HttpClient client = createHttpClient(); - client.setStrictMode(true); + client.getParams().setBooleanParameter(HttpMethodParams.SINGLE_COOKIE_HEADER, true); GetMethod method = new GetMethod("/" + getWebappContext() + "/cookie/write"); method.setQueryString("simple=set"); @@ -368,7 +369,7 @@ public void testMultiSendCookieGet() throws Exception { HttpClient client = createHttpClient(); - client.setStrictMode(true); + client.getParams().setBooleanParameter(HttpMethodParams.SINGLE_COOKIE_HEADER, true); GetMethod method = new GetMethod("/" + getWebappContext() + "/cookie/write"); method.setQueryString("simple=set&domain=set"); @@ -407,7 +408,7 @@ public void testDeleteCookieGet() throws Exception { HttpClient client = createHttpClient(); - client.setStrictMode(true); + client.getParams().setBooleanParameter(HttpMethodParams.SINGLE_COOKIE_HEADER, true); { @@ -485,9 +486,7 @@ public void testDeleteCookiePut() throws Exception { HttpClient client = createHttpClient(); - client.setStrictMode(true); - - + client.getParams().setBooleanParameter(HttpMethodParams.SINGLE_COOKIE_HEADER, true); { PutMethod method = new PutMethod("/" + getWebappContext() + "/cookie/write"); method.setQueryString("simple=set&domain=set"); Index: test/org/apache/commons/httpclient/TestWebappNoncompliant.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestWebappNoncompliant.java,v retrieving revision 1.5 diff -u -r1.5 TestWebappNoncompliant.java --- test/org/apache/commons/httpclient/TestWebappNoncompliant.java 8 May 2003 17:33:53 -0000 1.5 +++ test/org/apache/commons/httpclient/TestWebappNoncompliant.java 2 Oct 2003 13:53:44 -0000 @@ -60,6 +60,7 @@ import junit.framework.*; import org.apache.commons.httpclient.methods.*; +import org.apache.commons.httpclient.params.HttpMethodParams; /** * Tests cases intended to test if entity enclosing methods @@ -97,7 +98,7 @@ { HttpClient client = createHttpClient(); NoncompliantPostMethod method = new NoncompliantPostMethod("/" + getWebappContext() + "/body"); - method.setUseExpectHeader(true); + method.getParams().setBooleanParameter(HttpMethodParams.USE_EXPECT_CONTINUE, true); method.setRequestBody("This is data to be sent in the body of an HTTP POST."); try { client.executeMethod(method); @@ -137,7 +138,7 @@ throws Exception { HttpClient client = createHttpClient(); HeadMethod method = new NoncompliantHeadMethod("/" + getWebappContext() + "/redirect"); - method.setBodyCheckTimeout(50); + method.getParams().setIntParameter(HttpMethodParams.HEAD_BODY_CHECK_TIMEOUT, 50); client.executeMethod(method); assertEquals(200,method.getStatusCode()); method.releaseConnection(); @@ -151,9 +152,9 @@ public void testNoncompliantHeadStrictMode() throws Exception { HttpClient client = createHttpClient(); - client.setStrictMode(true); + client.getParams().setBooleanParameter(HttpMethodParams.REJECT_HEAD_BODY, true); HeadMethod method = new NoncompliantHeadMethod("/" + getWebappContext() + "/body"); - method.setBodyCheckTimeout(50); + method.getParams().setIntParameter(HttpMethodParams.HEAD_BODY_CHECK_TIMEOUT, 50); try { client.executeMethod(method); fail("HttpException should have been thrown");