同一类别的所有测试在 Intellij 中仅显示为一个带有 TestNG 的测试结果,我希望这种情况不要发生。如何?
我一直在开发一个项目,其中包含一个 TestLauncher 类,该类将读取给定的目录,并针对其中包含的每个文件,针对我的工具运行它并生成结果。
因此,在 Eclipse 中编码时,每次测试都会显示一个结果(如预期)。今天我一直在玩弄 Intellij,我决定尝试在 Intellij 中运行这个项目并编写一些代码。
然而,当尝试运行测试时,它似乎只显示 2 个结果,而不是应有的 100 多个结果。尽管我确信它正在运行完整的套件,但它似乎将给定类别的所有结果折叠在一个结果中。这意味着,如果我在每个类别中至少有一个失败的测试,它将显示为“失败的测试”。
我想这一定不是一个错误,而是一些我不知道的配置,并且默认情况下在 Intellij 中启用但在 Eclipse 中不启用。谁能解释一下可能发生了什么?
编辑:我正在使用最新的 Intellij (这几天下载的)。
谢谢
I have been developing a project which contains a TestLauncher
class that'll read a given directory and for each file it contains, run it against my tool and yield the results.
So, when coding in Eclipse, it would show up one result for each test (as expected). Today I've been toying with Intellij, and I've decided to try to run and code a bit of this project in Intellij.
When trying to run the tests, though, it seems to be only showing up 2 results instead of the 100+ it should. Although I am sure it is running the full suite, it seems to be folding all the results of a given category in a single result. That means that if I have at least one failing test in each category, it shows up as a "failed test".
I guess this must not be a bug, but rather some configuration that I am not aware about and that is on by default in Intellij but not in Eclipse. Could anyone explain what might be going on?
Edit: I am using the latest Intellij (downloaded one of these days).
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您所看到的只是 Eclipse 和 IDEA 插件实现方式上的差异。我实现的 Eclipse 插件在显示方面非常巧妙,因此它会根据各种因素显示不同的内容,例如测试类中是否存在 toString() 方法或测试类是否实现 org.testng.ITest 。
我建议您在 IDEA 论坛上提出这个问题,如果没有得到任何回复,请随时向 testng 用户列表发送电子邮件,我可以让您与负责 TestNG 插件的 JetBrains 工程师联系。
What you're seeing is simply a difference in the way the Eclipse and IDEA plug-ins are implemented. I implemented the Eclipse plug-in to be pretty clever in its display, so it will show different things depending on various factors such as the presence of a toString() method in your test class or whether your test class implements org.testng.ITest.
I suggest you ask this question on the IDEA forums and if you don't get any response, feel free to email the testng-users list and I can put you in touch with the JetBrains engineer in charge of the TestNG plug-in.
IntelliJ-IDEA TestNG 插件在输出测试结果上方有一个名为“隐藏通过”的过滤器符号。您可以切换它以显示所有测试,包括通过的测试。
The IntelliJ-IDEA TestNG Plugin has a filter symbol called "Hide Passed" above the output Test Results. You can toggle that to display all tests, including the passed ones.