Bug 53960 - Extensions to HttpClient test helper class
Summary: Extensions to HttpClient test helper class
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Catalina (show other bugs)
Version: trunk
Hardware: PC Linux
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-03 16:51 UTC by Brian Burch
Modified: 2012-11-13 00:47 UTC (History)
0 users



Attachments
Enhancements to HttpClient including preparation for no-cookie tests (9.58 KB, patch)
2012-10-03 16:51 UTC, Brian Burch
Details | Diff
Minor improvements to original patch. (9.99 KB, patch)
2012-10-06 16:19 UTC, Brian Burch
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Burch 2012-10-03 16:51:24 UTC
Created attachment 29443 [details]
Enhancements to HttpClient including preparation for no-cookie tests

Ref: "FormAuthenticatorTest for cases without cookies - implementation issues" on the tomcat dev list.

The attached patch prepares the HttpClient abstract helper ready for use by new Authenticator unit test cases. The change includes style cleanup, new public methods, logic refactoring and new private methods.

This change leaves the class 100% backward compatible with all existing unit tests.

When each of the concrete Authenticator tests are eventually extended, the new logic in HttpClient will be fully used for existing as well as new test cases.
Comment 1 Brian Burch 2012-10-06 16:17:12 UTC
I wondered whether my refactoring might have broken the logic associated with processing the response body. I have reviewed my change, renamed an argument to make it self-explanatory, and fixed a typo in a comment.

I have attached a new patch file for the entire change, so please ignore the original and implement only the new patch.
Comment 2 Brian Burch 2012-10-06 16:19:44 UTC
Created attachment 29455 [details]
Minor improvements to original patch.

This is a complete replacement for the original patch file, even though the differences are minor.
Comment 3 Mark Thomas 2012-10-27 18:48:24 UTC
Fixed in trunk and 7.0.x and will be in 7.0.33 onwards.
Comment 4 Konstantin Kolinko 2012-11-13 00:47:49 UTC
Note that I removed the extractUriElements() from within the processBody() method.

The response body might be not HTML, and in >=90% of test cases this information is not needed by the test.

The extractUriElements() method was made public so that you can call it explicitly.

See r1408520