vmassol 2004/06/19 08:10:53
Modified:
samples/servlet/src/test-cactus/share/org/apache/cactus/sample/servlet/unit
TestHttpResponse.java
documentation/docs/xdocs changes.xml
framework/src/java/share-12-13-14/org/apache/cactus/internal/client/connector/http
AutoReadHttpURLConnection.java
Log:
<action dev="VMA" type="fix" issue="CACTUS-123" due-to="Maxwell
Grender-Jones">
Cactus was failing with a <code>NullPointerException</code> if the
response was not returning any output stream (which happens if
<code>response.setStatus(HttpServletResponse.SC_NO_CONTENT)</code> is
called for example).
</action>
Revision Changes Path
1.5 +21 -1
jakarta-cactus/samples/servlet/src/test-cactus/share/org/apache/cactus/sample/servlet/unit/TestHttpResponse.java
Index: TestHttpResponse.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/samples/servlet/src/test-cactus/share/org/apache/cactus/sample/servlet/unit/TestHttpResponse.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TestHttpResponse.java 1 Apr 2004 17:50:48 -0000 1.4
+++ TestHttpResponse.java 19 Jun 2004 15:10:52 -0000 1.5
@@ -279,4 +279,24 @@
assertEquals(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
theResponse.getStatusCode());
}
+
+ //-------------------------------------------------------------------------
+
+ /**
+ * Verify that we can return a NO_CONTENT response.
+ */
+ public void testNoContentResponseCode()
+ {
+ response.setStatus(HttpServletResponse.SC_NO_CONTENT);
+ }
+
+ /**
+ * Verify that we can return a NO_CONTENT response.
+ *
+ * @param theResponse the response from the server side.
+ */
+ public void endNoContentResponseCode(WebResponse theResponse)
+ {
+ assertEquals(theResponse.getStatusCode(), 204);
+ }
}
1.199 +6 -0 jakarta-cactus/documentation/docs/xdocs/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/jakarta-cactus/documentation/docs/xdocs/changes.xml,v
retrieving revision 1.198
retrieving revision 1.199
diff -u -r1.198 -r1.199
--- changes.xml 8 Jun 2004 07:33:12 -0000 1.198
+++ changes.xml 19 Jun 2004 15:10:52 -0000 1.199
@@ -90,6 +90,12 @@
</devs>
<release version="1.7dev" date="in CVS">
+ <action dev="VMA" type="fix" issue="CACTUS-123" due-to="Maxwell
Grender-Jones">
+ Cactus was failing with a <code>NullPointerException</code> if the
+ response was not returning any output stream (which happens if
+ <code>response.setStatus(HttpServletResponse.SC_NO_CONTENT)</code> is
+ called for example).
+ </action>
<action dev="VMA" type="fix" issue="CACTUS-122" due-to="Raphael Philipe
Mendes da Silva">
Fixed "<code>java.lang.NumberFormatException: For input string:
"localhost"</code>" error that was happening when using the
1.2 +2 -2
jakarta-cactus/framework/src/java/share-12-13-14/org/apache/cactus/internal/client/connector/http/AutoReadHttpURLConnection.java
Index: AutoReadHttpURLConnection.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/framework/src/java/share-12-13-14/org/apache/cactus/internal/client/connector/http/AutoReadHttpURLConnection.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AutoReadHttpURLConnection.java 22 May 2004 11:34:46 -0000 1.1
+++ AutoReadHttpURLConnection.java 19 Jun 2004 15:10:53 -0000 1.2
@@ -179,7 +179,7 @@
LOGGER.debug("Content-Length : [" + this.delegate.getContentLength()
+ "]");
- if (this.delegate.getContentLength() != 0)
+ if (theInputStream != null && this.delegate.getContentLength() != 0)
{
byte[] buf = new byte[DEFAULT_CHUNK_SIZE];
int count;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]