小编Ale*_*kov的帖子

web.xml中的Spring-test和ServletContextListener

我尝试通过此链接使用spring-test(3.2.10)和与TestNG的集成测试.

我创建了RootTest.java

@WebAppConfiguration
@ContextConfiguration("file:src/test/resources/root-context2.xml")
public class ReferenceServiceTest extends AbstractTestNGSpringContextTests {
...
Run Code Online (Sandbox Code Playgroud)

春天上下文加载成功.但我的全局变量没有实例化,因为web.xml被忽略了.在web.xml中,我有自己的"监听器类"(ServletContextListener的实现)和"context-param".我如何使用spring集成测试上下文加载web.xml上下文(并调用所有应用程序启动侦听器)?

integration web.xml spring-test

4
推荐指数
1
解决办法
3374
查看次数

标签 统计

integration ×1

spring-test ×1

web.xml ×1