You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by Philippe Mouawad <ph...@gmail.com> on 2013/07/01 17:06:33 UTC

Refactoring in HTTPHC4Impl

Hello,
As per sebb request, I ask before implementing :-)

I would like to refactor slightly HTTPHC4Impl to allow inheritance from it
to reuse many of already implemented and useful internals.
This would be useful to classes that which for example to post binary
content and similar stuff.

Are you ok with it ? Can I open a bugzilla and do it ?

Thanks
-- 
Regards.
Philippe.

Re: Refactoring in HTTPHC4Impl

Posted by Philippe Mouawad <ph...@gmail.com>.
Hello Immanuel,
I am sorry I didn't get everything.
Could you clarify what was the use case and what did you do to handle it ?
Did you code a custom HTTP Sampler ? did you modify existing code ?

Thanks
Regards
Philippe

On Mon, Jul 1, 2013 at 8:06 PM, Immanuel Hayden
<im...@gmail.com>wrote:

> Hi!
>
> I got only one request regarding this which is to make sure that the
> "server" can still contain part of the address
> eg server = api.example.com/V2/
> address = testservice.svc/health
> because I use that quite heavily in my testcases, as locally the project
> runs directly on localhost with no subdirectory and on the servers it runs
> in the Vx subdirectories -> devs and myself just have to change one line
> and not every sampler if they want to try something.
>
> in any case, thx for the great work :)
> br,
> Imm
>
>
> On 1 July 2013 17:18, Philippe Mouawad <ph...@gmail.com> wrote:
>
> > Created bug:
> > https://issues.apache.org/bugzilla/show_bug.cgi?id=55175
> >
> > Waiting for your feedback before commit.
> >
> > On Mon, Jul 1, 2013 at 5:06 PM, Philippe Mouawad <
> > philippe.mouawad@gmail.com
> > > wrote:
> >
> > > Hello,
> > > As per sebb request, I ask before implementing :-)
> > >
> > > I would like to refactor slightly HTTPHC4Impl to allow inheritance from
> > it
> > > to reuse many of already implemented and useful internals.
> > > This would be useful to classes that which for example to post binary
> > > content and similar stuff.
> > >
> > > Are you ok with it ? Can I open a bugzilla and do it ?
> > >
> > > Thanks
> > > --
> > > Regards.
> > > Philippe.
> > >
> > >
> > >
> >
> >
> > --
> > Cordialement.
> > Philippe Mouawad.
> >
>



-- 
Cordialement.
Philippe Mouawad.

Re: Refactoring in HTTPHC4Impl

Posted by Immanuel Hayden <im...@gmail.com>.
been there, tried that, way less convenient.
had something like this:
server = ${server}
url = ${version}/testservice.svc
which is okay if you have only a handful of samplers or you can copy/paste,
but if you have many different samplers with hugely different endpoints and
assertions / extractors attached like me it is quite tedious to have that
string everywhere (among other reasons because $,{ and } are very annoying
to type on german keyboards).
Or is there some way to set a common prefix in a http request defaults or
similar?


On 2 July 2013 01:13, sebb <se...@gmail.com> wrote:

> On 1 July 2013 19:06, Immanuel Hayden <im...@gmail.com> wrote:
> > Hi!
> >
> > I got only one request regarding this which is to make sure that the
> > "server" can still contain part of the address
> > eg server = api.example.com/V2/
> > address = testservice.svc/health
> > because I use that quite heavily in my testcases, as locally the project
> > runs directly on localhost with no subdirectory and on the servers it
> runs
> > in the Vx subdirectories -> devs and myself just have to change one line
> > and not every sampler if they want to try something.
>
> I'm not sure we can guarantee that, as this behaviour is likely an
> accident of the way the HTTP code is implemented. It's certainly not
> documented as being supported by JMeter, and might have to change.
>
> There are other ways to achieve the same effect, e.g. by using a test
> plan variable.
>
> > in any case, thx for the great work :)
> > br,
> > Imm
> >
> >
> > On 1 July 2013 17:18, Philippe Mouawad <ph...@gmail.com>
> wrote:
> >
> >> Created bug:
> >> https://issues.apache.org/bugzilla/show_bug.cgi?id=55175
> >>
> >> Waiting for your feedback before commit.
> >>
> >> On Mon, Jul 1, 2013 at 5:06 PM, Philippe Mouawad <
> >> philippe.mouawad@gmail.com
> >> > wrote:
> >>
> >> > Hello,
> >> > As per sebb request, I ask before implementing :-)
> >> >
> >> > I would like to refactor slightly HTTPHC4Impl to allow inheritance
> from
> >> it
> >> > to reuse many of already implemented and useful internals.
> >> > This would be useful to classes that which for example to post binary
> >> > content and similar stuff.
> >> >
> >> > Are you ok with it ? Can I open a bugzilla and do it ?
> >> >
> >> > Thanks
> >> > --
> >> > Regards.
> >> > Philippe.
> >> >
> >> >
> >> >
> >>
> >>
> >> --
> >> Cordialement.
> >> Philippe Mouawad.
> >>
>

