assertNull(servletDef.getJspFile());
}
public void testOverwriteAnnotation() throws Exception {
WebXml webxml = new WebXml();
ServletDef servletDef = new ServletDef();
servletDef.setServletName("param");
servletDef.setServletClass("org.apache.catalina.startup.ParamServlet");
servletDef.addInitParameter("foo", "tomcat");
servletDef.setDescription("Description");
servletDef.setDisplayName("DisplayName");
servletDef.setLargeIcon("LargeIcon");
servletDef.setSmallIcon("SmallIcon");
servletDef.setAsyncSupported("true");
servletDef.setLoadOnStartup("1");
webxml.addServlet(servletDef);
webxml.addServletMapping("/param", "param");
ContextConfig config = new ContextConfig();
File pFile = paramClassResource(
"org/apache/catalina/startup/ParamServlet");
assertTrue(pFile.exists());
config.processAnnotationsFile(pFile, webxml);
assertEquals(servletDef, webxml.getServlets().get("param"));
assertEquals("tomcat", servletDef.getParameterMap().get("foo"));
assertEquals("param", webxml.getServletMappings().get("/param"));
// annotation mapping not added s. Servlet Spec 3.0 (Nov 2009)
// 8.2.3.3.iv page 81
assertNull(webxml.getServletMappings().get("/annotation/overwrite"));
assertEquals("Description", servletDef.getDescription());
assertEquals("DisplayName", servletDef.getDisplayName());
assertEquals("LargeIcon", servletDef.getLargeIcon());
assertEquals("SmallIcon", servletDef.getSmallIcon());