Class AbstractEasyMockLogPolicyBase
- java.lang.Object
-
- org.powermock.api.easymock.mockpolicies.AbstractEasyMockLogPolicyBase
-
- All Implemented Interfaces:
PowerMockPolicy
- Direct Known Subclasses:
JclMockPolicy
,Log4jMockPolicy
,Slf4jMockPolicy
abstract class AbstractEasyMockLogPolicyBase extends java.lang.Object implements PowerMockPolicy
A base class for EasyMock log policies.
-
-
Constructor Summary
Constructors Constructor Description AbstractEasyMockLogPolicyBase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
applyClassLoadingPolicy(MockPolicyClassLoadingSettings settings)
Apply all class-loading related policies that must be present before the interception policies can take place.void
applyInterceptionPolicy(MockPolicyInterceptionSettings settings)
Apply the interception policies, for example which methods that should be suppressed or which methods that should be intercepted and return some else than their original value.protected abstract java.lang.String[]
getFullyQualifiedNamesOfClassesToLoadByMockClassloader()
protected abstract java.lang.String
getLogFrameworkName()
protected abstract java.lang.String
getLoggerClassToMock()
protected abstract java.lang.String
getLoggerFactoryClassName()
protected abstract java.lang.String
getLoggerMethodName()
-
-
-
Method Detail
-
applyClassLoadingPolicy
public void applyClassLoadingPolicy(MockPolicyClassLoadingSettings settings)
Apply all class-loading related policies that must be present before the interception policies can take place.- Specified by:
applyClassLoadingPolicy
in interfacePowerMockPolicy
- Parameters:
settings
- The settings objects where the class-loading policies can be applied.
-
applyInterceptionPolicy
public void applyInterceptionPolicy(MockPolicyInterceptionSettings settings)
Apply the interception policies, for example which methods that should be suppressed or which methods that should be intercepted and return some else than their original value.- Specified by:
applyInterceptionPolicy
in interfacePowerMockPolicy
- Parameters:
settings
- The settings objects where the interception policies can be applied.
-
getLoggerMethodName
protected abstract java.lang.String getLoggerMethodName()
- Returns:
- The name of the methods in the Logger Factory that should return a mock upon invocation.
-
getLoggerFactoryClassName
protected abstract java.lang.String getLoggerFactoryClassName()
- Returns:
- The fully-qualified class name of the Logger Factory that contains the methods that should return a mock upon invocation.
-
getLoggerClassToMock
protected abstract java.lang.String getLoggerClassToMock()
- Returns:
- The fully-qualified class name of the class that should be mocked. The mock instance of this class will then be returned each time a specified method in the Logger Factory is invoked.
-
getLogFrameworkName
protected abstract java.lang.String getLogFrameworkName()
- Returns:
- The name of the log framework. Used in error messages, for
example if the
getLoggerFactoryClassName()
cannot be found in the classpath.
-
getFullyQualifiedNamesOfClassesToLoadByMockClassloader
protected abstract java.lang.String[] getFullyQualifiedNamesOfClassesToLoadByMockClassloader()
- Returns:
- The fully-qualified names of the classes that should be loaded by the mock classloader.
-
-