You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Andrew Robinson (JIRA)" <de...@myfaces.apache.org> on 2009/06/16 05:54:07 UTC

[jira] Commented: (TRINIDAD-1506) ClassCastException during surefire tests when calling ExternalContextUtils.getServletContextPath()

    [ https://issues.apache.org/jira/browse/TRINIDAD-1506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12719910#action_12719910 ] 

Andrew Robinson commented on TRINIDAD-1506:
-------------------------------------------

Matt, do you have the stack trace of that exception by any chance?

> ClassCastException during surefire tests when calling ExternalContextUtils.getServletContextPath()
> --------------------------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-1506
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1506
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions:  1.2.11-core
>            Reporter: Matt Cooper
>            Priority: Minor
>
> If you have a renderer that makes a call like this:
> ExternalContextUtils.getServletContextPath(context.getExternalContext());
> Then, when running a surefire test for a component that uses such a renderer, a ClassCastException will be thrown where some underlying code is expecting a javax.servlet.ServletContext however, a org.apache.myfaces.trinidadinternal.renderkit.MApplication is provided instead.  Perhaps MApplication needs to implement/extend ServletContext or otherwise ExternalContextUtils.getServletContextPath() needs to return a dummy value when running surefire tests.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.