TypeNotPresentExceptionProxy
从 Surefire 2.6 升级到 Surefire 2.13 时,我在运行单元测试时会得到一个。TypeNotPresentExceptionProxy
java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:653)
at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:460)
at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:286)
at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:222)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
at java.lang.Class.initAnnotationsIfNecessary(Class.java:3070)
at java.lang.Class.getAnnotation(Class.java:3029)
at org.apache.maven.surefire.common.junit4.JUnit4TestChecker.isValidJUnit4Test(JUnit4TestChecker.java:64)
在 中,第 64 行如下所示:JUnit4TestChecker
Annotation runWithAnnotation = testClass.getAnnotation( runWith );
因此,Surefire会检查注释以确保其类型有效。我们的测试使用Spring,所以在我们的测试类中看起来像这样:@RunWith
@RunWith
@RunWith(SpringJUnit4ClassRunner.class)
Surefire似乎没有找到这个类。我不知道为什么在Surefire 2.6下,测试运行良好。SpringJUnit4ClassRunner
有什么想法吗?