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.
Product Version: NetBeans IDE Dev (Build 200902060201) Java: 1.6.0_10; Java HotSpot(TM) Client VM 11.0-b15 System: Linux version 2.6.27-11-generic running on i386; UTF-8; en_US (nb) I started ergonomic IDE with a fresh userdir, I tried to debug a test for editor module. But I noticed Run/Debug items are disabled on JUnit test files in above mentioned build. Note: I can invoke "test file" above this file which does exactly what "run" used to do... (and imo it is not correct - test should be disabled above the file).
First of all I don't know why these items are disabled on the test classes nodes because on the my local trunk build I see these action enabled. Colud you please provide more details what project type you are using and what test you are trying to run/debug(pls attach if possible). But anyway you can't run/debug test files if there is not main(String args[]) method in it. To debug such a tests you need to select test file and invoke action "Debug Test File" from main menu "Debug" or by shortcut Ctrl+Shift+F6.
kaktus> Colud you please provide more details what project type you are using... joshis> I tried to debug a test for editor module. Project type is netbeans module (specifically, the Editor)... > But anyway you can't run/debug test files if there is not main(String args[]) method in it. > To debug such a tests you need to select test file and invoke action "Debug Test File" from > main menu "Debug" or by shortcut Ctrl+Shift+F6. Is it some UI change? The actions Run/Debug were available there and it was very convenient. See screenshots... It is logical - I want to run/debug the file that is a JUnit test. This file only need to have a "suite" method. What is there now: - "Test File" - this action's name doesn't make sense, it suggests that test for the file will be launched. If this is supposed to be the substitute for "Run File", it should be called "Run Test File". What is missing: - "Debug Test File" in the editor/projects context menu
Created attachment 76655 [details] NetBeans 6.5
Created attachment 76656 [details] NetBeans Dev (2008-Feb-06)
See http://wiki.netbeans.org/UIReviewProcess for details.
So, on the my build Run/Debug actions are enabled for KeyMapSuite test class and works properly. As for the UI changes I have not made any UI changes. I have just several days ago started to fix some JUnit issues.
This is really weird... I will try to build the IDE myself, maybe it was just a "bad build" (official trunk build though)? Making incomplete until reporter manages to build the fresh IDE;)...
Product Version: NetBeans IDE Dev (Build 200902090201) Java: 1.6.0_10; Java HotSpot(TM) Client VM 11.0-b15 System: Linux version 2.6.27-11-generic running on i386; UTF-8; en_US (nb) The problem can be reproduced with a build from 20090209. To reproduce: 1. Start full (ergonomic) IDE with a fresh userdir (!!!) 2. Open "editor" module (NetBeans Module) 3. Invoke contextual menu above the file suggested on screenshot -> run/debug is disabled
So, as far as I found this regression was made by the fix for issue #154358. Reassign to apisupport/project for evaluation.
This is a deliberate behavior, see issue #119922 with original proposal. Issue #154358 just made NBM projects consistent with the proposal, Java and Maven projects already behave this way in 6.5.
The lack of Debug Test [for File] in the context menu (only main menu / shortcut) is a minor functional regression that should perhaps be filed in java.source?
OK, just a few notes to explain why I am reopening this issue (with different summary): 1. This is a UI change - it should have gone through the review process (see link above) and UI specification (also above) should have been updated to reflect this behaviour. 2. There is no "debug test" in file's context menu - I have lost a convenient start point for debugging a JUnit test. I have to use the main menu or a shortcut, which is not so nice as the invocation from the context menu (when I invoke the context menu above a file, I know the action is really invoked for the file I want). 3. I cannot run/debug a normal test (AND THIS IS WHAT YOU DO IN 99%!!!!) from the editor's context menu as there is no item for it - but if the test by the accident had a main method (for some probably very clever reason), I can run it... cool... 4. A little bit of linguistic jam... What is the logic behind this: "Test file" invoked above a JUnit test class runs the test... ? IMO "Test file" invoked above JUnit test should run the test for that test. "Run Test" would make much better sense than "Test File"... "Test file" makes more sense above the class it is supposed to test => please at least change the actions name to "Run Test" and "Debug Test" (and update UI spec accordingly). So basically: we introduced several PITA issues (2,3) just because we wanted to allow someone to run main method from the file that is technically a JUnit test... ??? Now I will be maybe little stupid: What is a ratio behind having a JUnit test as a main class anyway??
As the saying goes, you are crying nicely, but on the wrong grave :). I also agree with points 2.-4. (and don't understand the importance of running main method in test class either), but this change merely made NBM projects consistent with other project types (including missing context menu actions). So if you want to have this changed, please reopen original issue #119922 instead, which is an umbrella for all types of projects and for which, I believe, UI review has been done.
OK, thanks Richard. ;)