This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | [72cat] TestNG wizard for Maven projects changes dependency version and generates not compilable code | ||
---|---|---|---|
Product: | java | Reporter: | crazyjavahacking |
Component: | TestNG | Assignee: | Theofanis Oikonomou <theofanis> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | anebuzelsky, jungi, mienamoo, mmirilovic, musilt2, pjiricka |
Priority: | P1 | ||
Version: | 7.2 | ||
Hardware: | PC | ||
OS: | Windows 7 x64 | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
Maven based TestNG project to test
proposed fix |
Created attachment 121009 [details]
proposed fix
attached possible fix for this issue, Theo - check, review and possibly apply it, please.
Thanks!
Thank you Lukas. Your patch takes care of not changing the dependency. Additionally I also download the artifacts. Now code is compilable. Fixed: http://hg.netbeans.org/core-main/rev/f7b9b063d0d6 Please verify. Thank you Integrated into 'main-golden', will be available in build *201206200001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/f7b9b063d0d6 User: Theofanis Oikonomou <theofanis@netbeans.org> Log: Issue #214395 - [72cat] TestNG wizard for Maven projects changes dependency version and generates not compilable code Verified in today build NetBeans Dev 201206200001. Just a small note. Before the dependency is in the local repository, the annotations will have fully qualified names (no imports). After the TestNG library is in local repository, imports will be used. Thank you for verifying. When the dependency is not locally present then the annotation use the FQN because the classes cannot be resolved. I believe this is expected though. I will integrate shortly. Integrated into release72 branch: http://hg.netbeans.org/releases/rev/52036fd5626e *** Bug 211364 has been marked as a duplicate of this bug. *** Integrated into 'releases', will be available in build *201206202200* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/52036fd5626e User: Theofanis Oikonomou <theofanis@netbeans.org> Log: Issue #214395 - [72cat] TestNG wizard for Maven projects changes dependency version and generates not compilable code (transplanted from f7b9b063d0d63a6c4f336d3296a5f823b5fe5185) ... pending verification in NB 7.2 |
Created attachment 121003 [details] Maven based TestNG project to test I just found very weird bug under certain circumstances. TestNG wizard for Maven projects changes the dependency version of TestNG !!! and generates not compilable code !!! To reproduce: 1.) !!! Remove all TestNG dependencies from local Maven repository (org.testng groupId) => without this step you will not be able to reproduce it 2.) Open attached Maven project => note that dependency version of TestNG is 6.5.1 and the project is compilable (dependencies will be downloaded during first compilation) => so far so good 3.) Click on source package and Tools->Create Tests and choose TestNG (all checkboxes should be checked) => The dependency will be changed to 6.5.2 ??? => The tests will not be compilable, because multiple methods with the same name will be generated (one with short and one with fully qualified name). - the weird thing is the fact that as soon as you will download the TestNG 6.5.2 dependency (it will be located in local Maven repository) this will work correctly for both 6.5.1 and 6.5.2 TestNG dependency version - as soon as you will remove the 6.5.2 dependency, it will happen again Affects both NetBeans 7.2 RC1 and NetBeans Dev 201206180001 JDK 7u5 32bit I think this is really a NetBeans 7.2 stopper because the first time programmer will generate TestNG tests for Maven project, it will be very ugly experience