0
我正在用TestNG编写集成测试并面临这个小问题。testNG没有可运行的方法
No runnable methods
java.lang.Exception: No runnable methods
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
Test类是这样的(斯蒂芬的建议之后,我删除SpringJunitRunner):
@Test
@ContextConfiguration(locations = { "file:spring-configuration/mobiusdatabase-integration-testing.xml" })
public class PersistUrlTests extends AbstractTestNGSpringContextTests {
@Autowired
protected MobiusDatabaseServiceClient mobiusDatabaseServiceClient;
@Autowired
UrlDAO urlDAO;
@Autowired
ScraperUrlDAO scraperUrlDAO;
@BeforeClass
public static void init() throws Exception {
}
@Test
public void checkTest() {
GetActiveCategoriesResponse response = mobiusDatabaseServiceClient.newGetActiveCategoriesCall().call();
System.out.println(response.getCategoryList());
Assert.assertTrue(true);
}
}
此错误时,我们没有@Test
注释,如果我们没有@Runner
通常发生。我们是否需要其他一些设置为TestNG
?
嗨斯蒂芬,我尝试使用建议的抽象类,但它仍然抛出了同样的错误。用新的设置修改了这个问题。 – instanceOfObject
如果没有* full * stacktrace,我无法诊断 –