commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Paquette <mpaqu...@covansys.com>
Subject Re: [httpclient] More HttpMultiClient patches - initial strict m ode stuff
Date Wed, 20 Feb 2002 15:19:16 GMT


Marc Saegesser wrote:

>I haven't had a chance to look at the existing test cases in depth yet.  I
>should be able to duplicate the existing test cases for the HttpMethod based
>stuff into tests for the HttpUrlMethod classes without much trouble.  I'll
>see what I can do.  
>
>The other stuff is a little harder to test.  For example, testing the 100
>status respose thing requires finding a server that repeatably sends the
>response at the unexpected time.  The only one I have right now is my online
>banking site and I'm not posting my username/password for that site into the
>test cases :-)  Same thing for the broken relative Location header.  
>
As for status-code = 100, Orion (www.orionserver.com) does send a 100 
followed by a 200 responding to POST (tested with 1.5.2).   Here is an 
output with httpclient.simplelog.defaultlog=INFO running test-local with 
the test webapp installed in an Orion 1.5.2 server:

2002/02/20 09:49:19:928 EST [INFO] >> "POST /httpclienttest/params HTTP/1.1
"
2002/02/20 09:49:19:929 EST [INFO] >> "Host: napa
"
2002/02/20 09:49:19:933 EST [INFO] >> "Content-Length: 0
"
2002/02/20 09:49:19:934 EST [INFO] >> "User-Agent: Jakarta HTTP 
Client/2.0.0a1
"
2002/02/20 09:49:19:934 EST [INFO] >> \r\n
2002/02/20 09:49:20:040 EST [INFO] << "HTTP/1.1 100 Continue" [\r\n]
2002/02/20 09:49:20:041 EST [INFO] << "Server: Orion/1.5.2" [\r\n]
2002/02/20 09:49:20:042 EST [INFO] << "Date: Wed, 20 Feb 2002 14:49:19 
GMT" [\r\n]
2002/02/20 09:49:20:043 EST [INFO] << "HTTP/1.1 200 OK
Date: Wed, 20 Feb 2002 14:49:19 GMT
Server: Orion/1.5.2
Connection: Close
Content-Type: text/html
Transfer-Encoding: chunked

"
2002/02/20 09:49:20:130 EST [INFO] << "ab
<html>
<head><title>Param Servlet: POST</title></head>
<body>
<p>This is a response to an HTTP POST request.</p>
<p>QueryString=null</p>
<p>Parameters</p>
</body>
</html>

0

"
2002/02/20 09:49:20:132 EST [WARN] HttpMethodBase.execute(): received 
100 response, but I've already sent the response.



 I suppose that the (external) testcases could try to hit 
www.orionserver.com with a POST (with evermind's permission I guess).

For local testcases, a test could be designed to do a POST with a 
success if response has 100 followed by 200 without any execption, a 
failure if reception of 100 raises an exception and neutral if no 100 
have been generated.  The challenge is to assess if the server produced 
100-followed-by-200 or only 200...  maybe Servlet filters could help here...

Wait a minute, why not simply use a servlet filter in the test-webapp to 
inject a status-code=100 in the response ?  This would then be server 
independent...(as long as the server supports Servlet API 2.3 :-)).


Unfortunately, I don't have time right now to write this test...

>
>
>As for time to deal with this stuff.  I've been a jakarta-tomcat committer
>for over year.  I worked primarily on the 3.2.x stuff and since that's now
>over I've got time to spend elsewhere.  Since I'm working heavily on
>HttpClient for my own application I'd be more than happy to help out around
>here if the other committers will have me.
>
>
>Marc Saegesser 
>
>>-----Original Message-----
>>From: dIon Gillard [mailto:dion@multitask.com.au]
>>Sent: Tuesday, February 19, 2002 4:39 PM
>>To: Jakarta Commons Developers List
>>Subject: Re: [httpclient] More HttpMultiClient patches - 
>>initial strict
>>mode stuff
>>
>>
>>Marc Saegesser wrote:
>>
>>>The attached are three patches that update my previous 
>>>
>>patches for the
>>
>>>HttpMultiClient stuff.
>>>
>>>HttpMethodBase.java - Fixes a bug I created when I tried to 
>>>
>>fix the broken
>>
>>>handling of a 100 status codes.  I had this working 
>>>
>>correctly once, but due
>>
>>>to sever fumble fingered-ness I trashed it.  When I 
>>>
>>re-implemented it I did
>>
>>>it wrong.  Anywhere, this version handes 100 status codes 
>>>
>>correctly.  I also
>>
>>>added some preliminary support for 
>>>
>>StrictMode/Non-StrictMode.  This is the
>>
>>>stuff I was talking about before where we need to support sites that
>>>implement HTTP incorrectly.  The first case I've dealt with 
>>>
>>is a site that
>>
>>>returns a relative path in the Location header for a 
>>>
>>redirect.  If strict
>>
>>>mode is not enabled I attempt to build a new URL in the 
>>>
>>context of the
>>
>>>current request.
>>>
>>>HttpMethod.java - Added accessor methods for strictMode.
>>>
>>>HttpMultiClient.java - Added accessor methods for 
>>>
>>strictMode.  Updated
>>
>>>executeMethod() to set the strictMode for each request.
>>>
>>>
>>>Marc Saegesser 
>>>
>>Hi Marc,
>>
>>just to let you know, I'm digesting the original patches you 
>>made, but 
>>given HttpClient isn't my full time thing, it's taking a 
>>while. Do you 
>>have any test cases for the patches/new functionality that 
>>can be used 
>>to verify the code?
>>
>>That sort of stuff would help me enormously.
>>
>>>     
>>>
>>-- 
>>
>>dIon Gillard, Multitask Consulting
>>http://www.multitask.com.au/developers
>>
>>
>>
>>
>>--
>>To unsubscribe, e-mail:   
>><mailto:commons-dev-unsubscribe@jakarta.apache.org>
>>For additional commands, e-mail: 
>><mailto:commons-dev-help@jakarta.apache.org>
>>
>
>--
>To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>
>

-- 

Marc Paquette
Conseiller Principal, Architecture de solutions, WEI
Tel: 514-288-4680 x2028 (boite vocale: 8008)
mpaquett@covansys.com




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