How to find Junit tests that are using a given Java method directly or indirectly
Posted
by IT-Worx
on Stack Overflow
See other posts from Stack Overflow
or by IT-Worx
Published on 2010-03-11T17:05:05Z
Indexed on
2010/03/12
3:17 UTC
Read the original article
Hit count: 181
Assume there are Java project and Junit project in an Eclipse workspace. And All the unit tests are located in the Junit project and dependent on the application Java project. When making changes to a Java method, I need to find the unit tests that are using the method directly or indirectly, so that I can run the corresponding tests locally in my PC before checking into source control. I don't want to run the entire junit project since it takes time.
I could use Eclipse call hierarchy to expand caller methods one by one until I find a test method. But for a project including more than 1 million lines of source code, digging down the call hierarchy takes time too.
The search scope within call hierarchy view doesn't seem help much.
Appreciate any help.
© Stack Overflow or respective owner