diff --git a/spring-test/src/main/java/org/springframework/test/context/TestContextManager.java b/spring-test/src/main/java/org/springframework/test/context/TestContextManager.java index 104139e1c2..4cf8b13f2f 100644 --- a/spring-test/src/main/java/org/springframework/test/context/TestContextManager.java +++ b/spring-test/src/main/java/org/springframework/test/context/TestContextManager.java @@ -183,7 +183,7 @@ public class TestContextManager { // Use defaults? if (declaringClass == null) { if (logger.isDebugEnabled()) { - logger.debug("@TestExecutionListeners is not present for class [" + clazz + "]: using defaults."); + logger.debug("@TestExecutionListeners is not present for class [" + clazz.getName() + "]: using defaults."); } classesList.addAll(getDefaultTestExecutionListenerClasses()); } @@ -193,7 +193,7 @@ public class TestContextManager { TestExecutionListeners testExecutionListeners = declaringClass.getAnnotation(annotationType); if (logger.isTraceEnabled()) { logger.trace("Retrieved @TestExecutionListeners [" + testExecutionListeners + - "] for declaring class [" + declaringClass + "]."); + "] for declaring class [" + declaringClass.getName() + "]."); } Class[] valueListenerClasses = testExecutionListeners.value(); @@ -201,7 +201,7 @@ public class TestContextManager { if (!ObjectUtils.isEmpty(valueListenerClasses) && !ObjectUtils.isEmpty(listenerClasses)) { throw new IllegalStateException(String.format("Class [%s] configured with @TestExecutionListeners' " + "'value' [%s] and 'listeners' [%s] attributes. Use one or the other, but not both.", - declaringClass, ObjectUtils.nullSafeToString(valueListenerClasses), + declaringClass.getName(), ObjectUtils.nullSafeToString(valueListenerClasses), ObjectUtils.nullSafeToString(listenerClasses))); } else if (!ObjectUtils.isEmpty(valueListenerClasses)) { @@ -279,7 +279,7 @@ public class TestContextManager { public void beforeTestClass() throws Exception { Class testClass = getTestContext().getTestClass(); if (logger.isTraceEnabled()) { - logger.trace("beforeTestClass(): class [" + testClass + "]"); + logger.trace("beforeTestClass(): class [" + testClass.getName() + "]"); } getTestContext().updateState(null, null, null); @@ -393,8 +393,8 @@ public class TestContextManager { public void afterTestMethod(Object testInstance, Method testMethod, Throwable exception) throws Exception { Assert.notNull(testInstance, "testInstance must not be null"); if (logger.isTraceEnabled()) { - logger.trace("afterTestMethod(): instance [" + testInstance + "], method [" + testMethod + "], exception [" - + exception + "]"); + logger.trace("afterTestMethod(): instance [" + testInstance + "], method [" + testMethod + + "], exception [" + exception + "]"); } getTestContext().updateState(testInstance, testMethod, exception); @@ -436,7 +436,7 @@ public class TestContextManager { public void afterTestClass() throws Exception { Class testClass = getTestContext().getTestClass(); if (logger.isTraceEnabled()) { - logger.trace("afterTestClass(): class [" + testClass + "]"); + logger.trace("afterTestClass(): class [" + testClass.getName() + "]"); } getTestContext().updateState(null, null, null);