{
executeTestTarget();
File destFile = getProject().resolveFile("work/destfile.war");
WarArchive destWar = new WarArchive(destFile);
WebXml webXml = destWar.getWebXml();
assertTrue(webXml.hasServlet("ServletRedirectorSecure"));
assertEquals("/ServletRedirectorSecure",
webXml.getServletMappings("ServletRedirectorSecure").next());
assertTrue(webXml.hasSecurityRole("test"));
assertTrue(webXml.hasSecurityRole("cactus"));
assertTrue(webXml.hasSecurityConstraint("/ServletRedirectorSecure"));
Element securityConstraintElement =
webXml.getSecurityConstraint("/ServletRedirectorSecure");
assertNotNull(securityConstraintElement);
Element authConstraintElement = (Element)
securityConstraintElement.getElementsByTagName(
"auth-constraint").item(0);
assertNotNull(authConstraintElement);
NodeList roleNameElements =
authConstraintElement.getElementsByTagName("role-name");
assertEquals(2, roleNameElements.getLength());
assertEquals("test",
roleNameElements.item(0).getChildNodes().item(0).getNodeValue());
assertEquals("cactus",
roleNameElements.item(1).getChildNodes().item(0).getNodeValue());
Iterator loginConfigElements =
webXml.getElements(WebXmlTag.LOGIN_CONFIG);
assertTrue(loginConfigElements.hasNext());
Element loginConfigElement = (Element) loginConfigElements.next();
Element authMethodElement = (Element)
loginConfigElement.getElementsByTagName("auth-method").item(0);
assertEquals("BASIC",