jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: About TestHTTPSamplersAgainstHttpMirrorServer
Date Sun, 15 Feb 2015 16:38:30 GMT
On 15 February 2015 at 16:21, Philippe Mouawad
<philippe.mouawad@gmail.com> wrote:
> On Sunday, February 15, 2015, sebb <sebbaz@gmail.com> wrote:
>
>> On 14 February 2015 at 17:53, Philippe Mouawad
>> <philippe.mouawad@gmail.com <javascript:;>> wrote:
>> > Hello,
>> > Looking at code of class, I see that in fact HTTPSamplerProxy which is
>> used
>> > by Http Sampler is not tested , instead it appears the class tests :
>> > - HTTPSampler3 (which is not used anywhere anymore, I propose to delete
>> it,
>> > I will create a bugzilla for this )
>>
>> HTTPSampler3 is currently used by test code.
>>
>>  Why not just use HTTPSamplerProxy(HTTPSamplerFactory.IMPL_HTTP_CLIENT4);
> instead ?

You said it was not used. But it is.

Replacing it with a call to HTTPSamplerProxy is a separate issue.

>> - HTTPSampler2 (used by SoapSampler)
>> > - HTTPSampler
>> >
>> >
>> > I suggest we replace code by :
>> >     private HTTPSamplerBase createHttpSampler(int samplerType) {
>> >         switch(samplerType) {
>> >             case HTTP_SAMPLER:
>> >                 return new
>> > HTTPSamplerProxy(HTTPSamplerFactory.HTTP_SAMPLER_JAVA);
>> >             case HTTP_SAMPLER2:
>> >                 return new
>> > HTTPSamplerProxy(HTTPSamplerFactory.IMPL_HTTP_CLIENT3_1);
>> >             case HTTP_SAMPLER3:
>> >                 return new
>> > HTTPSamplerProxy(HTTPSamplerFactory.IMPL_HTTP_CLIENT4);
>> >             default:
>> >                 break;
>> >         }
>> >         throw new IllegalArgumentException("Unexpected type:
>> "+samplerType);
>> >     }
>> >
>> > If everybody is OK , I will create a bugzilla for this.
>>
>> That assumes HTTPSamplerProxy is working OK.
>
> I don't understand what you mean here.
> Shouldn't this class be the one under kunit tests instead of ones that are
> rarely or not used.

Probably, but again that is a slightly different issue.

>> So I don't think it is a good replacement without further tests to
>> check HTTPSamplerProxy actually does what one expects/
>
>
> I don't understand sebb.

There are no tests to ensure that HTTPSamplerProxy actually generates
the correct sampler.
It could always return the JAVA sampler and AFAICT the existing tests
would not catch that.

There need to be tests that ensure HTTPSamplerProxy is working as expected.
Otherwise tests that depend on it working correctly are not very useful.

>>
>> > I also suggest we replace new HttpSampler() by :
>> > return new HTTPSamplerProxy(HTTPSamplerFactory.HTTP_SAMPLER_JAVA);
>>
>> Where is this to be replaced?

Mime
View raw message