Consistently log Class.getName() instead of Class.toString(), avoiding double class term in log message
Issue: SPR-11804
(cherry picked from commit 1120680)
This commit is contained in:
@@ -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<? extends TestExecutionListener>[] 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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user