testng-eclipse icon indicating copy to clipboard operation
testng-eclipse copied to clipboard

Option "Convert to TestNG" should take in account existing JUnit tests when generating testng.xml

Open alexbchr opened this issue 10 years ago • 1 comments

I think the Convert to TestNG wizard should have an additionnal checkbox, for including JUnit test cases in the testng.xml. The thing is that they are already included, but in the same Test tag as TestNG tests, so executing the corresponding testng.xml file won't run the JUnit tests, even if they are referenced in the XML. Although, I would put the non migrated JUnit tests in another XML Test tag with junit="true" so TestNG can run them. Checking the checkbox to run JUnit tests would put the JUnit tests in that tag, otherwise they would be completely removed from the generated testng.xml.

Also, according to me it is a bug, but the second page of the Wizard (the one for the refactoring) let you check TestNG classes as well as JUnit classes. If you check TestNG classes, certain TestNG packages get imported twice in the file.

I took your code for a school project, in order to integrate your plugin with multiple others. The thing is that I already implemented the above functionnality and corrected the bug I mentioned. I could do a Pull request and get that functionnality in the TestNG plugin as well.

Here is a screenshot of what I mean : image

Here is another example of the same window but with the checkbox unchecked : image

alexbchr avatar Aug 19 '15 15:08 alexbchr

@alexbchr could you submit a PR for this, thanks:)

missedone avatar Oct 03 '15 12:10 missedone