【发布时间】:2017-09-19 21:47:39
【问题描述】:
使用 Junit4,我对集成测试有以下定义:
task testIntegration(type: Test, dependsOn: jar) {
group 'Verification'
description 'Runs the integration tests.'
testLogging {
showStandardStreams = true
}
testClassesDirs = sourceSets.testInt.output.classesDirs
classpath = sourceSets.testInt.runtimeClasspath
systemProperties['jar.path'] = jar.archivePath
}
但是,对于 JUnit5,这不再起作用。我无法弄清楚要改变什么(为时已晚)。有什么提示吗?
我正在使用junit-platform-gradle-plugin。
【问题讨论】:
-
JUnit5 只为
main源集定义了一个任务。您可以在junit-team/junit5-samples 上查看此类支持的请求。您将需要一个新任务来运行 JUnit。您可以在this answer 中查看如何设置它的示例。我认为 JUnit 团队不打算支持它,正在等待 the Gradle team 构建原生支持。 -
@mkobit 我知道这是 gradle 问题。谢谢链接,我想我快到了