From: Simon Brandhof Date: Tue, 11 Feb 2014 12:44:28 +0000 (+0100) Subject: Change signature of TestUtils#isSimilarXml() X-Git-Tag: 4.2~154 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=eca79dcbc7e8b90e55696522da0a4a0c7eae0f4b;p=sonarqube.git Change signature of TestUtils#isSimilarXml() --- diff --git a/sonar-testing-harness/src/main/java/org/sonar/test/TestUtils.java b/sonar-testing-harness/src/main/java/org/sonar/test/TestUtils.java index 525583533ac..37b791eada7 100644 --- a/sonar-testing-harness/src/main/java/org/sonar/test/TestUtils.java +++ b/sonar-testing-harness/src/main/java/org/sonar/test/TestUtils.java @@ -19,6 +19,7 @@ */ package org.sonar.test; +import com.google.common.base.Throwables; import org.apache.commons.io.Charsets; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; @@ -121,14 +122,18 @@ public final class TestUtils { return dir; } - public static void assertSimilarXml(String expectedXml, String xml) throws Exception { + public static void assertSimilarXml(String expectedXml, String xml) { Diff diff = isSimilarXml(expectedXml, xml); String message = "Diff: " + diff.toString() + CharUtils.LF + "XML: " + xml; assertTrue(message, diff.similar()); } - static Diff isSimilarXml(String expectedXml, String xml) throws Exception { + static Diff isSimilarXml(String expectedXml, String xml) { XMLUnit.setIgnoreWhitespace(true); - return XMLUnit.compareXML(xml, expectedXml); + try { + return XMLUnit.compareXML(xml, expectedXml); + } catch (Exception e) { + throw Throwables.propagate(e); + } } }