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 161727

Summary: Ability to run one test *method*
Product: java Reporter: _ tboudreau <tboudreau>
Component: JUnitAssignee: Andrey Yamkovoy <kaktus>
Status: RESOLVED DUPLICATE    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description _ tboudreau 2009-04-02 05:59:24 UTC
There is a general problem with JUnit that we treat each Java file as a "test" but really each test *method* is a test.
 Very often I find myself commenting out all but one test method in a file so that the test in the area that I'm working
on runs faster, or so I only get logging from that one test method.

Given that we control the compiler, the same functionality that gives us compile-on-save could be used to do this -
especially with JUnit 4 - just recompile the test file but strip the @Test annotations from the bytecode for all but the
one test you want to run (you could do this with junit 3 by modifying the method names).

This would probably improve my productivity with unit tests 1000% when working on any project with a lot of existing
tests, especially long-running ones or GUI tests.
Comment 1 Andrey Yamkovoy 2009-04-02 13:01:34 UTC

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