Re: Refactoring in HTTPHC4Impl

Posted by sebb <se...@gmail.com>.
On 1 July 2013 19:06, Immanuel Hayden <im...@gmail.com> wrote:
> Hi!
>
> I got only one request regarding this which is to make sure that the
> "server" can still contain part of the address
> eg server = api.example.com/V2/
> address = testservice.svc/health
> because I use that quite heavily in my testcases, as locally the project
> runs directly on localhost with no subdirectory and on the servers it runs
> in the Vx subdirectories -> devs and myself just have to change one line
> and not every sampler if they want to try something.

I'm not sure we can guarantee that, as this behaviour is likely an
accident of the way the HTTP code is implemented. It's certainly not
documented as being supported by JMeter, and might have to change.

There are other ways to achieve the same effect, e.g. by using a test
plan variable.

> in any case, thx for the great work :)
> br,
> Imm
>
>
> On 1 July 2013 17:18, Philippe Mouawad <ph...@gmail.com> wrote:
>
>> Created bug:
>> https://issues.apache.org/bugzilla/show_bug.cgi?id=55175
>>
>> Waiting for your feedback before commit.
>>
>> On Mon, Jul 1, 2013 at 5:06 PM, Philippe Mouawad <
>> philippe.mouawad@gmail.com
>> > wrote:
>>
>> > Hello,
>> > As per sebb request, I ask before implementing :-)
>> >
>> > I would like to refactor slightly HTTPHC4Impl to allow inheritance from
>> it
>> > to reuse many of already implemented and useful internals.
>> > This would be useful to classes that which for example to post binary
>> > content and similar stuff.
>> >
>> > Are you ok with it ? Can I open a bugzilla and do it ?
>> >
>> > Thanks
>> > --
>> > Regards.
>> > Philippe.
>> >
>> >
>> >
>>
>>
>> --
>> Cordialement.
>> Philippe Mouawad.
>>

Re: Refactoring in HTTPHC4Impl

Posted by Immanuel Hayden <im...@gmail.com>.
Hi!

I got only one request regarding this which is to make sure that the
"server" can still contain part of the address
eg server = api.example.com/V2/
address = testservice.svc/health
because I use that quite heavily in my testcases, as locally the project
runs directly on localhost with no subdirectory and on the servers it runs
in the Vx subdirectories -> devs and myself just have to change one line
and not every sampler if they want to try something.

in any case, thx for the great work :)
br,
Imm


On 1 July 2013 17:18, Philippe Mouawad <ph...@gmail.com> wrote:

> Created bug:
> https://issues.apache.org/bugzilla/show_bug.cgi?id=55175
>
> Waiting for your feedback before commit.
>
> On Mon, Jul 1, 2013 at 5:06 PM, Philippe Mouawad <
> philippe.mouawad@gmail.com
> > wrote:
>
> > Hello,
> > As per sebb request, I ask before implementing :-)
> >
> > I would like to refactor slightly HTTPHC4Impl to allow inheritance from
> it
> > to reuse many of already implemented and useful internals.
> > This would be useful to classes that which for example to post binary
> > content and similar stuff.
> >
> > Are you ok with it ? Can I open a bugzilla and do it ?
> >
> > Thanks
> > --
> > Regards.
> > Philippe.
> >
> >
> >
>
>
> --
> Cordialement.
> Philippe Mouawad.
>

