vmassol 01/12/17 05:12:58
Modified: src/sample/share/org/apache/cactus/sample/unit
TestServletTestCase2.java
Log:
new test case for verifying it is possible to add a content type header to set the
content type (it is also possible by using the setContentType() method)
Revision Changes Path
1.22 +22 -1
jakarta-cactus/src/sample/share/org/apache/cactus/sample/unit/TestServletTestCase2.java
Index: TestServletTestCase2.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/src/sample/share/org/apache/cactus/sample/unit/TestServletTestCase2.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- TestServletTestCase2.java 2001/12/15 22:48:54 1.21
+++ TestServletTestCase2.java 2001/12/17 13:12:58 1.22
@@ -77,7 +77,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Vincent Massol</a>
*
- * @version $Id: TestServletTestCase2.java,v 1.21 2001/12/15 22:48:54 vmassol Exp $
+ * @version $Id: TestServletTestCase2.java,v 1.22 2001/12/17 13:12:58 vmassol Exp $
*/
public class TestServletTestCase2 extends ServletTestCase
{
@@ -662,6 +662,27 @@
assertEquals("<data>some data to send in the body</data>",
body.toString());
+ assertEquals("text/xml", request.getContentType());
+ }
+
+ //-------------------------------------------------------------------------
+
+ /**
+ * Verify we can set the content type by setting an HTTP header.
+ *
+ * @param theRequest the request object that serves to initialize the
+ * HTTP connection to the server redirector.
+ */
+ public void beginSetContentTypeHeader(WebRequest theRequest)
+ {
+ theRequest.addHeader("Content-type", "text/xml");
+ }
+
+ /**
+ * Verify we can set the content type by setting an HTTP header.
+ */
+ public void testSetContentTypeHeader()
+ {
assertEquals("text/xml", request.getContentType());
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>