我运行了一些集成测试。这个测试是“集成”所以我应该用h2数据库运行假应用程序,并做一些需要一些时间的其他工作。我不能为每个测试类做到这一点因为它需要很长时间。我使用junit Suite进行组测试,代码如下:
@RunWith(Suite.class)
@Suite.SuiteClasses({Step1Test.class, Step2Test.class})
public class IntegrationTests {
@BeforeClass
public static void setUp() {
// Start fake app, prepare fixtures etc...
System.out.println("setUp");
}
@AfterClass
public static void tearDown() {
// stop fake app
System.out.println("tearDown");
}
}
从控制台运行测试:
play "test-only suits.*"
但是目标/测试报告是空的 - sbt不会创建有关此测试的任何报告。 当我直接运行每个测试类时:
play "test-only steps.*"
创建测试报告。
来源于https://github.com/zadonskiyd/play2JunitTestSuiteProblem
如何为从套件运行的测试创建xml报告?