commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: jakarta-commons/latka/src/test/org/apache/commons/latka/jelly TestGetTag.java
Date Sat, 06 Jul 2002 15:40:45 GMT
dion        2002/07/06 08:40:44

  Modified:    latka/src/test/org/apache/commons/latka/jelly
                        TestGetTag.java
  Log:
  Added parameters and request headers
  
  Revision  Changes    Path
  1.2       +38 -4     jakarta-commons/latka/src/test/org/apache/commons/latka/jelly/TestGetTag.java
  
  Index: TestGetTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/latka/src/test/org/apache/commons/latka/jelly/TestGetTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestGetTag.java	6 Jul 2002 14:37:44 -0000	1.1
  +++ TestGetTag.java	6 Jul 2002 15:40:44 -0000	1.2
  @@ -61,6 +61,7 @@
   
   package org.apache.commons.latka.jelly;
   
  +import org.apache.commons.httpclient.NameValuePair;
   import junit.framework.TestCase;
   
   /**
  @@ -99,4 +100,37 @@
           assertEquals("resolved url is not url", dummyURL, 
               instance.getResolvedUrl());
       }
  +    
  +    /**
  +     * test parameters
  +     */
  +    public void testParameters() {
  +        assertEquals("inital parameters aren't empty", 0, 
  +            instance.getParameters().size());
  +        String param = "param1";
  +        String value = "value1";
  +        instance.addParameter(param, value);
  +        assertEquals("parameter not added correctly", 1, 
  +            instance.getParameters().size());
  +        NameValuePair nvp = (NameValuePair) instance.getParameters().get(0);
  +        assertEquals("param name is bad", param, nvp.getName());
  +        assertEquals("param value is bad", value, nvp.getValue());
  +    }
  +    
  +    /**
  +     * test request headers
  +     */
  +    public void testRequestHeaders() {
  +        assertEquals("inital headers aren't empty", 0, 
  +            instance.getRequestHeaders().size());
  +        String header = "header1";
  +        String value = "value1";
  +        instance.addRequestHeader(header, value);
  +        assertEquals("header not added correctly", 1, 
  +            instance.getRequestHeaders().size());
  +        NameValuePair nvp = (NameValuePair) instance.getRequestHeaders().get(0);
  +        assertEquals("header name is bad", header, nvp.getName());
  +        assertEquals("param value is bad", value, nvp.getValue());
  +    }
  +
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message