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.
In 6.5 I used to call "Run File" for junit tests. This is disabled in 6.8 m1. The only way to run this is if I create a custom maven goal (test with paramter test=MyTest). When using this, the IDE seems to "pick it up" that I'm running a test and I do see the Junit window with the output, etc. But if the test fails, "Run again" for an individual test throws some exception: java.lang.NullPointerException at org.netbeans.api.java.classpath.ClassPath.parseResourceName(ClassPath.java:833) at org.netbeans.api.java.classpath.ClassPath.findResource(ClassPath.java:367) at org.netbeans.modules.maven.cos.CosChecker.checkRunTest(CosChecker.java:379) at org.netbeans.modules.maven.cos.CosChecker.checkRunConfig(CosChecker.java:131) at org.netbeans.modules.maven.execute.PrereqCheckerMerger$Impl.checkRunConfig(PrereqCheckerMerger.java:84) at org.netbeans.modules.maven.ActionProviderImpl.runGoal(ActionProviderImpl.java:231) at org.netbeans.modules.maven.ActionProviderImpl.invokeAction(ActionProviderImpl.java:220) at org.netbeans.modules.maven.ActionProviderImpl$1.run(ActionProviderImpl.java:177) Not sure if the exception isn't a separate bug from the "Run File" missing.
to run tests, in 6.7+ you need to invoke "test file", "run file" is reserved for running via main() method (and similar). Same applies to debug file/debug test actions. the exception is indeed a bug, we didn't count with hardwired test property values, the assumption is the action will always have an associated test file, while here it doesn't (is that correct? do you invoke the action on the project node or the test file node?
http://hg.netbeans.org/main/rev/2d3ed0579bd2
Well,the reason I did that custom maven goal with the -Dtest option is because if I try Run->Test File I get some other exception: java.lang.NullPointerException at org.netbeans.api.java.classpath.ClassPath.parseResourceName(ClassPath.java:833) at org.netbeans.api.java.classpath.ClassPath.findResource(ClassPath.java:367) at org.netbeans.modules.maven.cos.CosChecker.checkRunTest(CosChecker.java:379) at org.netbeans.modules.maven.cos.CosChecker.checkRunConfig(CosChecker.java:131) at org.netbeans.modules.maven.execute.PrereqCheckerMerger$Impl.checkRunConfig(PrereqCheckerMerger.java:84) at org.netbeans.modules.maven.ActionProviderImpl.runGoal(ActionProviderImpl.java:231) at org.netbeans.modules.maven.ActionProviderImpl.invokeAction(ActionProviderImpl.java:220) at org.netbeans.modules.maven.ActionProviderImpl$1.run(ActionProviderImpl.java:177) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:602) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1070) Caused: org.openide.util.RequestProcessor$FastItem: task failed due to So, except that custom goal trick I cannot run individual junit tests.
PS: Actually it seems to be the same exception. And I also get this when I try to run Debug-> Debug Test File.
Just wanted to confirm that with 6.8 M2, Run->Test file and Debug->Debug Test File works.
Integrated into 'main-golden', will be available in build *200910091401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/2d3ed0579bd2 User: Milos Kleint <mkleint@netbeans.org> Log: #173724 fix a corner case scenario when a custom action contains hardwired test property declaration