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 189708 - NullPointerException at org.netbeans.modules.java.api.common.project.BaseActionProvider.setupTestSingle
Summary: NullPointerException at org.netbeans.modules.java.api.common.project.BaseActi...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.0
Hardware: All All
: P2 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
: 189766 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-08-20 08:20 UTC by Alexandr Scherbatiy
Modified: 2010-08-25 03:20 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 171420


Attachments
stacktrace (2.81 KB, text/plain)
2010-08-20 08:20 UTC, Alexandr Scherbatiy
Details
stacktrace (2.81 KB, text/plain)
2010-08-20 08:47 UTC, Alexandr Scherbatiy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandr Scherbatiy 2010-08-20 08:20:07 UTC
Build: NetBeans IDE Dev (Build 201008200001)
VM: Java HotSpot(TM) Client VM, 16.3-b01, Java(TM) SE Runtime Environment, 1.6.0_20-b02
OS: Windows XP

Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.java.api.common.project.BaseActionProvider.setupTestSingle(BaseActionProvider.java:954)
   at org.netbeans.modules.java.api.common.project.BaseActionProvider.getTargetNames(BaseActionProvider.java:621)
   at org.netbeans.modules.web.project.WebActionProvider.getTargetNames(WebActionProvider.java:370)
   at org.netbeans.modules.java.api.common.project.BaseActionProvider$1Action.run(BaseActionProvider.java:414)
   at org.netbeans.modules.java.api.common.project.BaseActionProvider.invokeAction(BaseActionProvider.java:555)
   at org.netbeans.modules.project.ui.actions.FileCommandAction.actionPerformed(FileCommandAction.java:108)
Comment 1 Alexandr Scherbatiy 2010-08-20 08:20:11 UTC
Created attachment 101559 [details]
stacktrace
Comment 2 Alexandr Scherbatiy 2010-08-20 08:44:34 UTC
Steps to reproduce:

- Create the Calculator Web Service with add method:
http://netbeans.org/kb/docs/websvc/jax-ws.html

- Select the web service and choose Test Web Service

 The exception pops up
Comment 3 Alexandr Scherbatiy 2010-08-20 08:47:44 UTC
Created attachment 101560 [details]
stacktrace
Comment 4 Milan Kuchtiak 2010-08-20 13:45:01 UTC
Cannot see any connection to specific WS code.
Reassigning to web project.
Comment 5 David Konecny 2010-08-23 01:36:33 UTC
f21634669d0b
Comment 6 Tomas Zezula 2010-08-23 15:36:19 UTC
Not very good fix. Reopening and rolling back when available in jet-main.
Please commit changes in the java modules only into jet-main repository to prevent merge conflicts. Thanks
Comment 7 Tomas Zezula 2010-08-23 15:37:29 UTC
*** Bug 189766 has been marked as a duplicate of this bug. ***
Comment 8 Tomas Zezula 2010-08-23 18:34:42 UTC
The problem is caused by the fact thaat "Test File" action is not the same action as "Test Web Service".
The Test Web service is missing. Milan should evaluate why. The Test File action tries to find out the unit test (in test sources) and run it. Unfortunately it does not find it and it fails with exception. I will push a fix which fixes the exception but it does not solve the root problem "Where is the Test Web Service action?"
Comment 9 David Konecny 2010-08-23 21:34:38 UTC
My understanding of the problem was that a user tried to execute Test File on a Web Service class which does not have unit test associated. Unit test for a web service is still just plain junit test. Milan should clarify though.

> Reopening and rolling back when available in jet-main.
> Please commit changes in the java modules only into jet-main repository to
> prevent merge conflicts.

This is first time I've heard such a request. And it does not make much sense IMO - if I'm fixing a problem which goes through several repos (java.api.common + j2ee.common module changes I used to do quite often) how would you go about that? Such change should be done in one commit. In any case I would not want to maintain locally a repo for my team, your team, core team, etc. That would be overkill. The idea was always that team repos would minimize conflicts but they can still happen. Alternative is that I'm happy to leave to fix issues in java.api.common on you. :-)
Comment 10 Alexandr Scherbatiy 2010-08-24 08:32:35 UTC
> The problem is caused by the fact thaat "Test File" action is not the same
> action as "Test Web Service". The Test Web service is missing.

Created the issue 189798 Test Web Service option is missed
Comment 11 Milan Kuchtiak 2010-08-24 08:51:06 UTC
>My understanding of the problem was that a user tried to execute Test File on a
Web Service class which does not have unit test associated. Unit test for a web
service is still just plain junit test. Milan should clarify though.

Right, The "Test Web Service" action is available only on Web Service nodes (project->Web Services->XService).
The Test File is related to regular java unit tests, the "Test Web Service" action opens the browser with WS Tester Application (running on GlassFish or WebLogic).

Note, this is apparently a problem of web project. The exception is thrown when calling Test File on any java file (in web project). 

Unlike in J2SE project, the "Test File" action is available on all java source nodes regardless the unit test exists or not.
Comment 12 Tomas Zezula 2010-08-24 11:57:16 UTC
In the duplicate of this issue, the user mentioned that he had followed the tutorial http://netbeans.org/kb/docs/websvc/jax-ws.html. The tutorial has a step "Test Web Service" but it's not available. The only action is "Test file" which does regular JUnit testing.
Comment 13 Tomas Zezula 2010-08-24 12:48:36 UTC
Fixed in jet-main 8daa2ca4c591
Comment 14 Quality Engineering 2010-08-25 03:20:11 UTC
Integrated into 'main-golden', will be available in build *201008250001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/8daa2ca4c591
User: Tomas Zezula <tzezula@netbeans.org>
Log: #189708:NullPointerException at org.netbeans.modules.java.api.common.project.BaseActionProvider.setupTestSingle