Bug 59083 - HTTP Request : Make Method field editable so that additional methods (Webdav) can be added easily
Summary: HTTP Request : Make Method field editable so that additional methods (Webdav)...
Status: RESOLVED FIXED
Alias: None
Product: JMeter
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 2.13
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords: PatchAvailable
Depends on:
Blocks: 59131
  Show dependency tree
 
Reported: 2016-02-27 09:41 UTC by Philippe Mouawad
Modified: 2016-03-18 16:30 UTC (History)
1 user (show)



Attachments
Screenshot (186.66 KB, image/png)
2016-02-27 09:46 UTC, Philippe Mouawad
Details
Felix patch showing the intention (cleanup needed as he wrote) (1.44 KB, patch)
2016-02-27 09:47 UTC, Philippe Mouawad
Details | Diff
Allow any method as a webdav method (12.01 KB, patch)
2016-02-28 12:17 UTC, Felix Schumacher
Details | Diff
Use JComboBox for http method selection (5.16 KB, patch)
2016-03-07 20:01 UTC, Felix Schumacher
Details | Diff
Make HC3 Impl aware of all possible http methods (1.96 KB, patch)
2016-03-07 21:06 UTC, Felix Schumacher
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Mouawad 2016-02-27 09:41:46 UTC
Related to Bug 59005 and discussion on dev mailing list:
http://mail-archives.apache.org/mod_mbox/jmeter-dev/201602.mbox/%3CCAH9fUpbEmrBqWqau4s0hmCDtwmiiWC_oa81Y9%3DjhP8TJspFpjQ%40mail.gmail.com%3E


I am creating the issue (unless it was already created ?) so that we don't forget.

Attaching Felix's patch proposal (it is a draft as he wrote) but it shows the intention.
Comment 1 Philippe Mouawad 2016-02-27 09:46:35 UTC
Created attachment 33603 [details]
Screenshot
Comment 2 Philippe Mouawad 2016-02-27 09:47:34 UTC
Created attachment 33604 [details]
Felix patch showing the intention (cleanup needed as he wrote)
Comment 3 Felix Schumacher 2016-02-28 12:17:41 UTC
Created attachment 33606 [details]
Allow any method as a webdav method

This patch adds a property "httpsampler.user_defined_methods" which can be used to add pre-defined methods to the method list. The property is added to jmeter.properties as an example with filled in methods for RFC3253.

Documentation has been updated to include a reference to the property.

The class HttpWebdav is still in use and I don't think, that we can remove it since it holds the used method.
Comment 4 Felix Schumacher 2016-02-29 19:21:32 UTC
Date: Mon Feb 29 19:20:08 2016
New Revision: 1732937

URL: http://svn.apache.org/viewvc?rev=1732937&view=rev
Log:
HTTP Request : Make Method field editable so that additional methods (Webdav) can be added easily

Bugzilla Id: 59083

Modified:
    jmeter/trunk/bin/jmeter.properties
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/UrlConfigGui.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HttpWebdav.java
    jmeter/trunk/xdocs/changes.xml
    jmeter/trunk/xdocs/usermanual/component_reference.xml
Comment 5 Felix Schumacher 2016-02-29 19:41:05 UTC
Date: Mon Feb 29 19:36:14 2016
New Revision: 1732939

URL: http://svn.apache.org/viewvc?rev=1732939&view=rev
Log:
Revert changes made by r1732937
At least HTTPHC4Impl uses HttpWebDav#isWebdavMethod in a way, that is incompatible to this change.

Was: HTTP Request : Make Method field editable so that additional methods (Webdav) can be added easily

Bugzilla Id: 59083

Modified:
    jmeter/trunk/bin/jmeter.properties
    jmeter/trunk/src/core/org/apache/jmeter/gui/util/JLabeledRadioI18N.java   (props changed)
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/UrlConfigGui.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HttpWebdav.java
    jmeter/trunk/xdocs/changes.xml
    jmeter/trunk/xdocs/images/asf-logo.gif   (props changed)
    jmeter/trunk/xdocs/usermanual/component_reference.xml
