From: erik Date: Mon, 27 Mar 2006 22:30:55 +0000 (+0000) Subject: (no commit message) X-Git-Tag: BEFORE_MAVEN_MIGRATION~126 X-Git-Url: http://wamblee.org/gitweb/?a=commitdiff_plain;h=c59bc847e86e72a6045b0442061c21ff28e77890;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)); }