org.powermock.tests.utils.impl
Class AbstractTestClassExtractor

java.lang.Object
  extended by org.powermock.tests.utils.impl.AbstractTestClassExtractor
All Implemented Interfaces:
TestClassesExtractor
Direct Known Subclasses:
PrepareForTestExtractorImpl, StaticConstructorSuppressExtractorImpl

public abstract class AbstractTestClassExtractor
extends Object
implements TestClassesExtractor

Base class for all test class extractors.


Constructor Summary
AbstractTestClassExtractor()
           
 
Method Summary
protected abstract  String[] getClassesToModify(AnnotatedElement element)
          Get the fully qualified names for classes that must should be modified for this element.
 String[] getTestClasses(AnnotatedElement element)
          If element is a class this method traverses the hierarchy and extracts classes that should be prepared for test in all super classes.
 boolean isPrepared(AnnotatedElement element, String fullyQualifiedClassName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTestClassExtractor

public AbstractTestClassExtractor()
Method Detail

getTestClasses

public final String[] getTestClasses(AnnotatedElement element)
If element is a class this method traverses the hierarchy and extracts classes that should be prepared for test in all super classes.

Specified by:
getTestClasses in interface TestClassesExtractor
Returns:
Returns null if 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.

getClassesToModify

protected abstract String[] getClassesToModify(AnnotatedElement element)
Get the fully qualified names for classes that must should be modified for this element.

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

public boolean isPrepared(AnnotatedElement element,
                          String fullyQualifiedClassName)
Specified by:
isPrepared in interface TestClassesExtractor


Copyright © 2007-2014. All Rights Reserved.