From: Jeff M. <cus...@us...> - 2003-05-01 09:26:56
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/servlet In directory sc8-pr-cvs1:/tmp/cvs-serv27062/src/j2ee/1.3/com/mockobjects/servlet Modified Files: MockHttpServletRequest.java Log Message: Added expectaion for create session flag on getSession Index: MockHttpServletRequest.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/servlet/MockHttpServletRequest.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- MockHttpServletRequest.java 10 Apr 2003 10:39:12 -0000 1.15 +++ MockHttpServletRequest.java 1 May 2003 09:26:52 -0000 1.16 @@ -47,6 +47,7 @@ private final ReturnValue myParameterNames = new ReturnValue("parameter names"); 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"); public void setupGetAttribute(Object anAttributeToReturn) { myAttributesToReturn.addObjectToReturn(anAttributeToReturn); @@ -236,16 +237,16 @@ return null; } - public void setupGetRequestDispatcher(RequestDispatcher requestDispatcher){ + public void setupGetRequestDispatcher(RequestDispatcher requestDispatcher) { this.requestDispatcher.setValue(requestDispatcher); } public RequestDispatcher getRequestDispatcher(String uri) { this.requestDispatcherURI.setActual(uri); - return (RequestDispatcher)requestDispatcher.getValue(); + return (RequestDispatcher) requestDispatcher.getValue(); } - public void setExpectedRequestDispatcherURI(String uri){ + public void setExpectedRequestDispatcherURI(String uri) { this.requestDispatcherURI.setExpected(uri); } @@ -291,9 +292,13 @@ this.myHttpSession.setValue(httpSession); } - public HttpSession getSession(boolean arg1) { - notImplemented(); - return null; + public void setExpectedCreateSession(boolean createSession) { + this.createSession.setExpected(createSession); + } + + public HttpSession getSession(boolean createSession) { + this.createSession.setActual(createSession); + return getSession(); } public void setupGetUserPrincipal(Principal userPrincipal) { |