From: Jeff M. <cus...@us...> - 2002-08-16 17:50:25
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/servlet In directory usw-pr-cvs1:/tmp/cvs-serv596/src/j2ee/1.3/com/mockobjects/servlet Modified Files: MockHttpServletRequest.java Log Message: Allow verification of getAttribute names Index: MockHttpServletRequest.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/servlet/MockHttpServletRequest.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- MockHttpServletRequest.java 14 Aug 2002 14:16:46 -0000 1.6 +++ MockHttpServletRequest.java 16 Aug 2002 17:50:21 -0000 1.7 @@ -26,7 +26,7 @@ private String myRequestURI; private String myMethod; private ServletInputStream myInputStream; - private java.security.Principal myUserPrincipal; + private Principal myUserPrincipal; private final ExpectationSet mySetAttributes = new ExpectationSet(MockHttpServletRequest.class.getName() + ".setAttribute"); @@ -35,12 +35,18 @@ private final ReturnObjectList myAttributesToReturn = new ReturnObjectList("attributes"); private final ExpectationValue myContentType = new ExpectationValue("content type"); + private final ExpectationList myGetAttributeNames = new ExpectationList("get attribute names"); public void setupGetAttribute(Object anAttributeToReturn) { myAttributesToReturn.addObjectToReturn(anAttributeToReturn); } + public void addExpectedGetAttributeName(String anAttributeName) { + myGetAttributeNames.addExpected(anAttributeName); + } + public Object getAttribute(String anAttributeName) { + myGetAttributeNames.addActual(anAttributeName); return myAttributesToReturn.nextReturnObject(); } |