Bug 53755 - Adding a HttpClient 4 cookie implementation in JMeter. Cookie Manager has now the default HC3.1 implementation and a new choice HC4 implementation (compliant with IPv6 address)
Summary: Adding a HttpClient 4 cookie implementation in JMeter. Cookie Manager has now...
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: HTTP (show other bugs)
Version: Nightly (Please specify date)
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks: 51512
  Show dependency tree
 
Reported: 2012-08-21 15:06 UTC by Milamber
Modified: 2012-09-28 18:38 UTC (History)
1 user (show)



Attachments
Proposal patch to add a HC4 impl and modfy CookieManager to add the choose (20.85 KB, patch)
2012-08-21 15:37 UTC, Milamber
Details | Diff
Ne cookie manager with HC4/HC3 (23.11 KB, image/png)
2012-08-21 15:37 UTC, Milamber
Details
HC4 cookie manager with IPv6 address (localhost) (31.19 KB, image/png)
2012-08-21 15:38 UTC, Milamber
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Milamber 2012-08-21 15:06:36 UTC
Related with #51512
Comment 1 Sebb 2012-08-21 15:17:00 UTC
I think the continued use of the HC3.1 Cookie implementation is probably historical.

When HC4 was originally added, it was in a state of flux, so we changed the minimum possible.

I suspect we no may longer need the HC 3.1 Cookie implementation at all.
Comment 2 Milamber 2012-08-21 15:37:22 UTC
Created attachment 29259 [details]
Proposal patch to add a HC4 impl and modfy CookieManager to add the choose
Comment 3 Milamber 2012-08-21 15:37:52 UTC
Created attachment 29260 [details]
Ne cookie manager with HC4/HC3
Comment 4 Milamber 2012-08-21 15:38:41 UTC
Created attachment 29261 [details]
HC4 cookie manager with IPv6 address (localhost)

This test case don't work with the HC3 impl.
Comment 5 Milamber 2012-08-21 15:47:08 UTC
@sebb

The new Implementation field in Cookie Manager has made to have the same thing that the HTTP Request (type of HTTP implementation).
And have a transitional period to move from HC3 to HC4 (perhaps there has some bug in HC4 cookie API?)

I can commit this work or not. If it's better to replace the HC3CookieHandler by the new HC4CookieHandler without the implementation's field in Cookie Manager, I can do this.
Comment 6 Milamber 2012-08-21 15:54:50 UTC
Note to keep in mind.

In HC3CookieHandler.
Method:
    addCookieFromHeader(CookieManager cookieManager, boolean checkCookies, String cookieHeader, URL url)
Have this lines:
            cookie.isPathAttributeSpecified(),
            cookie.isDomainAttributeSpecified()

And Method:
   makeCookie(Cookie jmc)
Have this lines:
        ret.setPathAttributeSpecified(jmc.isPathSpecified());
        ret.setDomainAttributeSpecified(jmc.isDomainSpecified());

In HC4 API, no traces for is|set|PathAttributeSpecified() and is|set|DomainAttributeSpecified()

Thus in HC4CookieHandler, I've not enter this lines...

I don't know if it's a bug or not necessary.
Comment 7 Philippe Mouawad 2012-08-21 21:40:28 UTC
I reviewed patch it seems fine for me.
Great you implemented this !!!
IPv6 support lack in JMeter is now solved.
Comment 8 Sebb 2012-08-22 17:02:12 UTC
(In reply to comment #5)
> @sebb
> 
> The new Implementation field in Cookie Manager has made to have the same
> thing that the HTTP Request (type of HTTP implementation).
> And have a transitional period to move from HC3 to HC4 (perhaps there has
> some bug in HC4 cookie API?)
> 
> I can commit this work or not. If it's better to replace the
> HC3CookieHandler by the new HC4CookieHandler without the implementation's
> field in Cookie Manager, I can do this.

If you have already done the work, then the implementation might as well be selectable. If/when we drop HC3.1 entirely it can be disabled/removed.
Comment 9 Milamber 2012-08-22 23:57:13 UTC
TODO: update docs.


URL: http://svn.apache.org/viewvc?rev=1376320&view=rev
Log:
Adding a HttpClient 4 cookie implementation in JMeter. Cookie Manager has now the default HC3.1 implementation and a new choice HC4 implementation (compliant with IPv6 address)
and
Bug 51512 - Cookies aren't inserted into HTTP request with IPv6 Host header
Bugzilla Id: 53755

Added:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HC4CookieHandler.java   (with props)
Modified:
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
    jmeter/trunk/src/jorphan/org/apache/jorphan/reflect/ClassTools.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/CookiePanel.java
    jmeter/trunk/xdocs/changes.xml
Comment 10 Milamber 2012-09-28 18:38:17 UTC
Doc update done.


URL: http://svn.apache.org/viewvc?rev=1376459&view=rev
Log:
Update doc for new Response Time Graph, Aggregate Graph and Cookie Manager elements
Bugzilla Id: 53718,53755

Removed:
    jmeter/trunk/docs/images/screenshots/http-config/http-cookie-manager.gif
    jmeter/trunk/xdocs/images/screenshots/http-config/http-cookie-manager.gif
Modified:
    jmeter/trunk/docs/images/screenshots/aggregate_graph.png
    jmeter/trunk/docs/images/screenshots/aggregate_graph_settings.png
    jmeter/trunk/docs/images/screenshots/http-config/http-cookie-manager.png
    jmeter/trunk/docs/images/screenshots/response_time_graph.png
    jmeter/trunk/docs/images/screenshots/response_time_graph_settings.png
    jmeter/trunk/xdocs/images/screenshots/aggregate_graph.png
    jmeter/trunk/xdocs/images/screenshots/aggregate_graph_settings.png
    jmeter/trunk/xdocs/images/screenshots/http-config/http-cookie-manager.png
    jmeter/trunk/xdocs/images/screenshots/response_time_graph.png
    jmeter/trunk/xdocs/images/screenshots/response_time_graph_settings.png
    jmeter/trunk/xdocs/usermanual/component_reference.xml
Comment 11 The ASF infrastructure team 2022-09-24 20:37:51 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2896