From 21f3f59cb71fb94443415ca8be1e215c8290a86a Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Wed, 20 Jul 2011 20:38:02 +0000 Subject: [PATCH] [SPR-8387] Log messages now refer to default detection instead of default generation. --- .../test/context/support/AbstractContextLoader.java | 2 +- .../context/support/AnnotationConfigContextLoader.java | 2 +- .../context/support/DelegatingSmartContextLoader.java | 10 ++++------ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/org.springframework.test/src/main/java/org/springframework/test/context/support/AbstractContextLoader.java b/org.springframework.test/src/main/java/org/springframework/test/context/support/AbstractContextLoader.java index 9b72b54f13..e1d4433000 100644 --- a/org.springframework.test/src/main/java/org/springframework/test/context/support/AbstractContextLoader.java +++ b/org.springframework.test/src/main/java/org/springframework/test/context/support/AbstractContextLoader.java @@ -152,7 +152,7 @@ public abstract class AbstractContextLoader implements SmartContextLoader { if (!new ClassPathResource(resourcePath, clazz).exists()) { if (logger.isInfoEnabled()) { - logger.info(String.format("Cannot generate default resource locations for test class [%s]: " + logger.info(String.format("Could not detect default resource locations for test class [%s]: " + "classpath resource [%s] does not exist.", clazz.getName(), resourcePath)); } return EMPTY_STRING_ARRAY; diff --git a/org.springframework.test/src/main/java/org/springframework/test/context/support/AnnotationConfigContextLoader.java b/org.springframework.test/src/main/java/org/springframework/test/context/support/AnnotationConfigContextLoader.java index 437750bf4e..167c0012d6 100644 --- a/org.springframework.test/src/main/java/org/springframework/test/context/support/AnnotationConfigContextLoader.java +++ b/org.springframework.test/src/main/java/org/springframework/test/context/support/AnnotationConfigContextLoader.java @@ -154,7 +154,7 @@ public class AnnotationConfigContextLoader extends AbstractGenericContextLoader if (configClasses.isEmpty()) { if (logger.isInfoEnabled()) { - logger.info(String.format("Cannot generate default configuration classes for test class [%s]: " + logger.info(String.format("Could not detect default configuration classes for test class [%s]: " + "%s does not declare any static, non-private, non-final, inner classes " + "annotated with @Configuration.", declaringClass.getName(), declaringClass.getSimpleName())); } diff --git a/org.springframework.test/src/main/java/org/springframework/test/context/support/DelegatingSmartContextLoader.java b/org.springframework.test/src/main/java/org/springframework/test/context/support/DelegatingSmartContextLoader.java index 77cce001cd..c446eb9fdb 100644 --- a/org.springframework.test/src/main/java/org/springframework/test/context/support/DelegatingSmartContextLoader.java +++ b/org.springframework.test/src/main/java/org/springframework/test/context/support/DelegatingSmartContextLoader.java @@ -87,7 +87,7 @@ public class DelegatingSmartContextLoader implements SmartContextLoader { if (!defaultResourcesAlreadyGenerated && loader.generatesDefaults()) { if (logger.isDebugEnabled()) { logger.debug(String.format( - "Delegating to %s to generate defaults for context configuration [%s].", + "Delegating to %s to detect defaults for context configuration [%s].", loader.getClass().getName(), configAttributes)); } @@ -96,7 +96,7 @@ public class DelegatingSmartContextLoader implements SmartContextLoader { if (configAttributes.hasResources()) { if (logger.isInfoEnabled()) { logger.info(String.format("SmartContextLoader candidate %s " - + "generated defaults for context configuration [%s].", loader, configAttributes)); + + "detected defaults for context configuration [%s].", loader, configAttributes)); } } } @@ -105,10 +105,8 @@ public class DelegatingSmartContextLoader implements SmartContextLoader { // If any loader claims to generate defaults but none actually did, // throw an exception. if (!configAttributes.hasResources()) { - throw new IllegalStateException( - String.format("None of the SmartContextLoader candidates %s " - + "was able to generate defaults for context configuration [%s].", candidates, - configAttributes)); + throw new IllegalStateException(String.format("None of the SmartContextLoader candidates %s " + + "was able to detect defaults for context configuration [%s].", candidates, configAttributes)); } } }