从调用层次结构中隐藏单元测试
在“调用层次结构”视图中,它显示了调用所选方法的所有方法。我希望能够过滤掉 src/test/java 中的所有内容,这样我就可以看到实际代码正在调用什么,而不是 100 个单元测试方法。
我尝试在 Test 上添加名称过滤器,但似乎不起作用。我认为过滤器是基于方法名称的,而且我使用的是 JUnit 4,所以方法名称不包含 test,只是一个注释,尽管我们的类名称通常以 Test 或 TestIT 结尾。还有其他方法可以根据源文件夹或类名称进行过滤吗?
我使用 Indigo 和 M2Eclipse 来配置标准 Java 项目。
谢谢,
In the "Call Hierarchy" View, it shows all methods calling a selected method. I'd like to be able to filter out everything in src/test/java so I can see what actual code is calling, instead of 100 Unit test methods.
I tried adding a name filter on Test but it didn't seem to work. I think that filters based on method name, and I'm using JUnit 4 so method names don't contian test, just an annotation, though our class names generally end in Test or TestIT. Any other ways to filter based on source folder or Class name?
I'm using Indigo with M2Eclipse to configure standard Java projects.
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
测试类和方法不应该再可见。
Eclipse Photon 中添加了“过滤器测试代码”复选框。在早期版本中,您可以选择“命名过滤模式”复选框,并根据命名约定过滤测试(例如,如果类以“Test”结尾,则输入
*Test
)。The test classes and methods should not be visible anymore.
The "Filter Test Code" checkbox was added in Eclipse Photon. In earlier versions, you can select the "Name filter patterns" checkbox and filter tests based on your naming convention (e.g. if the classes end with "Test" then enter
*Test
).您可以定义一个仅包含 Java 源代码但不包含单元测试的工作集,然后选择“搜索范围”>呼叫层次结构视图菜单中的工作集...。
搜索帮助以获取有关工作集的更多详细信息。
You can define a Working Set that only includes Java source but excludes your unit tests, then select Search Scope > Working Set... in the Call Hierarchy view menu.
Search the help for more details on Working Sets.