From: Jeff M. <cus...@us...> - 2003-06-25 09:25:01
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/servlet In directory sc8-pr-cvs1:/tmp/cvs-serv31409/src/j2ee/1.3/com/mockobjects/servlet Modified Files: MockHttpServletRequest.java Log Message: Added support for Headers Index: MockHttpServletRequest.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/servlet/MockHttpServletRequest.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- MockHttpServletRequest.java 1 May 2003 09:26:52 -0000 1.16 +++ MockHttpServletRequest.java 25 Jun 2003 09:24:58 -0000 1.17 @@ -48,6 +48,8 @@ private final ReturnValue requestDispatcher = new ReturnValue("request dispatcher"); private final ExpectationValue requestDispatcherURI = new ExpectationValue("request dispatcher uri"); private final ExpectationValue createSession = new ExpectationValue("create session"); + private final ReturnValue headerNames = new ReturnValue("header names"); + private final ReturnObjectBag headers = new ReturnObjectBag("headers"); public void setupGetAttribute(Object anAttributeToReturn) { myAttributesToReturn.addObjectToReturn(anAttributeToReturn); @@ -124,13 +126,19 @@ } public Enumeration getHeaderNames() { - notImplemented(); - return null; + return (Enumeration)headerNames.getValue(); } - public Enumeration getHeaders(String arg1) { - notImplemented(); - return null; + public void setupGetHeaderNames(Enumeration headerNames){ + this.headerNames.setValue(headerNames); + } + + public Enumeration getHeaders(String name) { + return (Enumeration)headers.getNextReturnObject(name); + } + + public void setupGetHeaders(String name, Enumeration values){ + headers.putObjectToReturn(name, values); } public void setupGetInputStream(ServletInputStream inputStream) { |