I think it would be good to put this stuff in the response object, but
I'm thinking a richer hierarchy might help. For instance, header/body
distinction doesn't make much sense for jdbc results. I think we should
come up with a core of response info, make a base class to reflect that,
and then make children classes to add further details -
SamplerResult
- getTime, getTimeStamp(),getResponseData(),getRequestData(), etc
HeaderBodyResult
- getHeader(), getBody(), -getResponseData() would return the two
put together
HTTPResult
- This object might know how to extract all the info it needs given
an open HTTPUrlConnection object. (just a thought)
The listeners would need some adjustment to deal with this.
So, I'm mostly agreeing with you, just adding to the idea, really.
-Mike
On Sat, 2005-04-09 at 14:46 +0100, sebb wrote:
> Just noticed that HTTPSampler sets responseData to the full response
> read from the connection, whereas HTTPSampler2 sets it to the response
> Body only.
>
> Seems to me that's a bug in HTTPSampler2.
>
> It got me thinking that perhaps the various SampleResult classes could
> be enhanced to make the distinction clearer, and to make it easy to
> get at the various parts of the full response.
>
> There are currently bits of code dotted around that search
> responseData for the blank line in order to get just the response
> body. Seems to me this code should be moved to the SampleResult
> classes.
>
> How about:
>
> SampleResult
> - responseData should always have the full response (i.e fix HTTPSampler2)
> - add responseBody() method which returns responseData
> - add responseHeaders() which returns the empty byte[] - or perhaps
> throws an Exception?
>
> HTTPSampleResult
> - override the responseBody() and responseHeaders() methods
> - to avoid always storing the response twice, the methods could create
> the sections on demand. But might as well store the position of the
> blank line once found.
>
> I'm not familiar with the various other protocols (SOAP) etc so I
> don't know if this would fit well with these.
>
> Any other suggestions?
>
> I will fix HTTPSampler2 anyway.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]