我尝试通过此链接使用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上下文(并调用所有应用程序启动侦听器)?