playframework/Play20 — pull request #561 by bblfish (2012-11-20 23:08:19+00:00)
Title: Flexible WS

1. WS is very inflexible in what it allows one to specify as options for the AsyncHTTPClient
2. One cannot create different instances of WS to set specific global options for WS instances since WS is an object.
3. Tests don't allow one to set the TLS ports

So these are related because when testing https one wants to for example ignore the https certificate of test servers since those are created randomly. But when testing a remote server with a well known certificate one may want to test that it is CA verified correctly - you could try testing a google page for example. One should be able to have those tests to run in parallel -> so one cannot make those changes globally. The same is true for many tests one can do with WS.

The current fix refactors WS very slightly, by moving most of the code into a trait. WS object just implements that trait. So the behavior of the WS object is exactly the same as it was. But it is possible to create different WSTrait implementations to test different behavior.

This 3 patch in this branch was a refactoring to make it easy to see that the diffs from the current master branch are very small.