// test tags
//
Iterator tags = ruleset.getTags().iterator();
while (tags.hasNext())
{
Tag tag = (Tag) tags.next();
if (tag.getId().equalsIgnoreCase("FORM"))
{
assertFalse("Remove", tag.getRemove());
Iterator attributes = tag.getAttributes().iterator();
while (attributes.hasNext())
{
Attribute attribute = (Attribute) attributes.next();
assertTrue("attribute is not ACTION", attribute.getId().equals("ACTION"));
assertEquals("attribute rule not equal", attribute.getRule().getId(), "merge");
}
}
else if (tag.getId().equalsIgnoreCase("INPUT"))
{
assertFalse("Remove", tag.getRemove());
Iterator attributes = tag.getAttributes().iterator();
while (attributes.hasNext())
{
Attribute attribute = (Attribute) attributes.next();
assertTrue("attribute is not SOURCE", attribute.getId().equals("SOURCE"));
assertEquals("attribute rule not equal", attribute.getRule().getId(), "test");
}
}
else if (tag.getId().equalsIgnoreCase("LINK"))
{
assertFalse("Remove", tag.getRemove());
Iterator attributes = tag.getAttributes().iterator();
while (attributes.hasNext())
{
Attribute attribute = (Attribute) attributes.next();
assertTrue("attribute is not HREF", attribute.getId().equals("HREF"));
assertEquals("attribute rule not equal", attribute.getRule().getId(), "merge");
}
}
else if (tag.getId().equalsIgnoreCase("HEAD"))
{
assertTrue("Remove", tag.getRemove());
Iterator attributes = tag.getAttributes().iterator();
while (attributes.hasNext())
{
Attribute attribute = (Attribute) attributes.next();
}
}
else
{
assertTrue("tag name unexpected: " + tag.getId(), false);
}
}
assertNotNull("tags is null", tags);