You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by Christopher Brind <ch...@brindysoft.com> on 2012/09/03 15:51:42 UTC

HTTP with custom methods

Hi,

My current customer has a requirement to use JMeter for testing their web
application which uses custom HTTP methods beyond the list presented in the
HTTP sampler GUI.  To support this I have ended up forking JMeter and
implementing this in house.  I have been asked to see if the JMeter
community will accept the changes back in to the main source tree so that
my customer doesn't need to maintain the fork.

The changes are:

- If the HC4 implementation is selected set the JLabelledChoice for
"method" to editable
- Changed the ordering of reading and writing of the test element
properties (because being able to set the method text on the choice depends
on it being editable)
- Changed HTTPHC4Impl to create a new anonymous instance of HttpRequestBase
which simply passes through the entered method and URI

There did not appear to be any unit tests to update for this and the
existing unit tests still pass.

Please let me know if this is desirable and I will send through the diff.

Thanks in advance.

Regards,
Chris

Re: HTTP with custom methods

Posted by sebb <se...@gmail.com>.
On 3 September 2012 16:21, Christopher Brind <ch...@brindysoft.com> wrote:
> Hi,
>
> Thanks for the reply.
>
> On Mon, Sep 3, 2012 at 4:13 PM, sebb <se...@gmail.com> wrote:
>>
>> On 3 September 2012 14:51, Christopher Brind <ch...@brindysoft.com> wrote:
>> > Hi,
>> >
>> > My current customer has a requirement to use JMeter for testing their web
>> > application which uses custom HTTP methods beyond the list presented in the
>> > HTTP sampler GUI.  To support this I have ended up forking JMeter and
>> > implementing this in house.  I have been asked to see if the JMeter
>> > community will accept the changes back in to the main source tree so that
>> > my customer doesn't need to maintain the fork.
>> >
>> > The changes are:
>> >
>> > - If the HC4 implementation is selected set the JLabelledChoice for
>> > "method" to editable
>> > - Changed the ordering of reading and writing of the test element
>> > properties (because being able to set the method text on the choice depends
>> > on it being editable)
>> > - Changed HTTPHC4Impl to create a new anonymous instance of HttpRequestBase
>> > which simply passes through the entered method and URI
>>
>> I assume these new methods don't support body content?
>
> That's correct.  It wasn't a requirement for my customer, but I can
> see how that might be useful.  Let me check with the customer to see
> how they feel about me adding support for that (in my own time if
> necessary).

OK.

No need to do so (unless you want) as I expect the change will be
useful as is - if only to see what happens if clients send unusual
requests!

The easiest way to support body content is to treat the method much
the same way as PUT or PATCH.
[POST handling is more complicated because of form-data-encoding]

The simplest would be to send content iff it is provided, otherwise
send URL parameters if any.
This would not need any further changes to the GUI, which is already
rather crowded.

>
>>
>> > There did not appear to be any unit tests to update for this and the
>> > existing unit tests still pass.
>> >
>> > Please let me know if this is desirable and I will send through the diff.
>>
>> Seems reasonable, but we would need to see the exact changes.
>>
>> The best way to provide patches and and enhancement code is via the
>> issue tracker; JMeter uses Bugzilla for this.
>> So please create an account, and attach the patches (diff -u format
>> please). For new files, these can be plain source rather than diff
>> format.
>
> Will do.
>
> Cheers,
> Chris
>
>>
>> > Thanks in advance.
>> >
>> > Regards,
>> > Chris

Re: HTTP with custom methods

Posted by Christopher Brind <ch...@brindysoft.com>.
Hi,

Thanks for the reply.

On Mon, Sep 3, 2012 at 4:13 PM, sebb <se...@gmail.com> wrote:
>
> On 3 September 2012 14:51, Christopher Brind <ch...@brindysoft.com> wrote:
> > Hi,
> >
> > My current customer has a requirement to use JMeter for testing their web
> > application which uses custom HTTP methods beyond the list presented in the
> > HTTP sampler GUI.  To support this I have ended up forking JMeter and
> > implementing this in house.  I have been asked to see if the JMeter
> > community will accept the changes back in to the main source tree so that
> > my customer doesn't need to maintain the fork.
> >
> > The changes are:
> >
> > - If the HC4 implementation is selected set the JLabelledChoice for
> > "method" to editable
> > - Changed the ordering of reading and writing of the test element
> > properties (because being able to set the method text on the choice depends
> > on it being editable)
> > - Changed HTTPHC4Impl to create a new anonymous instance of HttpRequestBase
> > which simply passes through the entered method and URI
>
> I assume these new methods don't support body content?

That's correct.  It wasn't a requirement for my customer, but I can
see how that might be useful.  Let me check with the customer to see
how they feel about me adding support for that (in my own time if
necessary).


>
> > There did not appear to be any unit tests to update for this and the
> > existing unit tests still pass.
> >
> > Please let me know if this is desirable and I will send through the diff.
>
> Seems reasonable, but we would need to see the exact changes.
>
> The best way to provide patches and and enhancement code is via the
> issue tracker; JMeter uses Bugzilla for this.
> So please create an account, and attach the patches (diff -u format
> please). For new files, these can be plain source rather than diff
> format.

Will do.

Cheers,
Chris

>
> > Thanks in advance.
> >
> > Regards,
> > Chris

Re: HTTP with custom methods

Posted by sebb <se...@gmail.com>.
On 3 September 2012 14:51, Christopher Brind <ch...@brindysoft.com> wrote:
> Hi,
>
> My current customer has a requirement to use JMeter for testing their web
> application which uses custom HTTP methods beyond the list presented in the
> HTTP sampler GUI.  To support this I have ended up forking JMeter and
> implementing this in house.  I have been asked to see if the JMeter
> community will accept the changes back in to the main source tree so that
> my customer doesn't need to maintain the fork.
>
> The changes are:
>
> - If the HC4 implementation is selected set the JLabelledChoice for
> "method" to editable
> - Changed the ordering of reading and writing of the test element
> properties (because being able to set the method text on the choice depends
> on it being editable)
> - Changed HTTPHC4Impl to create a new anonymous instance of HttpRequestBase
> which simply passes through the entered method and URI

I assume these new methods don't support body content?

> There did not appear to be any unit tests to update for this and the
> existing unit tests still pass.
>
> Please let me know if this is desirable and I will send through the diff.

Seems reasonable, but we would need to see the exact changes.

The best way to provide patches and and enhancement code is via the
issue tracker; JMeter uses Bugzilla for this.
So please create an account, and attach the patches (diff -u format
please). For new files, these can be plain source rather than diff
format.

> Thanks in advance.
>
> Regards,
> Chris