1 37 package net.sourceforge.cruisecontrol.mock; 38 39 import java.util.Collections ; 40 import java.util.Enumeration ; 41 import java.util.HashMap ; 42 import java.util.Map ; 43 import javax.servlet.ServletConfig ; 44 import javax.servlet.ServletContext ; 45 46 50 public class MockServletConfig implements ServletConfig { 51 private Map initParams = new HashMap (); 52 private ServletContext context; 53 54 public MockServletConfig() { 55 } 56 57 public ServletContext getServletContext() { 58 return context; 59 } 60 61 public String getInitParameter(String name) { 62 return (String ) initParams.get(name); 63 } 64 65 public Enumeration getInitParameterNames() { 66 return Collections.enumeration(initParams.keySet()); 67 } 68 69 public String getServletName() { 70 return ""; 71 } 72 73 public void setInitParameter(String name, String value) { 74 initParams.put(name, value); 75 } 76 77 public void setServletContext(ServletContext mockContext) { 78 context = mockContext; 79 } 80 } 81 | Popular Tags |