Panduka
Panduka

Reputation: 402

How can I connect TestNG javadocs to Eclipse?

Although we can find TestNG javadocs, is there a way to download a srcs.jar and connect to Eclipse?

Upvotes: 2

Views: 764

Answers (1)

Naveen Kumar R B
Naveen Kumar R B

Reputation: 6398

Steps:

  1. Download the jar file based on your version of testng, here. The jar file name should be like testng-version-sources.jar
  2. Extract to one of the locations.
  3. Then go to the eclipse project that you want to add source jar.
  4. Short cut: Double click on any of the testng class/annotation in your source code, like double click on @Test annotation.
  5. Eclipse tries to open Test.class source code. As src jar is not yet present, gives option Attach Source. click on the button.
  6. select External location radio button.
  7. select the jar file, which is downloaded.
  8. Click on Ok. you will get the source code for Test.class (of course, for all other testng classes as well)

Upvotes: 2

Related Questions