【问题标题】:How to debug in gradle dependency library code如何在 gradle 依赖库代码中调试
【发布时间】:2019-03-20 17:07:51
【问题描述】:

我正在尝试使用 Cucumber、TestNG 和 gradle 运行测试(在 cucumber+testng+gradle 中没有官方示例,据我从 gradle github repo 了解到,当前不支持此工具堆栈)

gradle tests --tests com.CR --stacktrace

表明测试没有运行异常

Caused by: org.gradle.api.tasks.testing.TestExecutionException: No tests found for given includes: [com.CR](--tests filter)

其中 com.CR 是带有 @CucumberOptions 的类

经过一番调查,我发现类 cucumber.api.testng.AbstractTestNGCucumberTests.class 的黄瓜库中出现问题,我正在尝试调试它。

我在这个类中设置调试点。并使用调试选项运行 gradle

gradle test --tests com.CR -Dorg.gradle.debug=true --no-daemon 

然后连接到远程调试端口 5005 但它不会在我的任何调试点上停止。


所以问题是如何调试依赖库的代码或我做错了什么?

附言代码示例https://github.com/sirdir/cucumber-testng-gradle

【问题讨论】:

    标签: java debugging gradle testng cucumber-jvm


    【解决方案1】:

    问题解决了。无需调试。 必须在 gradle test {} 任务中完成一些额外的设置才能运行 testng cucumber-runner 类。

    【讨论】:

    猜你喜欢
    • 2016-02-04
    • 2018-06-19
    • 2013-01-18
    • 2020-02-28
    • 2011-07-05
    • 2013-03-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-10
    相关资源
    最近更新 更多