BATCH-2186: Backporting XSD validation to 2.2.x

This commit is contained in:
Michael Minella
2014-03-10 15:46:30 -05:00
parent c199f27103
commit c066bc616e
2 changed files with 4 additions and 3 deletions

View File

@@ -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;
}

View File

@@ -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());