我希望 Maven 在遇到第一个错误时停止尝试运行我的 JUnit Spring 测试。这可能吗?
我的测试类如下所示,我将它们作为标准 Maven 目标运行。
@ContextConfiguration(locations = {"classpath:/spring-config/store-persistence.xml","classpath:/spring-config/store-security.xml","classpath:/spring-config/store-service.xml", "classpath:/spring-config/store-servlet.xml" })
@RunWith(SpringJUnit4ClassRunner.class)
@Transactional
public class SkuLicenceServiceIntegrationTest
{
...
如果 Spring 配置中有错误,那么每个测试都会尝试重新启动 Spring 上下文,这需要 20 秒。这意味着我们很久没有发现任何测试失败了,因为它会在得出构建失败的结论之前尝试运行所有测试!