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/jelly latka.jelly
Date Tue, 09 Jul 2002 17:28:00 GMT
dion        2002/07/09 10:28:00

  Modified:    latka/src/jelly latka.jelly
  Log:
  Tests for cookie tag
  
  Revision  Changes    Path
  1.14      +35 -13    jakarta-commons/latka/src/jelly/latka.jelly
  
  Index: latka.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/latka/src/jelly/latka.jelly,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- latka.jelly	8 Jul 2002 01:53:19 -0000	1.13
  +++ latka.jelly	9 Jul 2002 17:28:00 -0000	1.14
  @@ -2,13 +2,14 @@
   <j:jelly
       xmlns:j="jelly:core"
       xmlns="jelly:org.apache.commons.latka.jelly.LatkaTagLibrary"
  -    >
  -
  +    trim="false">
     <!-- a latka suite - not really sure if we need this anymore -->
     <suite>
       <!-- a session holds shared http state info -->
       <session>
       <!--<session proxyHost="1.1.1.205" proxyPort="8080">-->
  +Tests for Get tag
  +-----------------
           <get id="mtc" uri="http://www.multitask.com.au/"/>
           <j:if test='${mtc.statusCode == 200}'>
               request ok
  @@ -16,10 +17,12 @@
           Results for mtc url are: http return code = ${mtc.statusCode}
           size of result = ${mtc.responseBodyAsString.length()}
           response time = ${mtc.responseTime}
  +        <!-- bytelength validation on the request/response -->
  +        <bytelength requestId="mtc" max="2400">MTC URL too big</bytelength>
           <j:forEach items="${mtc.responseHeaders}" var="header" indexVar="i">
               header[${i}] = ${header}
           </j:forEach>
  -
  +        <!-- test parameters and headers -->
           <get id="mtc2" uri="http://www.multitask.com.au/default.html">
               <parameter name="page" value="mt @News"/>
               <parameter name="page2" value="junk"/>
  @@ -30,11 +33,12 @@
           <j:forEach items="${mtc2.requestHeaders}" var="rHeader" indexVar="i">
               reqHeader[${i}] = ${rHeader}
           </j:forEach>
  -        
  +        <!-- test a 404 -->
           <get id="badurl" uri="http://www.multitask.com.au/snafu.html"/>
           http return code = ${badurl.statusCode}
           bad response time = ${badurl.responseTime} in msec
  -        
  +Tests for Post tag
  +------------------
           <post id="jdc" uri="http://developer.java.sun.com/servlet/SessionServlet">
               <parameter name="action" value="login" />
               <parameter name="url" value="/developer/index.jshtml" />
  @@ -47,21 +51,21 @@
           <j:forEach items="${jdc.responseHeaders}" var="header" indexVar="i">
               jdc.header[${i}] = ${header}
           </j:forEach>
  -
  -        head tag test results        
  +Tests for Head tag
  +------------------
           <head id="jakarta" uri="http://jakarta.apache.org/"/>
           <j:forEach items="${jakarta.responseHeaders}" var="header" indexVar="i">
               header[${i}] = ${header}
           </j:forEach>
  -        
  -        options tag test results
  +Tests for Options tag
  +---------------------
           <options id="ms" uri="http://www.microsoft.com/"/>
           <j:forEach items="${ms.responseHeaders}" var="header" indexVar="i">
               header[${i}] = ${header}
           </j:forEach>
  -
  +Tests for Body tag
  +------------------
           <j:set var="googleKey" value="00000000000000000000000000000000" />
  -        
           <post id="google" uri="http://api.google.com/search/beta2">
               <header name="Content-Type" value="text/xml"/>
               <body>
  @@ -90,10 +94,28 @@
           <j:forEach items="${google.requestHeaders}" var="rHeader" indexVar="i">
               reqHeader[${i}] = ${rHeader}
           </j:forEach>
  -        
           google response = ${google.statusCode}, ${google.statusText}
           ${google.responseBodyAsString}
  -       
  +    </session>
  +    
  +    <session>
  +Tests for Cookie tag
  +---------------------
  +        <post id="ph" uri="http://www.pizzahut.com.au/logon.do">
  +            <parameter name="username" value="xxx"/>
  +            <parameter name="password" value="xxx"/>
  +            <parameter name="actionToDo" value="continue"/>
  +            <parameter name="target" value="registration"/>
  +        </post>
  +        SC: ${ph.getResponseHeader("Set-Cookie")}
  +        <!-- make sure a uid cookie comes back -->
  +        <cookie requestId="ph" name="Apache">no apache cookie</cookie>
  +        <!-- show how to dump cookie name/value pairse -->
  +        <j:forEach items='${ph.getResponseHeader("Set-Cookie").values}'
  +            var="element" indexVar="i">
  +            element[${i}] = ${element}
  +        </j:forEach>
  +
       </session>
     </suite>
     
  
  
  

--
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