Eclipse调试不适用于基于Spring的testng AbstractTestNGSpringContextTests
我面临一个奇怪的问题。当我的testng测试用例扩展AbstractTestNGSpringContextTests时,我的eclipse调试(不在断点处停止)不工作。当我运行相同的代码而不扩展AbstractTestNGSpringContextTests时,它运行得非常好。 普通试验箱Eclipse调试不适用于基于Spring的testng AbstractTestNGSpringContextTests,eclipse,testng,spring-test,testng-eclipse,Eclipse,Testng,Spring Test,Testng Eclipse,我面临一个奇怪的问题。当我的testng测试用例扩展AbstractTestNGSpringContextTests时,我的eclipse调试(不在断点处停止)不工作。当我运行相同的代码而不扩展AbstractTestNGSpringContextTests时,它运行得非常好。 普通试验箱 package in.xxx.core.integration; import org.testng.annotations.Test; public class TestXXX { @Test
package in.xxx.core.integration;
import org.testng.annotations.Test;
public class TestXXX {
@Test
public void testMe() {
System.out.println("verifyFooName: Is foo not null? ");
}
}
使用基于Spring的testng testcase编写代码
包in.xxx.core.integration
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.testng.annotations.Test;
@ContextConfiguration(locations = { "classpath:test-spring-application-context.xml" })
public class TestXXX extends AbstractTestNGSpringContextTests {
@Test
public void testMe() {
System.out.println("verifyFooName: Is foo not null? ");
}
}
你在哪里设定了断点?在测试类中,或者在其他地方?FWIW中,我只是在扩展
AbstractTestNGSpringContextTests
的类的测试方法中设置了一个断点,并且使用Debug As使用Eclipse调试器进行调试时没有任何问题。。。TestNG Test
。