From 43d1b6eafb864759b6337f79c0d17659a462e4fe Mon Sep 17 00:00:00 2001 From: Michael Minella Date: Fri, 28 Feb 2014 13:36:43 -0600 Subject: [PATCH] BATCH-2045: Updated error message to identify that the XSD isn't compatable with the current version of Spring Batch --- .../batch/core/configuration/xml/JobParser.java | 5 +++-- .../core/configuration/xml/JobParserExceptionTests.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobParser.java index a89cdf3c0..4a7796330 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobParser.java @@ -69,8 +69,9 @@ public class JobParser extends AbstractSingleBeanDefinitionParser { if (!CoreNamespaceUtils.namespaceMatchesVersion(element)) { parserContext.getReaderContext().error( - "You cannot use spring-batch-2.0.xsd with Spring Batch 2.1. Please upgrade your schema declarations " - + "(or use the spring-batch.xsd alias if you are feeling lucky).", element); + "You are using a version of the spring-batch XSD that is not compatible with Spring Batch 3.0." + + " Please upgrade your schema declarations (or use the spring-batch.xsd alias if you are " + + "feeling lucky).", element); return; } diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/JobParserExceptionTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/JobParserExceptionTests.java index 76761778f..2b4a188b7 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/JobParserExceptionTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/JobParserExceptionTests.java @@ -58,7 +58,7 @@ public class JobParserExceptionTests { } catch (BeanDefinitionParsingException e) { String message = e.getMessage(); - assertTrue("Wrong message: "+message, message.matches("(?s).*You cannot use spring-batch-2.0.xsd.*")); + assertTrue("Wrong message: "+message, message.startsWith("Configuration problem: You are using a version of the spring-batch XSD")); } catch (BeanDefinitionStoreException e) { // Probably the internet is not available and the schema validation failed. fail("Wrong exception when schema didn't match: " + e.getMessage());