Re: Refactoring in HTTPHC4Impl

Posted by Philippe Mouawad <ph...@gmail.com>.
Hello sebb,
I attached patch.

Regards
Philippe

On Tue, Jul 2, 2013 at 1:21 AM, sebb <se...@gmail.com> wrote:

> On 1 July 2013 16:18, Philippe Mouawad <ph...@gmail.com> wrote:
> > Created bug:
> > https://issues.apache.org/bugzilla/show_bug.cgi?id=55175
> >
> > Waiting for your feedback before commit.
>
> We'll need a bit more detail.
> What exactly are you proposing?
>
> Note that making a method protected usually means freezing its API, so
> the API had better be correct before doing so.
>
> However, if the inheritance is intended only for use by JMeter code -
> and is clear;y documented as such - then the API could be changed if
> necessary.
>
> If it is for use by 3rd party plugins, then the API design needs a lot
> of care to ensure it does not restrict future development.
>
> > On Mon, Jul 1, 2013 at 5:06 PM, Philippe Mouawad <
> philippe.mouawad@gmail.com
> >> wrote:
> >
> >> Hello,
> >> As per sebb request, I ask before implementing :-)
> >>
> >> I would like to refactor slightly HTTPHC4Impl to allow inheritance from
> it
> >> to reuse many of already implemented and useful internals.
> >> This would be useful to classes that which for example to post binary
> >> content and similar stuff.
> >>
> >> Are you ok with it ? Can I open a bugzilla and do it ?
> >>
> >> Thanks
> >> --
> >> Regards.
> >> Philippe.
> >>
> >>
> >>
> >
> >
> > --
> > Cordialement.
> > Philippe Mouawad.
>



-- 
Cordialement.
Philippe Mouawad.

Re: Refactoring in HTTPHC4Impl

Posted by sebb <se...@gmail.com>.
On 1 July 2013 16:18, Philippe Mouawad <ph...@gmail.com> wrote:
> Created bug:
> https://issues.apache.org/bugzilla/show_bug.cgi?id=55175
>
> Waiting for your feedback before commit.

We'll need a bit more detail.
What exactly are you proposing?

Note that making a method protected usually means freezing its API, so
the API had better be correct before doing so.

However, if the inheritance is intended only for use by JMeter code -
and is clear;y documented as such - then the API could be changed if
necessary.

If it is for use by 3rd party plugins, then the API design needs a lot
of care to ensure it does not restrict future development.

> On Mon, Jul 1, 2013 at 5:06 PM, Philippe Mouawad <philippe.mouawad@gmail.com
>> wrote:
>
>> Hello,
>> As per sebb request, I ask before implementing :-)
>>
>> I would like to refactor slightly HTTPHC4Impl to allow inheritance from it
>> to reuse many of already implemented and useful internals.
>> This would be useful to classes that which for example to post binary
>> content and similar stuff.
>>
>> Are you ok with it ? Can I open a bugzilla and do it ?
>>
>> Thanks
>> --
>> Regards.
>> Philippe.
>>
>>
>>
>
>
> --
> Cordialement.
> Philippe Mouawad.

Re: Refactoring in HTTPHC4Impl

Posted by Philippe Mouawad <ph...@gmail.com>.
Created bug:
https://issues.apache.org/bugzilla/show_bug.cgi?id=55175

Waiting for your feedback before commit.

On Mon, Jul 1, 2013 at 5:06 PM, Philippe Mouawad <philippe.mouawad@gmail.com
> wrote:

> Hello,
> As per sebb request, I ask before implementing :-)
>
> I would like to refactor slightly HTTPHC4Impl to allow inheritance from it
> to reuse many of already implemented and useful internals.
> This would be useful to classes that which for example to post binary
> content and similar stuff.
>
> Are you ok with it ? Can I open a bugzilla and do it ?
>
> Thanks
> --
> Regards.
> Philippe.
>
>
>


-- 
Cordialement.
Philippe Mouawad.