? headergroup4.diff ? java/org/apache/commons/httpclient/.HeaderGroup.java.swp ? java/org/apache/commons/httpclient/.HttpMethodBase.java.swp ? java/org/apache/commons/httpclient/HeaderGroup.java ? test/org/apache/commons/httpclient/.TestHeaderGroup.java.swp ? test/org/apache/commons/httpclient/TestHeaderGroup.java Index: java/org/apache/commons/httpclient/ChunkedInputStream.java =================================================================== RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/ChunkedInputStream.java,v retrieving revision 1.12 diff -u -r1.12 ChunkedInputStream.java --- java/org/apache/commons/httpclient/ChunkedInputStream.java 28 Jan 2003 04:40:20 -0000 1.12 +++ java/org/apache/commons/httpclient/ChunkedInputStream.java 10 Feb 2003 00:47:00 -0000 @@ -67,6 +67,7 @@ import java.io.IOException; import java.io.InputStream; + /** *
Transparently coalesces chunks of a HTTP stream that uses * Transfer-Encoding chunked.
@@ -84,6 +85,7 @@ * @author Martin Elwin * @author Eric Johnson * @author Mike Bowler + * @author Michael Becke * * @since 2.0 * @@ -130,7 +132,7 @@ this.chunkSize = getChunkSizeFromInputStream(in); if (chunkSize == 0) { eof = true; - parseFooters(); + parseTrailers(); } this.pos = 0; } @@ -140,12 +142,14 @@ * is followed by a CRLF. The method returns -1 as soon as a chunksize of 0 * is detected. * - *Footers are read automcatically at the end of the stream and can be - * obtained with the getFooters() method.
+ *Trailer headers are read automcatically at the end of the stream and + * can be obtained with the getResponseFooters() method.
* * @return -1 of the end of the stream has been reached or the next data * byte * @throws IOException If an IO problem occurs + * + * @see HttpMethod#getResponseFooters() */ public int read() throws IOException { @@ -224,7 +228,7 @@ pos = 0; if (chunkSize == 0) { eof = true; - parseFooters(); + parseTrailers(); } } @@ -306,46 +310,16 @@ } /** - * Stores the footers into map of Headers + * Reads and stores the Trailer headers. * @throws IOException If an IO problem occurs */ - private void parseFooters() throws IOException { - String line = readLine(); - while ((line != null) && (!line.equals(""))) { - int colonPos = line.indexOf(':'); - if (colonPos != -1) { - String key = line.substring(0, colonPos).trim(); - String val = line.substring(colonPos + 1).trim(); - Header footer = new Header(key, val); - method.addResponseFooter(footer); - } - line = readLine(); - } - } - - /** - * Read the next line from {@link #in}. - * @return String The next line. - * @throws IOException If an IO problem occurs. - */ - private String readLine() throws IOException { - StringBuffer buf = new StringBuffer(); - while (true) { - int ch = in.read(); - if (ch < 0) { - if (buf.length() == 0) { - return null; - } else { - break; - } - } else if (ch == '\r') { - continue; - } else if (ch == '\n') { - break; - } - buf.append((char) ch); + private void parseTrailers() throws IOException { + //TODO: should just call setTrailers when available in HttpMethod + Header[] trailers = HeaderGroup.parseHeaders(in).getAllHeaders(); + + for (int i = 0; i < trailers.length; i++) { + method.addResponseFooter(trailers[i]); } - return (buf.toString()); } /** Index: java/org/apache/commons/httpclient/Header.java =================================================================== RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/Header.java,v retrieving revision 1.10 diff -u -r1.10 Header.java --- java/org/apache/commons/httpclient/Header.java 28 Jan 2003 04:40:20 -0000 1.10 +++ java/org/apache/commons/httpclient/Header.java 10 Feb 2003 00:47:00 -0000 @@ -82,13 +82,23 @@ } /** - * Constructor with name and value + * Constructor with name and value. * * @param name the header name * @param value the header value */ public Header(String name, String value) { super(name, value); + } + + + /** + * Copy constructor. + * + * @param header header to copy + */ + public Header(Header header) { + super(header.getName(), header.getValue()); } // --------------------------------------------------------- Public Methods Index: java/org/apache/commons/httpclient/HttpConnection.java =================================================================== RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpConnection.java,v retrieving revision 1.42 diff -u -r1.42 HttpConnection.java --- java/org/apache/commons/httpclient/HttpConnection.java 8 Feb 2003 19:22:49 -0000 1.42 +++ java/org/apache/commons/httpclient/HttpConnection.java 10 Feb 2003 00:47:05 -0000 @@ -104,11 +104,48 @@ * @author Jeff Dever * @author Mike Bowler * @author Oleg Kalnichevski + * @author Michael Becke * * @version $Revision: 1.42 $ $Date: 2003/02/08 19:22:49 $ */ public class HttpConnection { + /** + * Read up to "\r\n" from an (unchunked) input stream. + * If the stream ends before the line terminator is found, + * the last part of the string will still be returned. + * '\r' and '\n' are allowed to appear individually in the stream. + * + * @param inputStream the stream to read from + * + * @throws IOException if an I/O problem occurs + * @return a line from the stream + * + * @since 2.0beta1 + */ + public static String readLine(InputStream inputStream) throws IOException { + LOG.trace("enter HttpConnection.readLine()"); + + StringBuffer buf = new StringBuffer(); + int ch = inputStream.read(); + while (ch >= 0) { + if (ch == '\r') { + ch = inputStream.read(); + if (ch == '\n') { + break; + } else { + buf.append('\r'); + } + } + buf.append((char) ch); + ch = inputStream.read(); + } + if (WIRE_LOG.isDebugEnabled()) { + WIRE_LOG.debug("<< \"" + buf.toString() + (ch>0 ? "\" [\\r\\n]" : "")); + } + return (buf.toString()); + } + // ----------------------------------------------------------- Constructors /** @@ -857,24 +894,7 @@ LOG.trace("enter HttpConnection.readLine()"); assertOpen(); - StringBuffer buf = new StringBuffer(); - int ch = inputStream.read(); - while (ch >= 0) { - if (ch == '\r') { - ch = inputStream.read(); - if (ch == '\n') { - break; - } else { - buf.append('\r'); - } - } - buf.append((char) ch); - ch = inputStream.read(); - } - if (WIRE_LOG.isDebugEnabled()) { - WIRE_LOG.debug("<< \"" + buf.toString() + (ch>0 ? "\" [\\r\\n]" : "")); - } - return (buf.toString()); + return HttpConnection.readLine(inputStream); } /** Index: java/org/apache/commons/httpclient/HttpMethodBase.java =================================================================== RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java,v retrieving revision 1.110 diff -u -r1.110 HttpMethodBase.java --- java/org/apache/commons/httpclient/HttpMethodBase.java 8 Feb 2003 19:22:49 -0000 1.110 +++ java/org/apache/commons/httpclient/HttpMethodBase.java 10 Feb 2003 00:47:17 -0000 @@ -69,10 +69,7 @@ import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; -import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; import java.util.Set; import java.util.StringTokenizer; @@ -165,16 +162,16 @@ // ----------------------------------------------------- Instance variables /** My request headers, if any. */ - private Map requestHeaders = new HashMap(); + private HeaderGroup requestHeaders = new HeaderGroup(); /** The Status-Line from the response. */ private StatusLine statusLine = null; /** My response headers, if any. */ - private Map responseHeaders = new HashMap(); + private HeaderGroup responseHeaders = new HeaderGroup(); - /** My response footers, if any. */ - private Map responseFooters = null; + /** My response trailer headers, if any. */ + private HeaderGroup responseTrailers = new HeaderGroup(); /** Realms that we tried to authenticate to */ private Set realms = null; @@ -416,12 +413,9 @@ } /** - * Add the specified request header. - * - * If a header of the same name already exists, the new value will be - * appended onto the the existing value list. - * A header value ofnull will be ignored.
- * Note that header-name matching is case insensitive.
+ * Add the specified request header. A header value of
+ * null will be ignored. Note that header-name matching is case
+ * insensitive.
*
* @param header the header to add to the request
*/
@@ -429,9 +423,9 @@
LOG.trace("HttpMethodBase.addRequestHeader(Header)");
if (header == null) {
- LOG.debug("null header value ignored");
+ LOG.debug("null header value ignored");
} else {
- addRequestHeader(header.getName(), header.getValue());
+ getRequestHeaderGroup().addHeader(header);
}
}
@@ -440,10 +434,7 @@
* @param footer The new footer to add.
*/
public void addResponseFooter(Header footer) {
- if (responseFooters == null) {
- responseFooters = new HashMap();
- }
- responseFooters.put(footer.getName().toLowerCase(), footer);
+ getResponseTrailerHeaderGroup().addHeader(footer);
}
/**
@@ -537,7 +528,15 @@
* @param header the header
*/
public void setRequestHeader(Header header) {
- requestHeaders.put(header.getName().toLowerCase(), header);
+
+ Header[] headers = getRequestHeaderGroup().getHeaders(header.getName());
+
+ for (int i = 0; i < headers.length; i++) {
+ getRequestHeaderGroup().removeHeader(headers[i]);
+ }
+
+ getRequestHeaderGroup().addHeader(header);
+
}
/**
@@ -551,8 +550,11 @@
* @return the matching header
*/
public Header getRequestHeader(String headerName) {
- return (headerName == null)
- ? null : (Header) (requestHeaders.get(headerName.toLowerCase()));
+ if (headerName == null) {
+ return null;
+ } else {
+ return getRequestHeaderGroup().getCondensedHeader(headerName);
+ }
}
/**
@@ -561,11 +563,55 @@
* @return an array of my request headers.
*/
public Header[] getRequestHeaders() {
- return (Header[]) (requestHeaders.values().toArray(
- new Header[requestHeaders.size()]));
+ return getRequestHeaderGroup().getAllHeaders();
+ }
+
+ /**
+ * Gets the HeaderGroup storing the request headers.
+ *
+ * @return a HeaderGroup
+ *
+ * @since 2.0beta1
+ */
+ protected HeaderGroup getRequestHeaderGroup() {
+ return requestHeaders;
+ }
+
+ /**
+ * Gets the HeaderGroup storing the response trailer headers as per RFC
+ * 2616 section 3.6.1.
+ *
+ * @return a HeaderGroup
+ *
+ * @since 2.0beta1
+ */
+ protected HeaderGroup getResponseTrailerHeaderGroup() {
+ return responseTrailers;
}
/**
+ * Gets the HeaderGroup storing the response headers.
+ *
+ * @return a HeaderGroup
+ *
+ * @since 2.0beta1
+ */
+ protected HeaderGroup getResponseHeaderGroup() {
+ return responseHeaders;
+ }
+
+ /**
+ * Gets the HeaderGroup storing the response headers.
+ *
+ * @return a HeaderGroup
+ *
+ * @since 2.0beta1
+ */
+ protected void setResponseHeaderGroup(HeaderGroup responseHeaders) {
+ this.responseHeaders = responseHeaders;
+ }
+
+ /**
* Convenience method top provide access to the status code.
*
* @return the status code associated with the latest response.
@@ -593,13 +639,12 @@
}
/**
- * Provide access to the response headers
+ * Gets the response headers in the order in which they were read.
*
* @return an array of my response headers.
*/
public Header[] getResponseHeaders() {
- return (Header[]) (responseHeaders.values().toArray(
- new Header[responseHeaders.size()]));
+ return getResponseHeaderGroup().getAllHeaders();
}
/**
@@ -612,10 +657,12 @@
*
* @return the matching header
*/
- public Header getResponseHeader(String headerName) {
- return (headerName == null)
- ? null
- : (Header) (responseHeaders.get(headerName.toLowerCase()));
+ public Header getResponseHeader(String headerName) {
+ if (headerName == null) {
+ return null;
+ } else {
+ return getResponseHeaderGroup().getCondensedHeader(headerName);
+ }
}
/**
@@ -690,15 +737,11 @@
}
/**
- * Return an array of response footers.
- * @return null if no footers are available
+ * Gets the response footers in the order in which they were read.
+ * @return an array of headers
*/
public Header[] getResponseFooters() {
- if (responseFooters == null) {
- return null;
- }
- return (Header[]) (responseFooters.values().toArray(
- new Header[responseFooters.size()]));
+ return getResponseTrailerHeaderGroup().getAllHeaders();
}
/**
@@ -711,11 +754,11 @@
* @return the matching footer
*/
public Header getResponseFooter(String footerName) {
- if (responseFooters == null) {
+ if (footerName == null) {
return null;
+ } else {
+ return getResponseTrailerHeaderGroup().getCondensedHeader(footerName);
}
- return (footerName == null) ? null
- : (Header) (responseFooters.get(footerName.toLowerCase()));
}
/**
@@ -768,20 +811,7 @@
* @param headerValue the header's value
*/
public void addRequestHeader(String headerName, String headerValue) {
- // "It must be possible to combine the multiple header fields into
- // one "field-name: field-value" pair, without changing the
- // semantics of the message, by appending each subsequent field-value
- // to the first, each separated by a comma."
- // - HTTP/1.0 (4.3)
- Header header = getRequestHeader(headerName);
- if (null == header) {
- // header doesn't exist already, simply create with name and value
- header = new Header(headerName, headerValue);
- } else {
- // header exists, add this value to the comma separated list
- header.setValue(getNewHeaderValue(header, headerValue));
- }
- setRequestHeader(header);
+ addRequestHeader(new Header(headerName, headerValue));
}
/**
@@ -1137,8 +1167,9 @@
followRedirects = false;
doAuthentication = true;
queryString = null;
- requestHeaders.clear();
- responseHeaders.clear();
+ getRequestHeaderGroup().clear();
+ getResponseHeaderGroup().clear();
+ getResponseTrailerHeaderGroup().clear();
statusLine = null;
used = false;
http11 = true;
@@ -1174,7 +1205,12 @@
* @param headerName the header name
*/
public void removeRequestHeader(String headerName) {
- requestHeaders.remove(headerName.toLowerCase());
+
+ Header[] headers = getRequestHeaderGroup().getHeaders(headerName);
+ for (int i = 0; i < headers.length; i++) {
+ getRequestHeaderGroup().removeHeader(headers[i]);
+ }
+
}
// ---------------------------------------------------------------- Queries
@@ -1832,58 +1868,10 @@
*/
protected void readResponseHeaders(HttpState state, HttpConnection conn)
throws IOException, HttpException {
- LOG.trace("enter HttpMethodBase.readResponseHeaders(HttpState,"
- + "HttpConnection)");
+ LOG.trace("enter HttpMethodBase.readResponseHeaders(HttpState, HttpConnection)");
- responseHeaders.clear();
-
- String name = null;
- String value = null;
- for (; ;) {
- String line = conn.readLine();
- if ((line == null) || (line.length() < 1)) {
- break;
- }
-
- // Parse the header name and value
- // Check for folded headers first
- // Detect LWS-char see HTTP/1.0 or HTTP/1.1 Section 2.2
- // discussion on folded headers
- boolean isFolded = false;
- if ((line.charAt(0) == ' ') || (line.charAt(0) == '\t')) {
- // we have continuation folded header
- // so append value
- isFolded = true;
- value = line.substring(1).trim();
- } else {
- // Otherwise we should have normal HTTP header line
- // Parse the header name and value
- int colon = line.indexOf(":");
- if (colon < 0) {
- throw new HttpException("Unable to parse header: " + line);
- }
- name = line.substring(0, colon).trim();
- value = line.substring(colon + 1).trim();
- }
- Header header = getResponseHeader(name);
- if (null == header) {
- header = new Header(name, value);
- } else {
- String oldvalue = header.getValue();
- if (null != oldvalue) {
- if (isFolded) {
- // LWS becomes space plus extended value
- header = new Header(name, oldvalue + " " + value);
- } else {
- // Append additional header value
- header = new Header(name, oldvalue + ", " + value);
- }
- } else {
- header = new Header(name, value);
- }
- }
- setResponseHeader(header);
- }
+ setResponseHeaderGroup(HeaderGroup.parseHeaders(conn.getResponseInputStream()));
+
}
/**
@@ -2048,9 +2036,10 @@
LOG.trace("enter HttpMethodBase.writeRequestHeaders(HttpState,"
+ "HttpConnection)");
addRequestHeaders(state, conn);
- Iterator it = requestHeaders.values().iterator();
- while (it.hasNext()) {
- conn.print(((Header) it.next()).toExternalForm());
+
+ Header[] headers = getRequestHeaders();
+ for (int i = 0; i < headers.length; i++) {
+ conn.print(headers[i].toExternalForm());
}
}
@@ -2136,50 +2125,6 @@
return false;
}
return true;
- }
-
-
- /**
- * "It must be possible to combine the multiple header fields into one
- * "field-name: field-value" pair, without changing the semantics of the
- * message, by appending each subsequent field-value to the first, each
- * separated by a comma."
- * //TODO: This method is trying to make up for deficiencies in Header.
- *
- * @param existingHeader the current header
- * @param value DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- private String getNewHeaderValue(Header existingHeader, String value) {
- String existingValue = existingHeader.getValue();
- if (existingValue == null) {
- existingValue = "";
- }
- String newValue = value;
- if (value == null) {
- newValue = "";
- }
- return existingValue + ", " + newValue;
- }
-
- /**
- * Sets the specified response header.
- * Logs a warning if the header name is null.
- *
- * @param header the header to set.
- *
- * @since 2.0
- */
- private void setResponseHeader(Header header) {
- if (header == null) {
- return;
- }
- if (header.getName() == null) {
- LOG.warn("Invalid header found");
- } else {
- responseHeaders.put(header.getName().toLowerCase(), header);
- }
}
/**
Index: test/org/apache/commons/httpclient/SimpleHttpConnection.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/SimpleHttpConnection.java,v
retrieving revision 1.8
diff -u -r1.8 SimpleHttpConnection.java
--- test/org/apache/commons/httpclient/SimpleHttpConnection.java 31 Jan 2003 23:23:17 -0000 1.8
+++ test/org/apache/commons/httpclient/SimpleHttpConnection.java 10 Feb 2003 00:47:17 -0000
@@ -63,24 +63,24 @@
package org.apache.commons.httpclient;
-import org.apache.commons.httpclient.protocol.Protocol;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-import java.io.StringReader;
+import java.io.OutputStreamWriter;
import java.util.Vector;
+import org.apache.commons.httpclient.protocol.Protocol;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
/**
* For test-nohost testing purposes only.
*
* @author Jeff Dever
+ * @author Michael Becke
*/
class SimpleHttpConnection extends HttpConnection {
@@ -90,8 +90,9 @@
Vector headers = new Vector();
Vector bodies = new Vector();
- BufferedReader headerReader = null;
- ByteArrayInputStream bodyInputStream = null;
+
+ ByteArrayInputStream inputStream;
+
ByteArrayOutputStream bodyOutputStream = null;
public void addResponse(String header) {
@@ -122,26 +123,40 @@
}
public void assertOpen() throws IllegalStateException {
- if (bodyInputStream == null) {
+ if (inputStream == null) {
throw new IllegalStateException();
}
}
public void assertNotOpen() throws IllegalStateException{
- if (bodyInputStream != null) {
+ if (inputStream != null) {
throw new IllegalStateException();
}
}
public void open() throws IOException {
- if (headerReader != null) return;
+ if (inputStream != null) return;
try{
log.debug("hit: " + hits);
- headerReader = new BufferedReader(
- new StringReader((String)headers.elementAt(hits)));
- bodyInputStream = new ByteArrayInputStream(
- HttpConstants.getContentBytes((String)bodies.elementAt(hits)));
+
+ // write the header to a byte array
+ ByteArrayOutputStream headerOutputStream = new ByteArrayOutputStream();
+ OutputStreamWriter writer = new OutputStreamWriter( headerOutputStream );
+ writer.write((String) headers.elementAt(hits));
+ // terminate the headers
+ writer.write("\r\n");
+ writer.close();
+
+ byte[] headerContent = headerOutputStream.toByteArray();
+ byte[] bodyContent = HttpConstants.getContentBytes((String)bodies.elementAt(hits));
+
+ // combine the header and body content so they can be read from one steam
+ byte[] content = new byte[headerContent.length + bodyContent.length];
+ System.arraycopy(headerContent, 0, content, 0, headerContent.length);
+ System.arraycopy(bodyContent, 0, content, headerContent.length, bodyContent.length);
+
+ inputStream = new ByteArrayInputStream( content );
bodyOutputStream = new ByteArrayOutputStream();
hits++;
} catch (ArrayIndexOutOfBoundsException aiofbe) {
@@ -151,13 +166,9 @@
}
public void close() {
- if (headerReader != null) {
- try { headerReader.close(); } catch(IOException e) {}
- headerReader = null;
- }
- if (bodyInputStream != null) {
- try { bodyInputStream.close(); } catch(IOException e) {}
- bodyInputStream = null;
+ if (inputStream != null) {
+ try { inputStream.close(); } catch(IOException e) {}
+ inputStream = null;
}
if (bodyOutputStream != null) {
try { bodyOutputStream.close(); } catch(IOException e) {}
@@ -175,7 +186,7 @@
public String readLine()
throws IOException, IllegalStateException {
- String str = headerReader.readLine();
+ String str = HttpConnection.readLine(inputStream);
log.debug("read: " + str);
return str;
}
@@ -187,7 +198,7 @@
public InputStream getResponseInputStream() {
- return bodyInputStream;
+ return inputStream;
}
public OutputStream getRequestOutputStream() {
Index: test/org/apache/commons/httpclient/SimpleHttpMethod.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/SimpleHttpMethod.java,v
retrieving revision 1.4
diff -u -r1.4 SimpleHttpMethod.java
--- test/org/apache/commons/httpclient/SimpleHttpMethod.java 23 Jan 2003 22:48:25 -0000 1.4
+++ test/org/apache/commons/httpclient/SimpleHttpMethod.java 10 Feb 2003 00:47:17 -0000
@@ -96,26 +96,48 @@
return "Simple";
}
- public Header getResponseHeader(String name) {
- try {
- if(name.equalsIgnoreCase(header.getName())) {
- return header;
- } else {
- return super.getResponseHeader(name);
- }
- } catch(NullPointerException e) {
- return super.getResponseHeader(name);
+ /**
+ * Makes sure any respose header that exists has been added to the response
+ * header group.
+ */
+ private void ensureResponseHeaderIsSet() {
+ if ( header != null ) {
+ super.getResponseHeaderGroup().addHeader(header);
+ header = null;
}
}
+ /**
+ * @see HttpMethod#execute(HttpState, HttpConnection)
+ */
+ public int execute(HttpState state, HttpConnection connection)
+ throws HttpException, IOException {
+ return super.execute(state, connection);
+ }
+
+ /**
+ * @see HttpMethod#getResponseHeader(String)
+ * @deprecated
+ */
+ public Header getResponseHeader(String headerName) {
+ ensureResponseHeaderIsSet();
+ return super.getResponseHeader(headerName);
+ }
- public int execute(HttpState state, HttpConnection conn)
- throws HttpException, IOException{
- return super.execute(state, conn);
- }
+ /**
+ * @see HttpMethod#getResponseHeaderGroup()
+ */
+ public HeaderGroup getResponseHeaderGroup() {
+ ensureResponseHeaderIsSet();
+ return super.getResponseHeaderGroup();
+ }
+
+ /**
+ * @see HttpMethod#getResponseHeaders()
+ */
+ public Header[] getResponseHeaders() {
+ ensureResponseHeaderIsSet();
+ return super.getResponseHeaders();
+ }
- public void addRequestHeaders(HttpState state, HttpConnection conn)
- throws HttpException, IOException{
- super.addRequestHeaders(state, conn);
- }
}
Index: test/org/apache/commons/httpclient/TestNoHost.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestNoHost.java,v
retrieving revision 1.19
diff -u -r1.19 TestNoHost.java
--- test/org/apache/commons/httpclient/TestNoHost.java 28 Jan 2003 05:17:22 -0000 1.19
+++ test/org/apache/commons/httpclient/TestNoHost.java 10 Feb 2003 00:47:17 -0000
@@ -88,6 +88,7 @@
suite.addTest(TestNVP.suite());
suite.addTest(TestHeader.suite());
suite.addTest(TestHeaderElement.suite());
+ suite.addTest(TestHeaderGroup.suite());
suite.addTest(TestAuthenticator.suite());
suite.addTest(TestHttpUrlMethod.suite());
suite.addTest(TestURI.suite());
Index: test/org/apache/commons/httpclient/TestStreams.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestStreams.java,v
retrieving revision 1.8
diff -u -r1.8 TestStreams.java
--- test/org/apache/commons/httpclient/TestStreams.java 23 Jan 2003 22:48:27 -0000 1.8
+++ test/org/apache/commons/httpclient/TestStreams.java 10 Feb 2003 00:47:17 -0000
@@ -101,6 +101,8 @@
footer = method.getResponseFooter("footer2");
assertEquals(footer.getValue(), "fghij");
+ // recycle the method so that it can be reused below
+ method.recycle();
//Test for when buffer is smaller than chunk size.
in = new ChunkedInputStream(new ByteArrayInputStream(HttpConstants.getBytes(correctInput)), method);