git://wamblee.org
/
utils
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f3f910c
)
(no commit message)
author
Erik Brakkee
<erik@brakkee.org>
Mon, 27 Mar 2006 22:30:55 +0000
(22:30 +0000)
committer
Erik Brakkee
<erik@brakkee.org>
Mon, 27 Mar 2006 22:30:55 +0000
(22:30 +0000)
support/test/org/wamblee/xml/XmlUtils.java
patch
|
blob
|
history
diff --git
a/support/test/org/wamblee/xml/XmlUtils.java
b/support/test/org/wamblee/xml/XmlUtils.java
index 12292469e06178012a5010af4d636294135eaa23..93d2e917c6d8af8cfa3457c5ed318a83adc9104c 100644
(file)
--- 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<Attribute> actualAttrs = aActual.attributes();
Collections.sort(actualAttrs, new AttributeComparator());
List<Attribute> 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();
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<Element> expectedElems = aExpected.elements();
List<Element> actualElems = aActual.elements();
// Nested elements.
List<Element> expectedElems = aExpected.elements();
List<Element> 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.
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<String, Integer> elementIndex = new TreeMap<String, Integer>();
for (int i = 0; i < expectedElems.size(); i++) {
String elemName = expectedElems.get(i).getName();
Map<String, Integer> elementIndex = new TreeMap<String, Integer>();
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);
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));
}
assertEquals(msg, expectedElems.get(i), actualElems.get(i));
}