|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.powermock.api.easymock.mockpolicies.Log4jMockPolicy
public class Log4jMockPolicy
A log4j mock policy. This mock policy deals with solving log4j related mocking issues. It takes care of loading all concerned log4j classes through the correct class-loader and automatically prepares and injects logger instances. This policy does the following:
| Constructor Summary | |
|---|---|
Log4jMockPolicy()
|
|
| Method Summary | |
|---|---|
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 String[] |
getFullyQualifiedNamesOfClassesToLoadByMockClassloader()
Loads all log4j classes with the mock classloader. |
protected String |
getLogFrameworkName()
|
protected String |
getLoggerClassToMock()
|
protected String |
getLoggerFactoryClassName()
|
protected String |
getLoggerMethodName()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Log4jMockPolicy()
| Method Detail |
|---|
protected String[] getFullyQualifiedNamesOfClassesToLoadByMockClassloader()
protected String getLogFrameworkName()
getLoggerFactoryClassName() cannot be
found in the classpath.protected String getLoggerClassToMock()
protected String getLoggerFactoryClassName()
protected String getLoggerMethodName()
public void applyClassLoadingPolicy(MockPolicyClassLoadingSettings settings)
applyClassLoadingPolicy in interface PowerMockPolicysettings - The settings objects where the class-loading policies can be
applied.public void applyInterceptionPolicy(MockPolicyInterceptionSettings settings)
applyInterceptionPolicy in interface PowerMockPolicysettings - The settings objects where the interception policies can be
applied.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||