Browse Source

[SPR-8387] Log messages now refer to default detection instead of default generation.

pull/7/head
Sam Brannen 14 years ago
parent
commit
21f3f59cb7
  1. 2
      org.springframework.test/src/main/java/org/springframework/test/context/support/AbstractContextLoader.java
  2. 2
      org.springframework.test/src/main/java/org/springframework/test/context/support/AnnotationConfigContextLoader.java
  3. 10
      org.springframework.test/src/main/java/org/springframework/test/context/support/DelegatingSmartContextLoader.java

2
org.springframework.test/src/main/java/org/springframework/test/context/support/AbstractContextLoader.java

@ -152,7 +152,7 @@ public abstract class AbstractContextLoader implements SmartContextLoader { @@ -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;

2
org.springframework.test/src/main/java/org/springframework/test/context/support/AnnotationConfigContextLoader.java

@ -154,7 +154,7 @@ public class AnnotationConfigContextLoader extends AbstractGenericContextLoader @@ -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()));
}

10
org.springframework.test/src/main/java/org/springframework/test/context/support/DelegatingSmartContextLoader.java

@ -87,7 +87,7 @@ public class DelegatingSmartContextLoader implements SmartContextLoader { @@ -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 { @@ -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 { @@ -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));
}
}
}

Loading…
Cancel
Save