users@jersey.java.net

[Jersey] Jersey test framework and multiple spring context files

From: Mike Key <mikey_at_zenbitz.com>
Date: Fri, 14 Jan 2011 15:25:01 -0700

I have a multi-module spring/maven project I am trying to integrate the
Jersey test framework into. The code to bootstrap through extending
JerseyTest I've seen seems limited in the sense I can't figure out how
to feed it multiple spring context files. I have the following:

   public InstanceResourceTest() throws Exception {
         super(new WebAppDescriptor.Builder("com.myservice.path")
                 .contextPath("spring")
                 .contextParam("contextConfigLocation",
"classpath:wsModuleSpringContext.xml")
                 .servletClass(SpringServlet.class)
                 .contextListenerClass(ContextLoaderListener.class)
                 .build());
     }

as my constructor. In order to make the full app load via spring
though, I need to add 4 more contextConfigLocations. ContextPath in the
Jersey test framework seems to be a HashMap<String, String> where as in
order to add multiple contexts I'd expect it to be a Hashmap<String,
List> or HashMap<String, Object> wrapper. So my basic question is...is
there a way to pass in multiple spring context files to the test framework??

Thanks in advance!

Mike