java.lang.Exception: No runnable methods
程序员文章站
2022-06-20 10:53:57
...
java.lang.Exception: No runnable methods
at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:191)
at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:128)
at org.junit.runners.ParentRunner.validate(ParentRunner.java:416)
at org.junit.runners.ParentRunner.<init>(ParentRunner.java:84)
at org.junit.runners.BlockJUnit4ClassRunner.<init>(BlockJUnit4ClassRunner.java:65)
at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:10)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
at org.junit.internal.requests.FilterRequest.getRunner(FilterRequest.java:36)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:49)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)
发现问题
在进行FastDFS测试的时候出现No runnable methods
问题原因:
springboot的Test类和main类包结构不同
解决办法:
改为相同的包结构
改完包结构记得rebuild项目,不然可能会继续包那个错误
上一篇: 监听DOM元素
下一篇: XML DOM解析简单示例
推荐阅读
-
JAVA多线程Thread和Runnable的实现
-
那些年我们错过的魔术方法(Magic Methods)
-
如何关闭http Methods中的Trace 提高安全意识
-
Android开发笔记之:Handler Runnable与Thread的区别详解
-
深入浅析Vue.js中 computed和methods不同机制
-
对vue中methods互相调用的方法详解
-
在Vue methods中调用filters里的过滤器实例
-
Vue中的methods、watch、computed的区别
-
Vue学习之监听methods、watch及computed比较小结(十一)
-
Vue中computed与methods的区别详解