vmassol     01/09/16 04:11:03

  Modified:    src/sample/share/org/apache/cactus/sample/unit
                        TestServletTestCase2.java
  Log:
  verify that WebResponse getTextAsArray() can be called several times with the same 
result
  
  Revision  Changes    Path
  1.15      +20 -10    
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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- TestServletTestCase2.java 2001/09/14 20:24:56     1.14
  +++ TestServletTestCase2.java 2001/09/16 11:11:03     1.15
  @@ -77,7 +77,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Vincent Massol</a>
    *
  - * @version $Id: TestServletTestCase2.java,v 1.14 2001/09/14 20:24:56 pier Exp $
  + * @version $Id: TestServletTestCase2.java,v 1.15 2001/09/16 11:11:03 vmassol Exp $
    */
   public class TestServletTestCase2 extends ServletTestCase
   {
  @@ -337,8 +337,9 @@
       //-------------------------------------------------------------------------
   
       /**
  -     * Verify that the <code>AsertUtils.getResponseAsStringArray()</code> method
  -     * works with output text sent on multiple lines.
  +     * Verify that the <code>getTestAsArray()</code> method
  +     * works with output text sent on multiple lines. We also verify that
  +     * we can call it several times with the same result.
        */
       public void testGetResponseAsStringArrayMultiLines() throws IOException
       {
  @@ -350,20 +351,29 @@
       }
   
       /**
  -     * Verify that the <code>AsertUtils.getResponseAsStringArray()</code> method
  -     * works with output text sent on multiple lines.
  +     * Verify that the <code>getTestAsArray()</code> method
  +     * works with output text sent on multiple lines. We also verify that
  +     * we can call it several times with the same result.
        *
        * @param theResponse the response from the server side.
        */
       public void endGetResponseAsStringArrayMultiLines(WebResponse theResponse)
           throws IOException
       {
  -        String[] results = theResponse.getTextAsArray();
  +        String[] results1 = theResponse.getTextAsArray();
  +        String[] results2 = theResponse.getTextAsArray();
   
  -        assert("Should have returned 3 lines of text", results.length == 3);
  -        assertEquals("<html><head/>", results[0]);
  -        assertEquals("<body>A GET request</body>", results[1]);
  -        assertEquals("</html>", results[2]);
  +        assert("Should have returned 3 lines of text but returned [" +
  +            results1.length + "]", results1.length == 3);
  +        assertEquals("<html><head/>", results1[0]);
  +        assertEquals("<body>A GET request</body>", results1[1]);
  +        assertEquals("</html>", results1[2]);
  +
  +        assert("Should have returned 3 lines of text but returned [" +
  +            results2.length + "]", results2.length == 3);
  +        assertEquals("<html><head/>", results2[0]);
  +        assertEquals("<body>A GET request</body>", results2[1]);
  +        assertEquals("</html>", results2[2]);
       }
   
       //-------------------------------------------------------------------------
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to