cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nicola...@apache.org
Subject cvs commit: xml-cocoon2/src/test/org/apache/cocoon/util/test NetUtilsTestCase.java
Date Tue, 19 Mar 2002 17:16:18 GMT
nicolaken    02/03/19 09:16:18

  Modified:    src/test/org/apache/cocoon/util/test NetUtilsTestCase.java
  Log:
  Corrected test case.  /bar with a,b and c,d  outputted  /bar?c=d&a=b which is correct
AFAIK but it failed the test.
  
  Revision  Changes    Path
  1.3       +23 -7     xml-cocoon2/src/test/org/apache/cocoon/util/test/NetUtilsTestCase.java
  
  Index: NetUtilsTestCase.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/test/org/apache/cocoon/util/test/NetUtilsTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NetUtilsTestCase.java	22 Feb 2002 07:05:08 -0000	1.2
  +++ NetUtilsTestCase.java	19 Mar 2002 17:16:18 -0000	1.3
  @@ -62,7 +62,8 @@
    * @see org.apache.cocoon.util.NetUtils
    *
    * @author     <a href="mailto:berni_huber@a1.net">Bernhard Huber</a>
  - * @version    CVS $Id: NetUtilsTestCase.java,v 1.2 2002/02/22 07:05:08 cziegeler Exp $
  + * @author     <a href="mailto:nicolaken@apache.org">Nicola Ken Barozzi</a>
  + * @version    CVS $Id: NetUtilsTestCase.java,v 1.3 2002/03/19 17:16:18 nicolaken Exp $
    */
   public class NetUtilsTestCase extends TestCase
   {
  @@ -286,13 +287,9 @@
        */
       public void testParameterize() throws Exception {
           Map parameters1 = new HashMap();
  -        Map parameters2 = new HashMap();
  -        parameters2.put("a", "b");
  -        parameters2.put("c", "d");
   
           Object[] test_values = {
                   new Object[]{"/foo/bar", parameters1, "/foo/bar"},
  -                new Object[]{"bar", parameters2, "bar?a=b&c=d"},
                   };
           for (int i = 0; i < test_values.length; i++) {
               Object tests[] = (Object[]) test_values[i];
  @@ -304,6 +301,25 @@
               String message = "Test " + "'" + test + "'";
               assertEquals(message, expected, result);
           }
  -    }
  -}
   
  +        Map parameters2 = new HashMap();
  +        parameters2.put("a", "b");
  +        parameters2.put("c", "d");
  +        
  +        String test = "bar";
  +        String expected1 = "bar?a=b&c=d";
  +        String expected2 = "bar?c=d&a=b";
  +        
  +        String message = "Test " + "'" + test + "'";
  +                    
  +        String result = NetUtils.parameterize(test, parameters2);        
  +
  +        if(expected1.equals(result)){
  +          assertEquals(message, expected1, result);  
  +        }
  +        else{
  +          assertEquals(message, expected2, result);  
  +        }
  +                              
  +    }
  +}
  \ No newline at end of file
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message