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.
Run Focused Test Method action is always enabled - that is correct for test files but apparently incorrect for source files (files located underneath Source Packages/Files/...). I guess this action should not be present for such files at all or it should be disabled, at least. Thanks. Product Version: NetBeans IDE Dev (Build 20130312-8850981501c6) Java: 1.6.0_43; Java HotSpot(TM) 64-Bit Server VM 20.14-b01 Runtime: Java(TM) SE Runtime Environment 1.6.0_43-b01 System: Linux version 3.5.0-25-generic running on amd64; UTF-8; cs_CZ (nb)
Leaving the action enabled substantially improves the performance of the editor context menu throughout the project. If the command cannot be disabled without negatively impacting the display performance, it could stay enabled but should show a message if the user executes it at an unsupported location. Currently it is a silent failure if the command fails.
I think that to be correct - I mean to show the action only in test files - is definitely something what should be done, so it would be great if we could fix this issue. Thanks.
BTW I am pretty sure that we have more actions like this one (at least in PHP) and there are no performance issues with them, AFAIK. Thanks.
Fixed: http://hg.netbeans.org/core-main/rev/b7000bb07e9d
Your fix will work only for Java, right? Or am I missing something? Reopening... Thanks.
What about to extend API/SPI and ask whether the given file is a test or not? If there is any performance problem with it, the API/SPI client will solve it. Thanks.
Created attachment 135805 [details] proposed patch
(In reply to comment #6) > What about to extend API/SPI and ask whether the given file is a test or not? > If there is any performance problem with it, the API/SPI client will solve it. > > Thanks. Fair enough. I attached a proposed patch to solve this issue. AFAICT junit, testng, php.project and groovy.support are among the clients that override TestMethodDebuggerProvider/TestMethodRunnerProvider. I added appropriate implementations to those clients. I am not sure about com.sun.tools.tuxedo.testrunner and this is why the newly added method isTestClass is not abstract. Please review the new api and client implementations. Thank you
Integrated into 'main-golden', will be available in build *201306142301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/b7000bb07e9d User: Theofanis Oikonomou <theofanis@netbeans.org> Log: #227358 - Run Focused Test Method always enabled
Patch seems to be fine to me, thanks for it. Also, IMHO it is totally OK to add a method with default implementation (especially for friend API). Thanks.
If there are no objections I will integrate tomorrow. Thank you for your comments.
Thank you for the review. Fixed: http://hg.netbeans.org/core-main/rev/2da01d30c58b
increasing spec version in php: http://hg.netbeans.org/core-main/rev/8f909b5e0c89
Integrated into 'main-golden', will be available in build *201306242301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/2da01d30c58b User: Theofanis Oikonomou <theofanis@netbeans.org> Log: #227358 - Run Focused Test Method always enabled
I am dissatisfied with this hack as I explained in bug 232519 Please find a more elegant way of detecting whether a Java source file is in Test Packages.