0

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

xavipen
  • 229
  • 1
  • 11
  • Looks like something similar https://stackoverflow.com/a/6754274/11311307. – saranraj jayaraj Jul 28 '20 at 00:39
  • No, is not. Eclipse should find the code running the unit test automatically. I should not need to add it. It is part of the default debug configuration – xavipen Jul 28 '20 at 04:08
  • When you say "it is a maven project", do the Maven tools in Eclipse recognize it as a Maven project? – nitind Jul 28 '20 at 15:36
  • In these circumstances, there's likely something you're not showing us which you didn't realize was important. It's best to show more information, including pictures of your project views. – David M. Karr Jul 28 '20 at 20:20
  • Nitind: Yes, it is recognized and also imported as a maven project in Eclipse. David M. Karr : To be honest I do not know what to show that would add more inside to the issue. Although your comment made me realize there is one thing i did not say. The project is in a local git repo. – xavipen Jul 28 '20 at 21:05

1 Answers1

0

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

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

xavipen
  • 229
  • 1
  • 11