Class AbstractTestClassExtractor
java.lang.Object
org.powermock.tests.utils.impl.AbstractTestClassExtractor
- All Implemented Interfaces:
TestClassesExtractor
- Direct Known Subclasses:
PrepareForTestExtractorImpl, StaticConstructorSuppressExtractorImpl
Base class for all test class extractors.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedAbstractTestClassExtractor(boolean includeMethods) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidextractClassesAndAddThemToList(AnnotatedElement elementToExtractClassFrom, Set<String> classesToPrepareForTest) private voidextractClassesFromTestClass(Class<?> element, Set<String> classesToPrepareForTest) protected abstract String[]getClassesToModify(AnnotatedElement element) Get the fully qualified names for classes that must should be modified for thiselement.final String[]getTestClasses(AnnotatedElement element) Ifelementis a class this method traverses the hierarchy and extracts classes that should be prepared for test in all super classes.booleanisPrepared(AnnotatedElement element, String fullyQualifiedClassName) private Collection<String> lookOverMethods(Class<?> classToInvestigate)
-
Field Details
-
includeMethods
protected final boolean includeMethods
-
-
Constructor Details
-
AbstractTestClassExtractor
protected AbstractTestClassExtractor() -
AbstractTestClassExtractor
protected AbstractTestClassExtractor(boolean includeMethods)
-
-
Method Details
-
getTestClasses
Ifelementis a class this method traverses the hierarchy and extracts classes that should be prepared for test in all super classes.- Specified by:
getTestClassesin interfaceTestClassesExtractor- Returns:
- Returns
nullif the element was not annotated, an empty String[] if it is annotated but contains no classes, or a string-array of all class names if interest.
-
extractClassesFromTestClass
-
lookOverMethods
-
extractClassesAndAddThemToList
private void extractClassesAndAddThemToList(AnnotatedElement elementToExtractClassFrom, Set<String> classesToPrepareForTest) -
getClassesToModify
Get the fully qualified names for classes that must should be modified for thiselement.- Parameters:
element- The element that may contain info regarding which classes that must be modified by PowerMock.- Returns:
- An array of fully-qualified names to classes that must be
modified by PowerMock for the specific
element.
-
isPrepared
- Specified by:
isPreparedin interfaceTestClassesExtractor
-