]> source.dussan.org Git - sonarqube.git/commitdiff
Change signature of TestUtils#isSimilarXml()
authorSimon Brandhof <simon.brandhof@gmail.com>
Tue, 11 Feb 2014 12:44:28 +0000 (13:44 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Tue, 11 Feb 2014 12:44:28 +0000 (13:44 +0100)
sonar-testing-harness/src/main/java/org/sonar/test/TestUtils.java

index 525583533acf28044682e65bae9bbeba470ad10f..37b791eada712fd7adb0fa582f91f259d6b9e8b5 100644 (file)
@@ -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);
+    }
   }
 }