Eclipse – 调试为 – TestNG 测试:无法找到测试源代码

huangapple go评论95阅读模式
英文:

Eclipse - Debug as - TestNG Test: fails to find the test source code

问题

我正在尝试在Eclipse中运行TestNG的单元测试并进行调试。我在代码中设置了一个断点,但当它达到该点时,Eclipse会报告无法找到单元测试的源代码!

在过去,我曾经遇到过这个问题,但那时是因为我没有在本地下载外部项目的源代码。然而,这次情况完全不同。Eclipse甚至无法找到定义单元测试的项目的源代码。

然而,当我使用"编辑源代码查找路径"附加了项目后,我可以看到源代码。

编辑:

经过一些调查,我可以说:

Eclipse --> 以Java应用程序方式进行调试可以找到源代码。

所以这个问题似乎与TestNG测试的启动有关。

英文:

I am trying to debug a unit test running testng in Eclipse. I put a breakpoint in the code and when it reaches that point Eclipse complains that it can not find the source code for the unit test!

I had experience this issue in the pass but this was always because external projects that i had not downloaded the sources locally. However, this is something entirely different. Eclipse is not even able to find the source for the project where the unit test is defined.

However, when i attached the project using the "Edit Source Lookup Path", I am able to see the source code.

EDIT:

After some investigation I can say that:

Eclipse --> Debug As -> Java Application works and finds the source code.

So this issue seems to be related to TestNG Test launch

答案1

得分: 0

The description and solution to this issue and a solution can be found here:

https://github.com/cbeust/testng-eclipse/issues/490

英文:

The description and solution to this issue and a solution can be found here:

https://github.com/cbeust/testng-eclipse/issues/490

huangapple
  • 本文由 发表于 2020年7月28日 07:59:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/63125222.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定