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 158455 - absent of "Debug Test" actions
Summary: absent of "Debug Test" actions
Status: RESOLVED DUPLICATE of bug 158812
Alias: None
Product: java
Classification: Unclassified
Component: Navigation (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Vitezslav Stejskal
URL:
Keywords: REGRESSION, USABILITY
Depends on: 119922
Blocks:
  Show dependency tree
 
Reported: 2009-02-12 13:44 UTC by Vladimir Voskresensky
Modified: 2009-04-15 14:20 UTC (History)
2 users (show)

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 Vladimir Voskresensky 2009-02-12 13:44:26 UTC
Test files from "Unit test packages" have "Run File" (Shift+F6) and "Debug File" (Ctrl-Shift-F5) actions which are
useless. Choosing that action shows popup with message:
Class "null" does not have a main method

Test files should have actions "Run Test File" (Ctrl+F6) and "Debug Test File" (Ctrl-Shift-F6)


  Product Version         = NetBeans IDE Dev (Build 090212)
  Operating System        = SunOS version 5.10 running on x86
  Java; VM; Vendor        = 1.6.0_11; Java HotSpot(TM) Client VM 11.0-b16; Sun Microsystems Inc.
  Runtime                 = Java(TM) SE Runtime Environment 1.6.0_11-b03
  Java Home               = /usr/jdk/instances/jdk1.6.0_11/jre
  System Locale; Encoding = en_US (nb); UTF-8
Comment 1 Vladimir Voskresensky 2009-02-12 13:45:46 UTC
some time ago it was possible to use run/debug actions from context menu for junit test files
Comment 2 Vitezslav Stejskal 2009-02-13 08:20:55 UTC
The Run -> 'Test File' and Debug -> 'Debug Test File' actions work fine. You have to invoke them on the original class
(not the test class). The 'Run File', 'Debug File' when invoked on the test class fail as you said. I'll investigate
what's wrong.
Comment 3 Vitezslav Stejskal 2009-02-13 12:26:23 UTC
OK, please disregard my last message, it's not entirely correct. The current behavior is as designed and as requested in
issue #119922. To put it in words I'm copy-pasting jrojcek's description from #119922:

---
Run File - runs the main method
Test File - runs the selected test class or the associated test class for the selected regular class
---

---
Debug File - debugs the main method
Debug Test File - debugs the selected test class or the associated test class for the selected regular class
---

And that's exactly how it works in current trunk. As a consequence of #119922 when a test class has no main method the
Run/Debug actions show the dialog that you mentioned. I'm not sure why you got the 'null' in the message though. When I
tried it it showed the name of the test class.
Comment 4 Vitezslav Stejskal 2009-02-13 12:28:38 UTC
In the popup menu on a file's node there is a 'Test File' action, but no 'Debug Test File', which IMO is fine. You can
use 'Debug Test File' from the main menu or use the shortcut.

Product Version: NetBeans IDE Dev (Build 090212)
Java: 1.5.0_14; Java HotSpot(TM) Client VM 1.5.0_14-b03
System: Linux version 2.6.22-16-generic running on i386; UTF-8; en_US (nb)
Comment 5 Vladimir Voskresensky 2009-02-13 13:11:45 UTC
Vita,
Please, advise what to do. Because I found it as real usability problem. 

I don't agree with such "by design" when JUnit test file has useless actions in context menu and doesn't have useful.
Which IZ to reopen?
I'd vote for removing useless "Run File", "Debug File" from context menu of JUnit test files and add useful "Test File"
and "Debug Test File" instead
Comment 6 Vitezslav Stejskal 2009-02-13 14:26:16 UTC
Hi Vladimir, I'm sorry that you have a problem with this. If you think the current state has major usability problems
please escalate it on nbui (I think, CC Jano to be sure).

I'd like to point out that Run/Debug actions on a test class are not useless. If the test class has the main method
these actions will run/debug the class through this main method (as requested in #119922). Also there __is__ the 'Test
File' action in the popup menu on test classes and it runs tests in the test class. And finally shortcuts for all four
actions work.

So the only thing that you are asking for and that is missing is the 'Debug Test File' action in the popup menu on test
classes. If that is indeed what you want we could probably add it if UI folks agree.

I'm leaving this opened as P3/future so that we can discuss it further.
Comment 7 Vladimir Voskresensky 2009-02-13 14:49:25 UTC
Hi, Vita,
You are right about "Test File" action, it's here, so I was not right. (so P3 is fine)
And yes, I'd like to see "Debug Test File" action as well, because it's usual work flow in our group to fix problems by
creating test and work with it in Debug mode.
When 7.0 will be release and other developers from our group will miss "Debug" action in context menu they will complain
:-) But it will be too late to fix
Comment 8 Alexei Mokeev 2009-04-15 14:20:43 UTC
Absence of "Debug Test" action is clearly described in 158812. 
BTW, as an interim workaround in current dev builds you could use 'Debug' popup menu from test results window.

*** This issue has been marked as a duplicate of 158812 ***