(no commit message)
[utils] / trunk / support / test / org / wamblee / xml / XmlUtils.java
index 93d2e917c6d8af8cfa3457c5ed318a83adc9104c..7d0fb123c1c50a4f79dd252a4de7efd53a102cc6 100644 (file)
@@ -43,7 +43,8 @@ public final class XmlUtils {
 
     /**
      * Checks equality of two XML documents excluding comment and processing
-     * nodes and trimming the text of the elements.
+     * nodes and trimming the text of the elements. In case of problems, it
+     * provides an xpath-like expression describing where the problem is.  
      * 
      * @param aMsg
      * @param aExpected
@@ -57,7 +58,8 @@ public final class XmlUtils {
 
     /**
      * Checks equality of two XML documents excluding comment and processing
-     * nodes and trimming the text of the elements.
+     * nodes and trimming the text of the elements.  In case of problems, it
+     * provides an xpath-like expression describing where the problem is.  
      * 
      * @param aMsg
      * @param aExpected
@@ -65,12 +67,13 @@ public final class XmlUtils {
      */
     public static void assertEquals(String aMsg, Document aExpected,
             Document aActual) {
-        assertEquals(aMsg, aExpected.getRootElement(), aActual.getRootElement());
+        assertEquals(aMsg + "/" + aExpected.getRootElement().getName(), aExpected.getRootElement(), aActual.getRootElement());
     }
 
     /**
      * Checks equality of two XML elements excluding comment and processing
-     * nodes and trimming the text of the elements.
+     * nodes and trimming the text of the elements. In case of problems, it
+     * provides an xpath-like expression describing where the problem is.  
      * 
      * @param aMsg
      * @param aExpected
@@ -125,7 +128,8 @@ public final class XmlUtils {
     }
 
     /**
-     * Checks equality of two attributes.
+     * Checks equality of two attributes. In case of problems, it
+     * provides an xpath-like expression describing where the problem is.  
      * 
      * @param aMsg
      * @param aExpected