aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-testing-harness/src
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2014-02-11 13:44:28 +0100
committerSimon Brandhof <simon.brandhof@gmail.com>2014-02-11 13:44:28 +0100
commiteca79dcbc7e8b90e55696522da0a4a0c7eae0f4b (patch)
tree8a01edabab189dd2282c8e6c759ee6dcb68d64e1 /sonar-testing-harness/src
parent16a0662c31450ab84c98dfed46299a0e73c9ed56 (diff)
downloadsonarqube-eca79dcbc7e8b90e55696522da0a4a0c7eae0f4b.tar.gz
sonarqube-eca79dcbc7e8b90e55696522da0a4a0c7eae0f4b.zip
Change signature of TestUtils#isSimilarXml()
Diffstat (limited to 'sonar-testing-harness/src')
-rw-r--r--sonar-testing-harness/src/main/java/org/sonar/test/TestUtils.java11
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);
+ }
}
}