Package org.powermock.tests.utils
Interface MockPolicyInitializer
-
- All Known Implementing Classes:
MockPolicyInitializerImpl
public interface MockPolicyInitializerA Mock Policy initializer takes care of initializing the behavior defined by the mock policies.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidinitialize(java.lang.ClassLoader classLoader)Initializes the mock policies for a given class loader.booleanisPrepared(java.lang.String fullyQualifiedClassName)booleanneedsInitialization()voidrefreshPolicies(java.lang.ClassLoader classLoader)Re executes theMockPolicyof all the policies for a given class loader.
-
-
-
Method Detail
-
initialize
void initialize(java.lang.ClassLoader classLoader)
Initializes the mock policies for a given class loader. Note that this method must not be called from the class loader (classLoader) that you pass in to this method.Note that if the class-loader is not an instance of
MockClassLoaderthis method will return silently.
-
needsInitialization
boolean needsInitialization()
-
isPrepared
boolean isPrepared(java.lang.String fullyQualifiedClassName)
- Returns:
trueif the class with the fully-qualified name offullyQualifiedClassNamewas prepared for testing by this mock policy initializer.
-
refreshPolicies
void refreshPolicies(java.lang.ClassLoader classLoader)
Re executes theMockPolicyof all the policies for a given class loader. This method must be called after a call toinitialize(ClassLoader)on the same class loader.Note that if the class-loader is not an instance of
MockClassLoaderthis method will return silently.
-
-