From: Jeff M. <cus...@us...> - 2003-03-18 14:28:47
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/servlet In directory sc8-pr-cvs1:/tmp/cvs-serv22955/src/j2ee/1.3/com/mockobjects/servlet Modified Files: MockHttpServletRequest.java Log Message: Pepper Mocks with ReturnValue Index: MockHttpServletRequest.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/servlet/MockHttpServletRequest.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- MockHttpServletRequest.java 25 Feb 2003 17:41:30 -0000 1.13 +++ MockHttpServletRequest.java 18 Mar 2003 14:28:43 -0000 1.14 @@ -44,6 +44,7 @@ private ExpectationValue myContentType = new ExpectationValue("content type"); private ExpectationList myGetAttributeNames = new ExpectationList("get attribute names"); private final ReturnValue servletPath = new ReturnValue("servlet path"); + private final ReturnValue parameterMap = new ReturnValue("parameter map"); public void setupGetAttribute(Object anAttributeToReturn) { myAttributesToReturn.addObjectToReturn(anAttributeToReturn); @@ -58,7 +59,7 @@ return myAttributesToReturn.nextReturnObject(); } - public void setupGetAttrubuteNames(Vector attributeNames){ + public void setupGetAttrubuteNames(Vector attributeNames) { myAttributesNames = attributeNames; } @@ -82,7 +83,7 @@ } public String getContentType() { - return (String)myContentTypeToReturn.getValue(); + return (String) myContentTypeToReturn.getValue(); } public void setupGetContentType(String aContentType) { @@ -98,7 +99,7 @@ } public String getContextPath() { - return (String)myContextPath.getValue(); + return (String) myContextPath.getValue(); } public void setupGetContextPath(String contextPath) { @@ -135,7 +136,7 @@ public ServletInputStream getInputStream() throws IOException { - return (ServletInputStream)inputStream.getValue(); + return (ServletInputStream) inputStream.getValue(); } public int getIntHeader(String arg1) { @@ -158,7 +159,7 @@ } public String getMethod() { - return (String)method.getValue(); + return (String) method.getValue(); } public String getParameter(String paramName) { @@ -178,7 +179,7 @@ } public String getPathInfo() { - return (String)myPathInfo.getValue(); + return (String) myPathInfo.getValue(); } public String getPathTranslated() { @@ -187,7 +188,7 @@ } public String getProtocol() { - return (String)protocol.getValue(); + return (String) protocol.getValue(); } public void setupGetProtocol(String protocol) { @@ -195,11 +196,11 @@ } public String getQueryString() { - return (String)queryString.getValue(); + return (String) queryString.getValue(); } public BufferedReader getReader() { - return (BufferedReader)reader.getValue(); + return (BufferedReader) reader.getValue(); } public void setupGetReader(BufferedReader reader) throws IOException { @@ -216,7 +217,7 @@ } public String getRemoteAddr() { - return (String)myRemoteAddress.getValue(); + return (String) myRemoteAddress.getValue(); } public String getRemoteHost() { @@ -245,15 +246,15 @@ } public String getRequestURI() { - return (String)myRequestURI.getValue(); + return (String) myRequestURI.getValue(); } public String getScheme() { - return (String)scheme.getValue(); + return (String) scheme.getValue(); } public String getServerName() { - return (String)serverName.getValue(); + return (String) serverName.getValue(); } public int getServerPort() { @@ -261,16 +262,16 @@ return 0; } - public void setupGetServletPath(String path){ + public void setupGetServletPath(String path) { this.servletPath.setValue(path); } public String getServletPath() { - return (String)servletPath.getValue(); + return (String) servletPath.getValue(); } public HttpSession getSession() { - return (HttpSession)myHttpSession.getValue(); + return (HttpSession) myHttpSession.getValue(); } public void setSession(HttpSession httpSession) { @@ -287,7 +288,7 @@ } public Principal getUserPrincipal() { - return (Principal)myUserPrincipal.getValue(); + return (Principal) myUserPrincipal.getValue(); } public boolean isRequestedSessionIdFromCookie() { @@ -388,8 +389,11 @@ notImplemented(); } + public void setupGetParameterMap(Map map) { + this.parameterMap.setValue(map); + } + public Map getParameterMap() { - notImplemented(); - return null; + return (Map) parameterMap.getValue(); } } |