You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by mi...@apache.org on 2003/07/02 20:58:40 UTC

cvs commit: jakarta-tapestry/junit/src/org/apache/tapestry/junit/mock MockRequest.java

mindbridge    2003/07/02 11:58:40

  Modified:    junit/src/org/apache/tapestry/junit/mock MockRequest.java
  Log:
  Adding the ability to set and get the character encoding of the mock request.
  
  Revision  Changes    Path
  1.4       +9 -2      jakarta-tapestry/junit/src/org/apache/tapestry/junit/mock/MockRequest.java
  
  Index: MockRequest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/junit/src/org/apache/tapestry/junit/mock/MockRequest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MockRequest.java	16 May 2003 18:54:23 -0000	1.3
  +++ MockRequest.java	2 Jul 2003 18:58:40 -0000	1.4
  @@ -114,6 +114,12 @@
       private List _cookies = new ArrayList();
       private String _contentPath;
   
  +    /**
  +     *  This can be stored within the header, but doing it this way emulates a browser that 
  +     *  does not put the encoding in the request, which appears to be the general case. 
  +     **/
  +    private String _encoding = null;
  +
       public MockRequest(MockContext servletContext, String servletPath)
       {
           _servletContext = servletContext;
  @@ -265,11 +271,12 @@
   
       public String getCharacterEncoding()
       {
  -        return null;
  +        return _encoding;
       }
   
       public void setCharacterEncoding(String arg0) throws UnsupportedEncodingException
       {
  +        _encoding = arg0;
       }
   
       public int getContentLength()