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.

Bug 173724 - Cannot run individual test from GUI (Run File disabled)
Summary: Cannot run individual test from GUI (Run File disabled)
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 6.x
Hardware: Macintosh All
: P3 blocker (vote)
Assignee: Milos Kleint
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-05 10:07 UTC by emi
Modified: 2009-10-09 22:58 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description emi 2009-10-05 10:07:18 UTC
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.
Comment 1 Milos Kleint 2009-10-06 07:28:26 UTC
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?
Comment 2 Milos Kleint 2009-10-06 09:39:31 UTC
http://hg.netbeans.org/main/rev/2d3ed0579bd2
Comment 3 emi 2009-10-07 08:14:00 UTC
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.
Comment 4 emi 2009-10-07 09:00:08 UTC
PS: Actually it seems to be the same exception. And I also get this when I try to run Debug-> Debug Test File.
Comment 5 emi 2009-10-08 14:57:28 UTC
Just wanted to confirm that with 6.8 M2, Run->Test file and Debug->Debug Test File works.
Comment 6 Quality Engineering 2009-10-09 22:58:42 UTC
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