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 191763 - Improve productivity by providing a way to run a single test
Summary: Improve productivity by providing a way to run a single test
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal with 2 votes (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords:
: 195603 195867 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-11-09 18:01 UTC by mjr_1974
Modified: 2013-03-20 18:54 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mjr_1974 2010-11-09 18:01:11 UTC
When adding an new test to a test class, the IDE should give the option to run that test alone. This will be extremely beneficial for developers test driving GUIs (my case right now). GUI testing is very time consuming, and each time a new test is added to a class I need to wait longer and longer to have the new test executed.
One way of implementing this will be to add a new menu item at the top of the contextual menu, when the cursor is inside a test method in a test class.
Comment 1 Yulia Novozhilova 2011-04-26 09:28:03 UTC
*** Bug 195603 has been marked as a duplicate of this bug. ***
Comment 2 Yulia Novozhilova 2011-05-04 10:09:47 UTC
Looks like it is fixed. At least in 7.0 I see item "Run Focused Test" in the menu and can run single test.
Comment 3 Yulia Novozhilova 2011-05-04 10:28:06 UTC
*** Bug 195867 has been marked as a duplicate of this bug. ***
Comment 4 mjr_1974 2011-05-13 13:41:30 UTC
I see the item "Run Focused Test" but it is always disabled... How should that work? (In reply to comment #2)
> Looks like it is fixed. At least in 7.0 I see item "Run Focused Test" in the
> menu and can run single test.
Comment 5 Hootch 2011-05-25 13:47:59 UTC
Current IDE:

In 7.0 you can't select a single method to run test code. You don't see also the methods inside the junit window TestClass Treeview. You see only the name of the test class.


Should be:

Open in the Junit Dialog the tree view and see the last Class(es) and expand the child entries (the methods of a test class).
With right click on a method you can execute in RUN or DEBUG everytime.

---

The goal of this change request is the same behavior like eclipse junit dialog.
Comment 6 mjr_1974 2011-05-25 18:36:25 UTC
I think the implementation chosen is a good first step, although the problem is that it doesn't work...
Comment 7 Hootch 2011-06-02 10:38:47 UTC
Additional note:

In version 6.9.1 (Windows) you got in the junit dialog window as child entries the methods of the test class. And you can restart it in run/debug mode. In NB 7.0 you can't do and see that :) In NB 7.0 you can select with the right mouse click insight the focused method body - the method in run/debug mode.

Perhaps it should be possible to merge the both features from 6.9.1 and 7.0 in the next milestone. Please check out the last features (6.9.1) and redevelop into the next milestone.

Greets Hootch
Comment 8 markiewb 2013-03-20 17:28:30 UTC
(In reply to comment #7)
> Additional note:
> 
> In version 6.9.1 (Windows) you got in the junit dialog window as child entries
> the methods of the test class. And you can restart it in run/debug mode. In NB
> 7.0 you can't do and see that :) In NB 7.0 you can select with the right mouse
> click insight the focused method body - the method in run/debug mode.
> 
> Perhaps it should be possible to merge the both features from 6.9.1 and 7.0 in
> the next milestone. Please check out the last features (6.9.1) and redevelop
> into the next milestone.
> 
> Greets Hootch


Works for me in 7.3. Tested with a plain java project and junit 4.
* In the "Test Result" view the Testclass can be expanded and a method can be run/debugged separately.
* The context menu items "run/debug focused test method" in the editor work. Please note that the test-sources have to be in the test package folders. Please check your project properties at the category "sources".
Comment 9 Hootch 2013-03-20 18:54:09 UTC
Test: Netbeans 7.3
Plattform: Windows 7

Description:

- Run class with all methods: ok
- Run single method: ok
- Test navigate source: ok
- Use test as run/debug execution: ok

It runs well :) Thanks a lot