int i = 0;
NodeList collectionList = new NodeList();
for (NodeIterator e = parser.elements(); e.hasMoreNodes();)
{
Node node = e.nextNode();
node.collectInto(collectionList, ImageTag.IMAGE_TAG_FILTER);
}
assertEquals(
"Size of collection vector should be 5",
5,
collectionList.size());
// All items in collection vector should be links
for (SimpleNodeIterator e = collectionList.elements();
e.hasMoreNodes();
)
{
Node node = e.nextNode();
assertTrue(
"Only images should have been parsed",
node instanceof ImageTag);
}
}