From 9d266e8976c21263b999ba281a7894b98360d2d8 Mon Sep 17 00:00:00 2001 From: Mahmoud Ben Hassine Date: Wed, 30 Jan 2019 10:55:47 +0100 Subject: [PATCH] Fix integration tests (cherry picked from commit 422c233e3c46728c58b0f15350b7230d86e96235) --- build.gradle | 2 -- .../src/test/resources/expectedOutput.ldif | 4 ++-- .../item/xml/AbstractStaxEventWriterItemWriterTests.java | 7 +++++-- .../batch/item/xml/Jaxb2NamespaceMarshallingTests.java | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 96d3e7211..04db92e81 100644 --- a/build.gradle +++ b/build.gradle @@ -91,7 +91,6 @@ allprojects { sqlfireclientVersion = '1.0.3' sqliteVersion = '3.21.0.1' woodstoxVersion = '5.0.3' - xercesVersion = '2.11.0' //? xmlunitVersion = '2.5.1' xstreamVersion = '1.4.11.1' jrubyVersion = '1.7.26' @@ -448,7 +447,6 @@ project('spring-batch-infrastructure-tests') { } testCompile "org.apache.logging.log4j:log4j-api:$log4jVersion" testCompile "org.apache.logging.log4j:log4j-core:$log4jVersion" - testCompile "xerces:xercesImpl:$xercesVersion" testCompile "com.thoughtworks.xstream:xstream:$xstreamVersion" testCompile("com.fasterxml.woodstox:woodstox-core:$woodstoxVersion") { exclude group: 'stax', module: 'stax-api' diff --git a/spring-batch-core-tests/src/test/resources/expectedOutput.ldif b/spring-batch-core-tests/src/test/resources/expectedOutput.ldif index 82ac4e039..027fc24d0 100644 --- a/spring-batch-core-tests/src/test/resources/expectedOutput.ldif +++ b/spring-batch-core-tests/src/test/resources/expectedOutput.ldif @@ -23,8 +23,8 @@ dn: cn=Gern Jensen,ou=Product Testing,dc=airius,dc=com telephonenumber: +1 408 555 1212 uid: gernj description:: V2hhdCBhIGNhcmVmdWwgcmVhZGVyIHlvdSBhcmUhICBUaGlzIHZhbHVlIGlzIGJhc2UtNjQtZW5j -b2RlZCBiZWNhdXNlIGl0IGhhcyBhIGNvbnRyb2wgY2hhcmFjdGVyIGluIGl0IChhIENSKS4NICBC -eSB0aGUgd2F5LCB5b3Ugc2hvdWxkIHJlYWxseSBnZXQgb3V0IG1vcmUu + b2RlZCBiZWNhdXNlIGl0IGhhcyBhIGNvbnRyb2wgY2hhcmFjdGVyIGluIGl0IChhIENSKS4NICBC + eSB0aGUgd2F5LCB5b3Ugc2hvdWxkIHJlYWxseSBnZXQgb3V0IG1vcmUu objectclass: top objectclass: person objectclass: organizationalPerson diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/AbstractStaxEventWriterItemWriterTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/AbstractStaxEventWriterItemWriterTests.java index 4013ba44a..b1f02e73a 100644 --- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/AbstractStaxEventWriterItemWriterTests.java +++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/AbstractStaxEventWriterItemWriterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2017 the original author or authors. + * Copyright 2010-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,8 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; import org.xmlunit.builder.Input; +import org.xmlunit.diff.DefaultNodeMatcher; +import org.xmlunit.diff.ElementSelectors; import org.xmlunit.matchers.CompareMatcher; import org.springframework.batch.item.ExecutionContext; @@ -97,7 +99,8 @@ public abstract class AbstractStaxEventWriterItemWriterTests { assertThat( Input.from(expected.getFile()), - CompareMatcher.isSimilarTo(Input.from(resource.getFile()))); + CompareMatcher.isSimilarTo(Input.from(resource.getFile())) + .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText))); } @Before diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/Jaxb2NamespaceMarshallingTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/Jaxb2NamespaceMarshallingTests.java index 271866e47..e2addf96c 100644 --- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/Jaxb2NamespaceMarshallingTests.java +++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/Jaxb2NamespaceMarshallingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2014 the original author or authors. + * Copyright 2010-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -101,7 +101,7 @@ public class Jaxb2NamespaceMarshallingTests { assertThat( Input.from(expected.getFile()), - CompareMatcher.isSimilarTo(Input.from(resource.getFile()))); + CompareMatcher.isSimilarTo(Input.from(resource.getFile())).normalizeWhitespace()); } @Before