X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=support%2Ftest%2Forg%2Fwamblee%2Fxml%2FXmlUtils.java;h=93d2e917c6d8af8cfa3457c5ed318a83adc9104c;hb=f43059a4d31beef5d07adecdb98de417ff05431f;hp=12292469e06178012a5010af4d636294135eaa23;hpb=f3f910cc373067d03c8f221b5e2deec65378bb75;p=utils diff --git a/support/test/org/wamblee/xml/XmlUtils.java b/support/test/org/wamblee/xml/XmlUtils.java index 12292469..93d2e917 100644 --- a/support/test/org/wamblee/xml/XmlUtils.java +++ b/support/test/org/wamblee/xml/XmlUtils.java @@ -93,7 +93,7 @@ public final class XmlUtils { List actualAttrs = aActual.attributes(); Collections.sort(actualAttrs, new AttributeComparator()); - TestCase.assertEquals(aMsg + "/#attributes", expectedAttrs.size(), + TestCase.assertEquals(aMsg + "/count(@*)", expectedAttrs.size(), actualAttrs.size()); for (int i = 0; i < expectedAttrs.size(); i++) { String msg = aMsg + "/@" + expectedAttrs.get(i).getName(); @@ -103,9 +103,10 @@ public final class XmlUtils { // Nested elements. List expectedElems = aExpected.elements(); List actualElems = aActual.elements(); - TestCase.assertEquals(aMsg + "/#elements", expectedElems.size(), + TestCase.assertEquals(aMsg + "/count(*)", expectedElems.size(), actualElems.size()); // determine the how-manyth element of the given name we are at. + // Maps element name to the last used index (or null if not yet used) Map elementIndex = new TreeMap(); for (int i = 0; i < expectedElems.size(); i++) { String elemName = expectedElems.get(i).getName(); @@ -116,8 +117,8 @@ public final class XmlUtils { index++; } elementIndex.put(elemName, index); - String msg = aMsg + "/" + expectedElems.get(i).getName() + "(" - + index + ")"; + String msg = aMsg + "/" + expectedElems.get(i).getName() + "[" + + index + "]"; assertEquals(msg, expectedElems.get(i), actualElems.get(i)); }