diff options
Diffstat (limited to 'sonar-testing-harness')
-rw-r--r-- | sonar-testing-harness/src/main/java/org/sonar/test/TestUtils.java | 11 |
1 files changed, 8 insertions, 3 deletions
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); + } } } |