1 package com.mockobjects.servlet; 2 3 import javax.servlet.*; 4 import junit.framework.*; 5 import junit.textui.*; 6 import java.util.*; 7 import java.io.*; 8 import java.net.*; 9 import com.mockobjects.*; 10 11 14 public class MockServletConfig extends MockObject implements ServletConfig { 15 private Dictionary myParameters = new Hashtable(); 16 private ServletContext servletContext; 17 18 public String getInitParameter(String paramName) { 19 return (String )myParameters.get(paramName); 20 } 21 22 public void setInitParameter(String paramName, String paramValue) { 23 myParameters.put(paramName, paramValue); 24 } 25 26 public java.util.Enumeration getInitParameterNames() { 27 return myParameters.keys(); 28 } 29 30 public void setupAddInitParameter(String paramName, String value) { 31 myParameters.put(paramName, value); 32 } 33 34 public void setupNoParameters() { 35 myParameters = new Hashtable(); 36 } 37 38 public void setServletContext(ServletContext servletContext){ 39 this.servletContext = servletContext; 40 } 41 42 public ServletContext getServletContext(){ 43 return servletContext; 44 } 45 public String getServletName(){ 46 return null; 47 } 48 } 49 50 | Popular Tags |