java 未找到给定的测试包括:
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/49049446/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
No tests found for given includes:
提问by OGI
I'm trying to run a simple test that's in my Test class from IDE (Intellij IDEA) and error that pops out is:
我正在尝试从 IDE(Intellij IDEA)运行我的 Test 类中的一个简单测试,弹出的错误是:
No tests found for given includes: org.sample.Test.test
Same thing is happening when I try to run it from command-line. In Intellij, I've set up Build, Execution, Deployment > Build Tools > Gradle > Runner
to Gradle Test Runner
and I have @Test
on my method. Also, I can't run any test (from some other project), so I suppose that it's some configuration problem.
当我尝试从命令行运行它时,也会发生同样的事情。在的IntelliJ,我已经设置了Build, Execution, Deployment > Build Tools > Gradle > Runner
到Gradle Test Runner
,我有@Test
我的方法。另外,我无法运行任何测试(来自其他项目),所以我认为这是一些配置问题。
Can someone point me to something, what can I be doing wrong ?
有人可以指出我的一些事情,我做错了什么?
采纳答案by OGI
Ok, I've found an answer. On my Test class, I have @Category annotation. If I remove that one, my tests work, but I still don't know why. For example, on my colleague's IDE, same tests, but with @Category annotation work. It's a bit frustrating.
好的,我找到了答案。在我的 Test 课上,我有 @Category 注释。如果我删除那个,我的测试就可以了,但我仍然不知道为什么。例如,在我同事的 IDE 上,相同的测试,但使用 @Category 注释工作。这有点令人沮丧。
But, thanks for such a fast responses.
但是,感谢如此快速的回复。