与TestNg结合使用:未找到测试

时间:2019-05-18 04:32:24

标签: java gradle testng

我正在使用gradle项目

  1. 项目在junit上运行正常,但是
  2. 使用TestNg时,我遇到了构建失败错误
    Testing started at 9:18 PM ...
    9:18:08 PM: Executing tasks ':cleanTest :test --tests "abc.lau" --scan'...

    > Task :cleanTest
    > Task :compileJava NO-SOURCE
    > Task :processResources NO-SOURCE
    > Task :classes UP-TO-DATE
    > Task :compileTestJava
    > Task :processTestResources NO-SOURCE
    > Task :testClasses
    > Task :test FAILED
    FAILURE: Build failed with an exception.
    * What went wrong:
    Execution failed for task ':test'.
    > No tests found for given includes: [abc.lau](filter.includeTestsMatching)
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    * Get more help at https://help.gradle.org
    BUILD FAILED in 0s
    3 actionable tasks: 3 executed

1 个答案:

答案 0 :(得分:0)

您是否已在 build.gradle 中明确指定使用testng?

test {
    useTestNG()
}