I can run the whole Junit test using:
Shift + Alt + X, T
But how I can run a single test? Using the mouse I click on concrete method and Run As -> Junit test
anyone know shortcut for this case ?
Thanks
Shift + Alt + X, T runs one test method if the caret is on the method name.
I find the "Shift-Alt-X" gives me trouble sometimes, sometimes what I think is the last executed command is not always and sometimes I end up running something I did not mean to. Also when doing TDD you rerun the tests so often and sometimes want to rerun the test from one project for a while, then you are on to the next project and want to start running its tests. Or you might be focusing on a specific area and only want to run a single unit test few a while. In this case I find I would like to simply rerun my last tests often and I find "Shift-Alt-X" to be a bit cumbersome.
So what I do is "Windows" > "Preferences" then click "General" > "Keys". Sort the table by "Command" and scroll down until you find "Rerun JUnit Test - Failures First" and "Rerun JUnit Test". Click on one of those and set the "Binding" field to whatever keyboard shortcut you want to use. Personally I set "Rerun JUnit Test" to CTRL+F5 so that its similar to refreshing a browser (plus this give me the quick and easy save/rerun combo of hitting CTRL+S, then CTRL+F5).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With