Fix XML test
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/2c0b7db4 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/2c0b7db4 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/2c0b7db4 Branch: refs/heads/feature/LOG4J2-1430 Commit: 2c0b7db454a6a991f68e161b99acd698d29be010 Parents: eb82f77 Author: Mikael Ståldal <mikael.stal...@magine.com> Authored: Tue Aug 30 14:57:50 2016 +0200 Committer: Mikael Ståldal <mikael.stal...@magine.com> Committed: Tue Aug 30 14:57:50 2016 +0200 ---------------------------------------------------------------------- log4j-core/pom.xml | 10 ++++++++++ .../core/config/builder/ConfigurationBuilderTest.java | 5 +++-- pom.xml | 12 ++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/2c0b7db4/log4j-core/pom.xml ---------------------------------------------------------------------- diff --git a/log4j-core/pom.xml b/log4j-core/pom.xml index 87a66c2..4d6f231 100644 --- a/log4j-core/pom.xml +++ b/log4j-core/pom.xml @@ -262,6 +262,16 @@ <scope>test</scope> </dependency> <dependency> + <groupId>org.xmlunit</groupId> + <artifactId>xmlunit-core</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.xmlunit</groupId> + <artifactId>xmlunit-matchers</artifactId> + <scope>test</scope> + </dependency> + <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <scope>test</scope> http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/2c0b7db4/log4j-core/src/test/java/org/apache/logging/log4j/core/config/builder/ConfigurationBuilderTest.java ---------------------------------------------------------------------- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/builder/ConfigurationBuilderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/builder/ConfigurationBuilderTest.java index 87ecd26..4083f52 100644 --- a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/builder/ConfigurationBuilderTest.java +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/builder/ConfigurationBuilderTest.java @@ -24,8 +24,9 @@ import org.apache.logging.log4j.core.config.builder.api.ConfigurationBuilder; import org.apache.logging.log4j.core.config.builder.api.ConfigurationBuilderFactory; import org.apache.logging.log4j.core.config.builder.impl.BuiltConfiguration; import org.junit.Test; +import org.xmlunit.matchers.CompareMatcher; -import static org.junit.Assert.assertEquals; +import static org.junit.Assert.*; public class ConfigurationBuilderTest { @@ -84,7 +85,7 @@ public class ConfigurationBuilderTest { final ConfigurationBuilder<BuiltConfiguration> builder = ConfigurationBuilderFactory.newConfigurationBuilder(); addTestFixtures("config name", builder); final String xmlConfiguration = builder.toXmlConfiguration(); - assertEquals(expectedXml, xmlConfiguration); + assertThat(xmlConfiguration, CompareMatcher.isIdenticalTo(expectedXml)); } } http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/2c0b7db4/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 5fd30d3..99ce0b8 100644 --- a/pom.xml +++ b/pom.xml @@ -731,6 +731,18 @@ <scope>test</scope> </dependency> <dependency> + <groupId>org.xmlunit</groupId> + <artifactId>xmlunit-core</artifactId> + <version>2.2.1</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.xmlunit</groupId> + <artifactId>xmlunit-matchers</artifactId> + <version>2.2.1</version> + <scope>test</scope> + </dependency> + <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>2.5</version>