vmassol     01/08/25 04:01:22

  Modified:    cactus/src/test/share/org/apache/commons/cactus TestAll.java
  Added:       cactus/src/test/share/org/apache/commons/cactus
                        TestWebResponse.java
  Removed:     cactus/src/test/share/org/apache/commons/cactus/util
                        TestAssertUtils.java
  Log:
  calls WebResponse for the implementation as AssertUtils is now deprecated in favor 
of WebResponse
  
  Revision  Changes    Path
  1.5       +2 -2      
jakarta-commons/cactus/src/test/share/org/apache/commons/cactus/TestAll.java
  
  Index: TestAll.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/cactus/src/test/share/org/apache/commons/cactus/TestAll.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestAll.java      2001/08/24 16:23:19     1.4
  +++ TestAll.java      2001/08/25 11:01:22     1.5
  @@ -62,7 +62,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Vincent Massol</a>
    *
  - * @version $Id: TestAll.java,v 1.4 2001/08/24 16:23:19 vmassol Exp $
  + * @version $Id: TestAll.java,v 1.5 2001/08/25 11:01:22 vmassol Exp $
    */
   public class TestAll extends TestCase
   {
  @@ -95,7 +95,7 @@
           TestSuite suite =
               new TestSuite("Cactus unit tests not needing servlet engine");
   
  -        suite.addTest(org.apache.commons.cactus.util.TestAssertUtils.suite());
  +        suite.addTest(org.apache.commons.cactus.TestWebResponse.suite());
           suite.addTest(org.apache.commons.cactus.TestAbstractTestCase.suite());
   
           return suite;
  
  
  
  1.1                  
jakarta-commons/cactus/src/test/share/org/apache/commons/cactus/TestWebResponse.java
  
  Index: TestWebResponse.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Cactus", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  package org.apache.commons.cactus;
  
  import java.util.*;
  
  import junit.framework.*;
  import org.apache.commons.cactus.*;
  import org.apache.commons.cactus.util.*;
  
  /**
   * Unit tests of the <code>WebResponse</code> class.
   *
   * @author <a href="mailto:[EMAIL PROTECTED]";>Vincent Massol</a>
   *
   * @version $Id: TestWebResponse.java,v 1.1 2001/08/25 11:01:22 vmassol Exp $
   */
  public class TestWebResponse extends TestCase
  {
      /**
       * Defines the testcase name for JUnit.
       *
       * @param theName the testcase's name.
       */
      public TestWebResponse(String theName)
      {
          super(theName);
      }
  
      /**
       * Start the tests.
       *
       * @param theArgs the arguments. Not used
       */
      public static void main(String[] theArgs)
      {
          junit.ui.TestRunner.main(new String[] {
              TestWebResponse.class.getName()});
      }
  
      /**
       * @return a test suite (<code>TestSuite</code>) that includes all methods
       *         starting with "test"
       */
      public static Test suite()
      {
          // All methods starting with "test" will be executed in the test suite.
          return new TestSuite(TestWebResponse.class);
      }
  
      public void testParseSetCookieHeader1()
      {
          WebResponse response = new WebResponse(null);
          Vector cookies = response.parseSetCookieHeader(
              "testcookie=value;Domain=jakarta.apache.org");
  
          assert(cookies.size() == 1);
          ClientCookie cookie = (ClientCookie)cookies.elementAt(0);
          assertEquals("testcookie", cookie.getName());
          assertEquals("value", cookie.getValue());
          assertEquals("jakarta.apache.org", cookie.getDomain());
          assert(cookie.getComment() == null);
          assert(cookie.getMaxAge() == 0);
          assert(cookie.getPath() == null);
          assert(cookie.isSecure() == false);
          assert(cookie.getVersion() == 1);
      }
  
      public void testParseSetCookieHeader2()
      {
          WebResponse response = new WebResponse(null);
          Vector cookies = response.parseSetCookieHeader(
              "testcookie=value; domain=jakarta.apache.org");
  
          assert(cookies.size() == 1);
          ClientCookie cookie = (ClientCookie)cookies.elementAt(0);
          assertEquals("testcookie", cookie.getName());
          assertEquals("value", cookie.getValue());
          assertEquals("jakarta.apache.org", cookie.getDomain());
          assert(cookie.getComment() == null);
          assert(cookie.getMaxAge() == 0);
          assert(cookie.getPath() == null);
          assert(cookie.isSecure() == false);
          assert(cookie.getVersion() == 1);
      }
  
  }
  
  

Reply via email to