+ " <url-pattern>/url3</url-pattern>"
+ " </web-resource-collection>"
+ " </security-constraint>"
+ "</web-app>";
Document doc = builder.parse(new ByteArrayInputStream(xml.getBytes()));
WebXml webXml = new WebXml(doc);
assertTrue(webXml.hasSecurityConstraint("/url1"));
assertTrue(webXml.hasSecurityConstraint("/url2"));
assertTrue(webXml.hasSecurityConstraint("/url3"));
Iterator securityConstraints =
webXml.getElements(WebXmlTag.SECURITY_CONSTRAINT);
assertNotNull(securityConstraints.next());
assertNotNull(securityConstraints.next());
assertNotNull(securityConstraints.next());
assertTrue(!securityConstraints.hasNext());
}