Goes to show you, that you can teach an old dog new tricks. After years of using Eclipse I stumbled across a feature I am sure has existed since the glory days of Visual Age.
I had added yet another test method to a large JUnit TestCase class. I wanted to just run and re-run the new method 'til I had it just right without having to run all the other methods as well.
Yes of course, I could comment out all the other methods or just remove the @Test annotation. Back in the JUnit 3 days we have all -- at one time or another -- disabled tests by changing the "test" prefix of the test methods.
Somehow today, all these seemed abhorrent.
I wondered what would happen if I simply highlighted the method I wanted to test, and selected Run As > JUnit Test from the context menu.
Voila! That was the ticket!! It ran just the test I had wanted run.
As a bonus it even added TestCase.method_name as a "Run Configuration" for ease of future use.
FTW!
Tuesday, April 07, 2009
Subscribe to:
Posts (Atom)