Community
Participate
Working Groups
This is proposal for feature related to writing JUnit tests. When I am writing test in editor I would like to run/debug that test method that I am writing. Currently there is command that run all test methods in one class but I would like to run just one that I am currently having cursor at. If there is command for that then I could bind it to some keys.
You can use CMD+ALT+X (Open Run menu) and then "T" for JUnit tests. This will execute all tests when cursor is somewhere in the unit test class. When the cursor is on a test method, it will only execute this. Is this what you are searching for?
No. This will run all tests in test methods in one class that I am editing. I would like to run only one test method that I am currently in with cursor.
As I said: Put the cursor on the method name, and then only this method is executed, not all in the class.
However, this might be improvable to run the test method only that the cursor is IN. Also worth to mention is the codemining extension for JDT: https://github.com/angelozerr/jdt-codemining This will eventually integrated into JDT. With that you can have actions to execute single tests above the test method.
Regarding this: > As I said: Put the cursor on the method name, and then only this method is > executed, not all in the class. I didn't know for this feature that if you are on method name that it will run only this method. But is it not very practical. It would be mot practical as you suggested: > However, this might be improvable to run the test method only that the cursor is IN. Regarding: > Also worth to mention is the codemining extension for JDT: > https://github.com/angelozerr/jdt-codemining > This will eventually integrated into JDT. With that you can have actions > to execute single tests above the test method. I am using it, but it is not exposed as Command and in key bindings I can not mapped it to keys.
(In reply to Karsten Thoms from comment #4) > However, this might be improvable to run the test method only that the > cursor is IN. I'm not sure that would be an improvement, as it would make running *all tests* of a class significantly more difficult (hunt for the whitespace between some methods ...).
How is the behavior in other IDEs regarding the per method/per class activation? We need more insights about what is actually better usable. Stephan's remark is absolutely valid.