如何查找直接或间接使用给定Java方法的Junit测试 [英] How to find Junit tests that are using a given Java method directly or indirectly
问题描述
我可以使用Eclipse调用层次结构逐个扩展调用方法,直到找到一个测试方法。但是对于包含100多万行源代码的项目,挖掘调用层次结构也需要时间。
调用层次结构视图中的搜索范围似乎没有帮助
欣赏任何帮助。
工具。看到我的答案:
如何查找可能直接或间接调用给定方法的所有单元测试? (.net)
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.
Use a test coverage tool. See my answer:
How do I find all the unit tests that may directly or indirectly call a given method? (.net)
这篇关于如何查找直接或间接使用给定Java方法的Junit测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!