From c59bc847e86e72a6045b0442061c21ff28e77890 Mon Sep 17 00:00:00 2001 From: erik Date: Mon, 27 Mar 2006 22:30:55 +0000 Subject: [PATCH] --- support/test/org/wamblee/xml/XmlUtils.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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)); } -- 2.31.1