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.
Build: NetBeans IDE Dev (Build 200809130201) VM: Java HotSpot(TM) Client VM, 1.5.0_13-119, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_13-b05-237 OS: Mac OS X, 10.5.4, i386 User Comments: Stacktrace: java.lang.NullPointerException: Must pass non-null build script at org.apache.tools.ant.module.api.support.ActionUtils.runTarget(ActionUtils.java:82) at org.netbeans.modules.contrib.testng.actions.RunTestClassAction.performAction(RunTestClassAction.java:58) at org.openide.util.actions.NodeAction.performAction(NodeAction.java:289) at org.openide.util.actions.CallableSystemAction$1.run(CallableSystemAction.java:118) at org.netbeans.modules.openide.util.ActionsBridge.doPerformAction(ActionsBridge.java:77) at org.openide.util.actions.CallableSystemAction.actionPerformed(CallableSystemAction.java:114)
Created attachment 69810 [details] stacktrace
No apparent category for testng module yet, so passing along to junit owner for now.
Sorry, I thought I had added some comments to this. I saw this on a multi-module maven projects. After right clicking on my test I chose TestNG -> Run Test Class and got this exception.
*** Issue 146853 has been marked as a duplicate of this issue. ***
Maven related...
most probably the testng module assumes AntArtifact and a build script. Which is a wrong assumption for maven projects.
Yes, I haven't been thinking about (supporting) maven :-( Anyway I tried to do some research in this area and I think I've found what I need to do in order to support it: when one creates testng test I need to add a surefire plugin definition into project's pom (if it isn't there already) with a pointer to test config file[1] and point actions to run maven (test) goals instead of ant targets. Question is - can I do all this stuff from my module or does it need to be done directly in meven ide modules? Any help and/or pointers are appreciated. Thanks. [1]: http://maven.apache.org/plugins/maven-surefire-plugin/testng.html
disclaimer: I don't have any personal experience with testng+maven so my assumptions might be wrong. On the basic level, I think it should be enough to just add the testng dependency to the maven project. That can be done without depending on maven modules, having a library definition with a valid maven-pom volume and passing it to ClassPathModifier shall be enough. if you however need to update the pom, you will indeed need a dependency on the maven modules (unless you want to modify the raw xml file of course) for running the tests, I suppose calling the standard ActionProvider's TEST/TEST_SINGLE/DEBUG_SINGLE actions should be enough. They execute either the test phase, or surefire:test goal and it should not matter if the actual tests are testng or junit. if you figure you need a special module to handle maven testng, then it shall be probably a special bridge module, depending both on testng module and maven modules.
changing the subject accordingly to what is required to do.
Thanks Milosi! http://hg.netbeans.org/main/contrib/rev/9fa2a76431d8 fixes NPE and adds some other minor fixes/improvements What needs to be done: -create default testng.xml and add path to pom.xml -see if changes in testng.xml for running tests will be picked up by maven/surefire plugin to run only a class/method etc and re-enable (or hide) what's needed re maven-pom volume: tried this, but PCM doesn't allow me to set scope and classifier for the library (which I need) re special module: good exercise for me :) definitely better solution, will try to find some time to do it
scope and classifier fixed http://hg.netbeans.org/main/rev/6fe12b254c55 http://hg.netbeans.org/main/rev/3c59350d95d3
Integrated into 'main-golden', will be available in build *200810101401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/6fe12b254c55 User: Milos Kleint <mkleint@netbeans.org> Log: #147188 encode a classifier in the library's maven-pom volume. Make it part of the url's #ref, rather than path.
thanks, Maven specific behaviour (mainly custom TestNG actions) can be now implemented in contrib's testng.maven module (look for execute(TestConfig): void there) - module is not in build yet - http://hg.netbeans.org/main/contrib/rev/e586a681a79a
done in contrib's 0bdb7709773c current solution is based on adding custom profile into project's pom which is being activated only from IDE by setting special property, Milos, can I ask you for a review, please? Thanks. btw: I already added maven testng module to the dev UC, it should appear there in few hours
=> contrib/testng