Eclipse调试不适用于基于Spring的testng AbstractTestNGSpringContextTests

时间:2018-04-22 07:20:28

标签: eclipse testng spring-test testng-eclipse

我面临一个奇怪的问题。当我的testng测试用例扩展AbstractTestNGSpringContextTests时,我的eclipse调试(不在断点处停止)不起作用。当我运行相同的代码而不扩展AbstractTestNGSpringContextTests时,它运行绝对正常。 普通的测试案例

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测试用例的代码     package 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? ");
    }
}

0 个答案:

没有答案