You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by cm...@apache.org on 2003/05/07 23:42:50 UTC

cvs commit: jakarta-cactus/samples/servlet/src/test-cactus/share/org/apache/cactus/sample/unit TestHttpResponse.java

cmlenz      2003/05/07 14:42:50

  Modified:    samples/servlet/src/test-cactus/share/org/apache/cactus/sample/unit
                        Tag: CACTUS_14_ANT_BRANCH TestHttpResponse.java
  Log:
  In the SetContentType test, add some XML content to the response.
  Otherwise the test fails on Orion (1.6.0b and 2.0.1), because for some reason the content-type is reset to text/html.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.1   +10 -3     jakarta-cactus/samples/servlet/src/test-cactus/share/org/apache/cactus/sample/unit/TestHttpResponse.java
  
  Index: TestHttpResponse.java
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/samples/servlet/src/test-cactus/share/org/apache/cactus/sample/unit/TestHttpResponse.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- TestHttpResponse.java	17 Mar 2003 19:30:32 -0000	1.3
  +++ TestHttpResponse.java	7 May 2003 21:42:50 -0000	1.3.2.1
  @@ -240,11 +240,18 @@
       /**
        * Verify we can set and retrieve the content type.
        */
  -    public void testSetContentType()
  +    public void testSetContentType() throws IOException
       {
           response.setContentType("text/xml");
  +
  +        // Although we don't assert the written content, this is needed to make
  +        // the test succeed on some versions of Orion. If the content is left 
  +        // empty, Orion will somehow reset the content-type to text/html. Sigh.
  +        PrintWriter pw = response.getWriter();
  +        pw.println("<?xml version=\"1.0\"?>");
  +        pw.println("<test></test>");
       }
  -    
  +
       /**
        * Verify we can set and retrieve the content type.
        * 
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org