Currently, through NetBeans 6.0 UI it is possible to run JUnit tests on a whole project or on a selected file. It would
be nice to select folders/files (or in sources either tests folders) and then be able to run tests for them, especially
this is supported by build-iml.xml. It is possible to do this using Run Target->Advanced on the xml file and then
setting javac.included and test.included, but this is inconvenient.
It's still the case for NB 6.5. As a side-effect you could multiple selection in project tree, invoke Test File by
Ctrl+F6, but only tests for one selected file are executed.
See also issue 143763
*** Bug 185379 has been marked as a duplicate of this bug. ***
When the "Test File" menu item in the Project window does not support multiple
It should either:
- be disabled when more than one file is selected.
- launch the test for all the selected classes (at least those with are JUnit
or TestNG compatible).
Tested on 6.9 Beta
*** Bug 229778 has been marked as a duplicate of this bug. ***
*** Bug 234031 has been marked as a duplicate of this bug. ***
*** Bug 234255 has been marked as a duplicate of this bug. ***
*** Bug 143763 has been marked as a duplicate of this bug. ***
*** Bug 203078 has been marked as a duplicate of this bug. ***
Planning for next release. Thank you for reporting
When right-clicking on a package selection, it would be useful if all the following options were available:
* Run all tests in this package (excluding sub-packages)
* Run all tests in this package (including sub-packages)
* Run all tests in sub-packages (excludes current package)
Created attachment 142018 [details]
I am attaching the changes needed in order for this feature to work.
The user can invoke "Test Package(s)" action to test all the files under the selected package(s).
The selected package(s) must all be under source or test roots and cannot intermix.
Additionally, the user can invoke "Test File(s)" action to test all the selected file(s).
The selected file(s) can be under source or test roots and can intermix.
I am starting a review for two changes:
Added new method in o.apache.tools.ant.module.api.support.ActionUtils class
in order to also search for files under a selected package.
Modified the build-impl.xsl files for java.j2seproject, j2ee.clientproject, j2ee.ejbjarproject and web.project types.
I think this is a compatible change but I would appreciate any comments on this to avoid braking the scripts.
Please review these two changes. Any comments on the other parts are also welcomed. Thank you
Created attachment 142022 [details]
updated the patch to handle the case were in a maven project multiple files are selected from both source and test packages and "Test Files" action is invoked on them
Created attachment 142104 [details]
While trying to sync the j2se behavior to the api.support one I realised that there is no need for new method in o.apache.tools.ant.module, so I am updating the patch. Please, comment on the changes in build scripts. Thank you
Seems good to me.
Created attachment 142185 [details]
minor change in maven project case so that when "Test package" is invoked all tests under that package are run recusively. If there are no objections I will integrate tomorrow. Thank you
Fixed: http://hg.netbeans.org/core-main/rev/c03915e9d1b0. Thank you for the comments.