SpringSource/spring-test-mvc — pull request #26 by tbruyelle (2012-03-07 14:29:57+00:00)
Title: Add `xmlConfigSetup` method with a parent context  

When a junit requires an applicationContext to autowired some beans from another layer than the webapp layer (service or persistence for instance), I thought it would be nice to initialize the junit with the standard @ContextConfiguration and then pass the context to the `xmlConfigSetup` in order to set it as a parent of the web application context.

```java
@RunWith( SpringJUnit4ClassRunner.class )
@ContextConfiguration(
locations = { "classpath:applicationContext-service.xml" } )
public class TestFoo
{
@Inject
private ApplicationContext applicationContext;

@Inject
private MyService myService;

@Test
protected MockMvc getMockMvc()
{
MockMvc mockMvc = xmlConfigSetup( applicationContext, "classpath:applicationContext-webapp.xml" ).build();

(...)
}
}
```

I'm aware of `InitializedContextMockMvcBuilder` which could also make the deal, but it requires to write a lot of noise code about `ServletContext` initialization and that's something I prefer not to do.

Is there a better solution to handle such case ?