public void testAddSecurityConstraint() throws Exception {
  String xml=WEBAPP_TEST_HEADER + "</web-app>";
  WebXml webXml=WebXmlIo.parseWebXml(new ByteArrayInputStream(xml.getBytes("UTF-8")),getEntityResolver());
  WebXmlUtils.addSecurityConstraint(webXml,"wrn","/url",Collections.EMPTY_LIST);
  assertTrue(WebXmlUtils.hasSecurityConstraint(webXml,"/url"));
}

public void testAddSecurityConstraint ( ) throws Exception { String xml = WEBAPP_TEST_HEADER + "</web-app>" ; WebXml webXml = WebXmlIo . parseWebXml ( new ByteArrayInputStream ( xml . getBytes ( "UTF-8" ) ) , getEntityResolver ( ) ) ; WebXmlUtils . addSecurityConstraint ( webXml , "wrn" , "/url" , Collections . EMPTY_LIST ) ; assertTrue ( WebXmlUtils . hasSecurityConstraint ( webXml , "/url" ) ) ; }
tests whether a security - constraint with no roles is successfully added to an empty descriptor .
