mirror of https://github.com/qos-ch/slf4j
fix SubstitutableLoggerTest
Signed-off-by: Ceki Gulcu <ceki@qos.ch>
This commit is contained in:
parent
0877cb6410
commit
23c8cc0121
|
|
@ -75,7 +75,7 @@ public class SubstituteLogger implements Logger {
|
|||
|
||||
@Override
|
||||
public LoggingEventBuilder atLevel(Level level) {
|
||||
return makeLoggingEventBuilder(level);
|
||||
return delegate().atLevel(level);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -63,14 +63,14 @@ public class SubstitutableLoggerTest {
|
|||
assertTrue(substituteLogger.delegate() instanceof EventRecodingLogger);
|
||||
|
||||
Set<String> expectedMethodSignatures = determineMethodSignatures(Logger.class);
|
||||
LoggerInvocationHandler ih = new LoggerInvocationHandler();
|
||||
Logger proxyLogger = (Logger) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] { Logger.class }, ih);
|
||||
LoggerInvocationHandler loggerInvocationHandler = new LoggerInvocationHandler();
|
||||
Logger proxyLogger = (Logger) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] { Logger.class }, loggerInvocationHandler);
|
||||
substituteLogger.setDelegate(proxyLogger);
|
||||
|
||||
invokeAllMethodsOf(substituteLogger);
|
||||
|
||||
// Assert that all methods are delegated
|
||||
expectedMethodSignatures.removeAll(ih.getInvokedMethodSignatures());
|
||||
expectedMethodSignatures.removeAll(loggerInvocationHandler.getInvokedMethodSignatures());
|
||||
if (!expectedMethodSignatures.isEmpty()) {
|
||||
fail("Following methods are not delegated " + expectedMethodSignatures.toString());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue