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 254980 - NullPointerException at org.netbeans.modules.maven.junit.ui.MavenJUnitTestMethodNode.getTestcaseFileObject
Summary: NullPointerException at org.netbeans.modules.maven.junit.ui.MavenJUnitTestMet...
Status: RESOLVED INCOMPLETE
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-03 16:48 UTC by Jiri Kovalsky
Modified: 2015-09-10 09:20 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 219667


Attachments
stacktrace (3.61 KB, text/plain)
2015-09-03 16:48 UTC, Jiri Kovalsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Kovalsky 2015-09-03 16:48:48 UTC
Build: NetBeans IDE Dev (Build 201509030002)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.51-b03, Java(TM) SE Runtime Environment, 1.8.0_51-b16
OS: Linux

User Comments:
jkovalsky: I created JUnit tests for "teststorun" package, then run "Test" action from project's popup menu which showed that all tests failed, then I deleted "teststorun" package under "TestPackages" node and then I double clicked some failed test in "Test Results" window to navigate to the test e.g. "testDoSomething". Exception was thrown. I know I should not have deleted the tests and then trying to navigate to them but still exception is not the right communication channel. :)




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.maven.junit.ui.MavenJUnitTestMethodNode.getTestcaseFileObject(MavenJUnitTestMethodNode.java:138)
   at org.netbeans.modules.maven.junit.ui.MavenJUnitNodeOpener.openCallstackFrame(MavenJUnitNodeOpener.java:191)
   at org.netbeans.modules.java.testrunner.ui.api.UIJavaUtils.openCallstackFrame(UIJavaUtils.java:114)
   at org.netbeans.modules.java.testrunner.ui.api.JumpAction$1.run(JumpAction.java:95)
   at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
   at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
Comment 1 Jiri Kovalsky 2015-09-03 16:48:50 UTC
Created attachment 155870 [details]
stacktrace
Comment 2 Tomas Stupka 2015-09-07 13:58:51 UTC
could not reproduce

jirka: 
- is this reproducible?
- what project type
- could it be there was more to the scenario then described?

when clicking on a failed test after the package was deleted i've just got the message
#221053: unknown location: com/mycompany/mavenproject125/newpackage/NewClassTest.java classname:com.mycompany.mavenproject125.newpackage.NewClassTest, stacktrace:
in the log, but no exception.

from the incriminated code line 
at org.netbeans.modules.maven.junit.ui.MavenJUnitTestMethodNode.getTestcaseFileObject(MavenJUnitTestMethodNode.java:138)
it is hard to say what was null:
- either the project
- or FileLocator from lookup

changed the place so that it will be more obvious in case the problem is reproduced in the future 
jet-main #2578674ecffe
Comment 3 Quality Engineering 2015-09-08 01:22:00 UTC
Integrated into 'main-silver', will be available in build *201509080002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/2578674ecffe
User: Tomas Stupka <tstupka@netbeans.org>
Log: Issue #254980 - NullPointerException at org.netbeans.modules.maven.junit.ui.MavenJUnitTestMethodNode.getTestcaseFileObject
- non functional change for easier diagnostic in case NPE occurs
Comment 4 Jiri Kovalsky 2015-09-10 09:20:40 UTC
No, it's not reproducible Tomasi. :| The only related thing from messages.log file is this warning but I doubt it could help:

INFO [org.netbeans.modules.maven.junit.ui.MavenJUnitNodeOpener]: #221053: unknown location: org/netbeans/test/bug_254980/teststorun/AbstractThingTest.java classname:org.netbeans.test.bug_254980.teststorun.AbstractThingTest, stacktrace:

Tested in:

Product Version: NetBeans IDE Dev (Build 201509090002)
Java: 1.8.0_60; Java HotSpot(TM) 64-Bit Server VM 25.60-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_60-b27
System: Linux version 3.13.0-37-generic running on amd64; UTF-8; cs_CZ (nb)