Comment 6 Felix Schumacher 2016-03-03 20:57:29 UTC
Date: Thu Mar  3 20:55:33 2016
New Revision: 1733521

URL: http://svn.apache.org/viewvc?rev=1733521&view=rev
Log:
HTTP Request : Make Method field editable so that additional methods (Webdav) can be added easily

Bugzilla Id: 59083

Modified:
    jmeter/trunk/bin/jmeter.properties
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/UrlConfigGui.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HttpWebdav.java
    jmeter/trunk/xdocs/usermanual/component_reference.xml
Comment 7 Philippe Mouawad 2016-03-03 21:34:10 UTC
Date: Thu Mar  3 21:29:40 2016
New Revision: 1733530

URL: http://svn.apache.org/viewvc?rev=1733530&view=rev
Log:
Bug 59083 - HTTP Request : Make Method field editable so that additional methods (Webdav) can be added easily
Bugzilla Id: 59083

Modified:
    jmeter/trunk/xdocs/changes.xml
Comment 8 Milamber 2016-03-05 13:08:49 UTC
If you open a existing jmx script with a HTTP Sampler with POST method (not the default GET method), and you click one or several time on the Del button (near Method), you have this error:


2016/03/05 12:40:31 ERROR - jmeter.JMeter: Uncaught exception:  java.lang.ArrayIndexOutOfBoundsException: Array index out of range: -1
	at java.util.Vector.removeElementAt(Unknown Source)
	at javax.swing.DefaultComboBoxModel.removeElementAt(Unknown Source)
	at javax.swing.JComboBox.removeItemAt(Unknown Source)
	at org.apache.jorphan.gui.JLabeledChoice$DeleteListener.actionPerformed(JLabeledChoice.java:297)
	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
	at java.awt.Component.processMouseEvent(Unknown Source)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$500(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)
Comment 9 Philippe Mouawad 2016-03-06 16:44:22 UTC
Hi,
I think this needs further thinking as removing a Method that is used by other samplers like GET or POST makes rapidly the behaviour very hard to guess.

Regards
Comment 10 Felix Schumacher 2016-03-07 19:12:34 UTC
I didn't see the "add" and "del" buttons. They are not really useful in my mind, since we would have to guard the standard http methods and the added http methods would be lost on save anyway.

Would it be ok to add another param to JLabeledChoice to inhibit the addition of the buttons, or should I add another JComboBox derivate?
Comment 11 Felix Schumacher 2016-03-07 20:01:45 UTC
Created attachment 33644 [details]
Use JComboBox for http method selection
Comment 12 Philippe Mouawad 2016-03-07 21:03:17 UTC
This look good to me.
Comment 13 Felix Schumacher 2016-03-07 21:06:13 UTC
Created attachment 33645 [details]
Make HC3 Impl aware of all possible http methods
Comment 14 Sebb 2016-03-08 23:54:03 UTC
Isn't this similar to Bug 59131?

Add/Del buttons don't make sense for the list of methods.
Comment 15 Sebb 2016-03-09 02:12:07 UTC
I added another ctor to JLabeledChoice to suppress the buttons.
Still seems to work OK:

URL: http://svn.apache.org/viewvc?rev=1734185&view=rev
Log:
HTTP Request : Make Method field editable so that additional methods (Webdav) can be added easily
Don't display Add/Del buttons
Bugzilla Id: 59083

Modified:
    jmeter/trunk/src/jorphan/org/apache/jorphan/gui/JLabeledChoice.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/UrlConfigGui.java

I guess JComboBox would have worked just as well; this seemed to be somewhat simpler.
Comment 16 Philippe Mouawad 2016-03-09 12:12:22 UTC
Closing as it is fixed.
Comment 17 Felix Schumacher 2016-03-18 16:30:16 UTC
Date: Fri Mar 18 16:04:21 2016
New Revision: 1735627

URL: http://svn.apache.org/viewvc?rev=1735627&view=rev
Log:
Add testcase for HttpWebdav.

Bugzilla Id: 59083

Added:
    jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/TestHttpWebdav.java   (with props)