On 19/03/2014 3:30 AM, Vetle Leinonen-Roeim wrote:
>> My advice to you: dump JerseyTest. Its design is flawed and it doesn't
>> look like it'll get fixed anytime soon. You can replace Jetty with your
>> server of choice. Just dump the abstraction (JerseyTest) and talk
>> directly to the server.
>
> Have you tried Jersey 2? As long as you don't need the servlet API,
> you can use an in-memory container when running JerseyTest, and blast
> away. It's really neat.
I don't plan to upgrade to Jersey 2 until the critical features missing
from Jersey 1 are fully ported over. The major one that comes to mind is
ResourceContext:
http://stackoverflow.com/q/17284419/14731.
As for running an in-memory container:
http://stackoverflow.com/q/13283542/14731
Meaning, I don't understand (and I genuinely want someone to explain to
me) what an in-memory container gives you that a normal JUnit test
(without a server) does not.
So to answer your question, all my unit tests assume the existence of
the Servlet API so the above is the best I can do.
Gili