-
Notifications
You must be signed in to change notification settings - Fork 583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PowerMockIgnore fails to ignore super classes of the test class #1134
Comments
I'd hold one LuceneTestCase instance to avoid this problem. Any better ways to solve it? |
I got it! Let's talk about why I need to ignore those super classes. Here are serval internal annotations in LuceneTestCase, which were also added into classes to modify and attached with PowerMockModified. The extra PowerMockModified interface do lead to AnnotationFormatErrors thrown at sun.reflect.annotation.AnnotationInvocationHandler.(AnnotationInvocationHandler.java:53) . Maybe disable to mock annotations is the most valuable solution. |
Fix the bug above in the following way.
|
How about ignoring super classes with @PrepareOnlyThisForTest(testClass)? |
I'm developing a plugin for ElasticSearch. When I used @PowerMockIgnore to ignore the super test class org.apache.lucene.util.LuceneTestCase, it didn't work.
The LuceneTestCase was added into prepareForTestClasses at org.powermock.core.classloader.MockClassLoaderFactory#createForClass(line: 66), and then was added into classes to modify when constructing MockClassLoaderConfiguration.
It is PACKAGES_TO_BE_DEFERRED not deferPackages to determine whether ignored or not. I have no idea how to make it. Could you provide the way to ignore super test classes?
The text was updated successfully, but these errors were encountered: