为了账号安全,请及时绑定邮箱和手机立即绑定

在进行SeckillDao单元测试时,出现了java.lang.TypeNotPresentException: Type SpringJunit4ClassRunner not present错误。。。咋办啊各位大神~

java.lang.TypeNotPresentException: Type SpringJunit4ClassRunner not present

at sun.reflect.annotation.TypeNotPresentExceptionProxy.generateException(TypeNotPresentExceptionProxy.java:46)

at sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:84)

at com.sun.proxy.$Proxy2.value(Unknown Source)

at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)

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.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createUnfilteredTest(JUnit4TestLoader.java:90)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:76)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:49)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:525)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)

Caused by: java.lang.ClassNotFoundException: SpringJunit4ClassRunner

at java.net.URLClassLoader.findClass(URLClassLoader.java:382)

at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)

at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:348)

at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:114)

at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125)

at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)

at sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:439)

at sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:420)

at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:349)

at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:286)

at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120)

at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72)

at java.lang.Class.createAnnotationData(Class.java:3521)

at java.lang.Class.annotationData(Class.java:3510)

at java.lang.Class.getAnnotation(Class.java:3415)

at org.junit.internal.builders.IgnoredBuilder.runnerForClass(IgnoredBuilder.java:10)

... 11 more


https://img1.sycdn.imooc.com//5d47f6010001446b08560266.jpg

正在回答

1 回答

spring-test 是测试环境下依赖的,不懂就百度

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

在进行SeckillDao单元测试时,出现了java.lang.TypeNotPresentException: Type SpringJunit4ClassRunner not present错误。。。咋办啊各位大神~

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信