[ 
https://issues.apache.org/jira/browse/SLING-7174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16188487#comment-16188487
 ] 

Justin Edelson commented on SLING-7174:
---------------------------------------

Fixed in r1810562/r1810564 by properly implementing the {{getReader}} method. 
Also fixed the implementation of {{getInputStream}} to properly through 
{{IllegalStateException}} if the reader has already been accessed.

Also fixed in r1810563 by catching the exception in {{ExportServlet}} since 
even with these changes, an {{IllegalStateException}} could be thrown by a call 
to {{getReader}}.

> Using MockSlingHttpServletRequest for In-Sling Rendering fails when used with 
> Export Servlet
> --------------------------------------------------------------------------------------------
>
>                 Key: SLING-7174
>                 URL: https://issues.apache.org/jira/browse/SLING-7174
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>         Environment: Sling 9, Java 1.8
>            Reporter: Andreas Schaefer
>            Assignee: Justin Edelson
>             Fix For: Servlet Helpers 1.1.2, Sling Models Impl 1.4.6
>
>
> When I use MockSlingHttpServletRequest with SlingRequestProcessor to render a 
> page within sling then I will get an Unsupported Operation Exception when I 
> hit the Export Servlet.
> The reason is that the Export Servlet is retrieving Request Reader in 
> addScriptBindings():
>         bindings.put(READER, request.getReader());
> In my opinion Sling should provide a Request / Response class for in-Sling 
> rendering that is for that specific purpose as using that class for testing 
> does clash with the the rendering.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to