Discussion:
TestNG unit tests failing with Jersey 2.8
Adam Zell
2014-05-01 23:04:57 UTC
Permalink
Hello,

I have a number of TestNG unit tests that extend JerseyTest. All of the
unit tests pass under Jersey 2.7. However only the first test method per
TestNG file passes under Jersey 2.8 (see
https://java.net/jira/browse/JERSEY-2501 for details and sample source
code).

Is this a known issue? Server exception trace:

Caused by:
java.lang.NullPointerException
at
org.glassfish.jersey.jetty.JettyHttpContainer.handle(JettyHttpContainer.java:193)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:459)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:281)
at
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:232)
at
org.eclipse.jetty.io.AbstractConnection$1.run(AbstractConnection.java:505)
at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536)
at java.lang.Thread.run(Thread.java:745)

The TestNG unit tests use the @BeforeMethod and @AfterMethod annotations to
mimic the JerseyTest @Before and @After JUnit annotations around setUp()
and tearDown().
--
Adam
zellster-***@public.gmane.org
Loading...