隐藏呼叫层次结构中的单元测试 [英] Hide unit tests from Call Hierarchy

查看:79
本文介绍了隐藏呼叫层次结构中的单元测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在调用层次结构"视图中,它显示所有调用选定方法的方法.我希望能够过滤掉src/test/java中的所有内容,以便可以看到实际的代码正在调用,而不是100个单元测试方法.

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.

我尝试在 Test 上添加名称过滤器,但是它似乎不起作用.我认为这些过滤器是基于方法名称的,并且我使用的是JUnit 4,因此尽管我们的类名称通常以Test或TestIT结尾,但是方法名称不会包含测试内容,只是一个注释.还有其他根据源文件夹或类名称进行过滤的方法吗?

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?

我将Indigo与M2Eclipse一起使用来配置标准Java项目.

I'm using Indigo with M2Eclipse to configure standard Java projects.

谢谢

推荐答案

  1. 在呼叫层次结构"视图中,单击白色的向下箭头图标.
  2. 选择过滤器...".
  3. 检查过滤器测试代码".
  4. 单击刷新按钮(或按F5).

测试类和方法不再可见.

The test classes and methods should not be visible anymore.

在Eclipse Photon中添加了过滤器测试代码"复选框.在早期版本中,您可以选择名称过滤器样式"复选框,并根据您的命名约定过滤测试(例如,如果类以"Test"结尾,则输入 * Test ).

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).

这篇关于隐藏呼叫层次结构中的单元测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