Class PrepareForTestExtractorImpl

java.lang.Object
org.powermock.tests.utils.impl.AbstractTestClassExtractor
org.powermock.tests.utils.impl.PrepareForTestExtractorImpl
All Implemented Interfaces:
TestClassesExtractor

public class PrepareForTestExtractorImpl extends AbstractTestClassExtractor
Implementation of the TestClassesExtractor interface that extract classes from the PrepareForTest or PrepareOnlyThisForTest annotations. It also adds the test case to the array of classes that should be modified.
  • Constructor Details

    • PrepareForTestExtractorImpl

      public PrepareForTestExtractorImpl()
    • PrepareForTestExtractorImpl

      public PrepareForTestExtractorImpl(boolean includeMethods)
  • Method Details

    • getClassesToModify

      protected String[] getClassesToModify(AnnotatedElement element)
      Get the fully qualified names for classes that must should be modified for this element.
      Specified by:
      getClassesToModify in class AbstractTestClassExtractor
      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.
    • addTestCase

      private void addTestCase(Set<String> all, AnnotatedElement element)
    • addFullyQualifiedNames

      private void addFullyQualifiedNames(Set<String> all, PrepareForTest annotation)
    • addFullyQualifiedNames

      private void addFullyQualifiedNames(Set<String> all, PrepareOnlyThisForTest annotation)
    • addFullyQualifiedNames

      private void addFullyQualifiedNames(Set<String> all, String[] fullyQualifiedNames)
    • addClassHierarchy

      private void addClassHierarchy(Set<String> all, Class<?> classToMock)
    • addInnerClassesAndInterfaces

      private void addInnerClassesAndInterfaces(Set<String> all, Class<?> classToMock)