users@jersey.java.net

[Jersey] Jersey test framework and multiple spring context files

From: Ryan Stewart <zzantozz_at_gmail.com>
Date: Sun, 16 Jan 2011 11:11:51 -0600

The contextConfigLocation parameter takes a comma- or space-separated list
of context files. See:
http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/web/context/ContextLoader.html


On Fri, Jan 14, 2011 at 4:25 PM, Mike Key <mikey_at_zenbitz.com> wrote:

> 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
>