Converting spring-web-mvc testcase for annotation-based config?
After a very lengthy thread that departed from the original subject, I've decided to post my latest question in a new thread.
I've got a servlet-3.0-style webapp running in Resin 4.0.33 with absolutely no XML configuration files. The last thing I need to address is my use of spring-web-mvc, wherein my test class was declared like this:
Code:
@RunWith(org.springframework.test.context.junit4.SpringJUnit4ClassRunner.class)
@WebAppConfiguration("file:target/build")
@ContextConfiguration({
"file:target/build/WEB-INF/config/springContext.xml",
"file:target/build/WEB-INF/config/springWebDispatcherConfig.xml"
})
public
class
TestServiceController
{
...testcases...
}
Since web.xml no longer exists under target/build/WEB-INF and since springContext.xml and springWebDispatcherConfig.xml no longer exist, I need to make some changes. I've tried a few things but can't seem to get them right.
My webapp config depends on the container automatically instantiating my AbstractAnnotationConfigDispatcherServletInitializ er, which then handles registering my @Configuration classes. I tried referencing those in the @ContextConfiguration(classes={}) annotation, but that didn't work. I also can't tell if @WebAppConfiguration knows how to initialize a servlet-3.0 webapp.
Google has been less than forthcoming with this; I guess not many people are using servlet 3.0 yet. Any help would be most welcome. Thanks!