From 78280dc391f27e3ec41e8902f51a7d32a944a362 Mon Sep 17 00:00:00 2001 From: Chetan Mehrotra Date: Mon, 3 Feb 2014 21:53:55 +0530 Subject: [PATCH] Minor changes around method names --- .../slf4j/helpers/SubstitutableLoggerTest.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/slf4j-api/src/test/java/org/slf4j/helpers/SubstitutableLoggerTest.java b/slf4j-api/src/test/java/org/slf4j/helpers/SubstitutableLoggerTest.java index f3f55246f..67d354702 100644 --- a/slf4j-api/src/test/java/org/slf4j/helpers/SubstitutableLoggerTest.java +++ b/slf4j-api/src/test/java/org/slf4j/helpers/SubstitutableLoggerTest.java @@ -47,7 +47,7 @@ public void testDelegate() throws Exception { SubstitutableLogger log = new SubstitutableLogger("foo"); assertTrue(log.delegate() instanceof NOPLogger); - Set methodSignatures = determinemethodSignatures(Logger.class); + Set expectedMethodSignatures = determineMethodSignatures(Logger.class); LoggerInvocationHandler ih = new LoggerInvocationHandler(); Logger proxyLogger = (Logger) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{Logger.class}, ih); @@ -56,9 +56,9 @@ public void testDelegate() throws Exception { invokeMethods(log); //Assert that all methods are delegated - methodSignatures.removeAll(ih.getMethodSignatures()); - if (!methodSignatures.isEmpty()) { - fail("Following methods are not delegated " + methodSignatures.toString()); + expectedMethodSignatures.removeAll(ih.getInvokedMethodSignatures()); + if (!expectedMethodSignatures.isEmpty()) { + fail("Following methods are not delegated " + expectedMethodSignatures.toString()); } } @@ -71,22 +71,22 @@ private void invokeMethods(Logger proxyLogger) throws InvocationTargetException, } private class LoggerInvocationHandler implements InvocationHandler { - private final Set methodSignatures = new HashSet(); + private final Set invokedMethodSignatures = new HashSet(); public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - methodSignatures.add(getMethodSignature(method)); + invokedMethodSignatures.add(getMethodSignature(method)); if (method.getName().startsWith("is")) { return true; } return null; } - public Set getMethodSignatures() { - return methodSignatures; + public Set getInvokedMethodSignatures() { + return invokedMethodSignatures; } } - private static Set determinemethodSignatures(Class loggerClass) { + private static Set determineMethodSignatures(Class loggerClass) { Set methodSignatures = new HashSet(); for (Method m : loggerClass.getDeclaredMethods()) { if (!EXCLUDED_METHODS.contains(m.getName())) {