users@jersey.java.net

Filter not executing when running a JerseyTest

From: schong <dr.steve.chong_at_gmail.com>
Date: Tue, 27 Apr 2010 14:25:42 -0700 (PDT)

Hello,
I’m having difficulties trying to execute a Filter using the Jersey Test
Framework.

We’ve got a Maven Project called Customer Registration. This has two
modules. A REST module (produces a JAR) and a Web module (produces WAR) .
The Web module has a dependency on the REST JAR.

In the Web module we’ve got a Filter that is mapped to the Jersey Servlet
(in the web.xml) so that any requests have to the Filter first.

What I am trying to do is to run tests using a JerseyTest class against the
Web module running on a GrizzlyWebServer. The theory is that any requests to
our REST service will go to the Filter.

My problem is that the GrizzlyWebServer starts up fine and the tests run
against it but the Filter is not executed.

I ran separate JUnit tests (Apache HttpClient) against a Jetty instance with
the same web module (using mvn jetty:run from the command line). The Filter
is executed fine.

I’d really like to have the tests running as part of my JerseyTest so that
we can run the tests as part of our build process.

Does anyone have any pointers or suggestions?
Thanks, Steve.

-- 
View this message in context: http://jersey.576304.n2.nabble.com/Filter-not-executing-when-running-a-JerseyTest-tp4971178p4971178.html
Sent from the Jersey mailing list archive at Nabble.com.