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 43810da35a6..5f3d186f17e 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 @@ -187,7 +187,7 @@ public class TestContextManager { // Use defaults? if (descriptor == 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()); } @@ -198,7 +198,7 @@ public class TestContextManager { AnnotationAttributes annAttrs = descriptor.getAnnotationAttributes(); if (logger.isTraceEnabled()) { logger.trace(String.format("Retrieved @TestExecutionListeners attributes [%s] for declaring class [%s].", - annAttrs, declaringClass)); + annAttrs, declaringClass.getName())); } Class[] valueListenerClasses = @@ -208,7 +208,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)) { @@ -289,7 +289,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); @@ -403,8 +403,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); @@ -446,7 +446,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);