test-jetty-servlet masks thrown exception types as of 7.6.0.RC4 (including latest release)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

test-jetty-servlet masks thrown exception types as of 7.6.0.RC4 (including latest release)

Jacob Kjome

I'm using the Jetty Servlet Tester library to test a Filter.  The following
test works fine in version 7.5.4.v20111024 and right up through 7.6.0.RC3....

@Test(expected = ServletException.class)
    public void initMissingHttpFilterRequiredParamContainer() throws Exception
    {
        final ServletTester localTester = new ServletTester();
        localTester.addFilter(HttpFilter.class, "/httpfilter/arbitrary/*",
FilterMapping.REQUEST);
        localTester.setContextPath("");
        localTester.start();
    }

I expect a ServletException because a required init parameter wasn't set and,
in such case, my filter throws a ServletException to indicate the problem.

But as of version 7.6.0.RC4 and right up through the latest 7.6.2.v20120308, I
get the following error....

 
initMissingHttpFilterRequiredParamContainer(com.blah.servlet.HttpFilterTest):
Unexpected exception, expected<javax.servlet.ServletException> but
was<org.eclipse.jetty.util.MultiException>


It is not helpful to mask the real exception, and I certainly don't want to
test specifically for "org.eclipse.jetty.util.MultiException" because that's
not what I'm throwing and because it's Jetty-specific.

Was this change intentional or is an oversight/bug?


Jake


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: test-jetty-servlet masks thrown exception types as of 7.6.0.RC4 (including latest release)

Jacob Kjome

No comment on this Jetty behavioral change which appears pretty clear to me to
be a bug?

Jake

On Mon, 19 Mar 2012 17:17:39 -0500
 "Jacob Kjome" <[hidden email]> wrote:

>
> I'm using the Jetty Servlet Tester library to test a Filter.  The following
>test works fine in version 7.5.4.v20111024 and right up through 7.6.0.RC3....
>
> @Test(expected = ServletException.class)
>     public void initMissingHttpFilterRequiredParamContainer() throws
>Exception
>     {
>         final ServletTester localTester = new ServletTester();
>         localTester.addFilter(HttpFilter.class, "/httpfilter/arbitrary/*",
>FilterMapping.REQUEST);
>         localTester.setContextPath("");
>         localTester.start();
>     }
>
> I expect a ServletException because a required init parameter wasn't set
>and, in such case, my filter throws a ServletException to indicate the
>problem.
>
> But as of version 7.6.0.RC4 and right up through the latest 7.6.2.v20120308,
>I get the following error....
>
>  
> initMissingHttpFilterRequiredParamContainer(com.blah.servlet.HttpFilterTest):
>Unexpected exception, expected<javax.servlet.ServletException> but
>was<org.eclipse.jetty.util.MultiException>
>
>
> It is not helpful to mask the real exception, and I certainly don't want to
>test specifically for "org.eclipse.jetty.util.MultiException" because that's
>not what I'm throwing and because it's Jetty-specific.
>
> Was this change intentional or is an oversight/bug?
>
>
> Jake
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: test-jetty-servlet masks thrown exception types as of 7.6.0.RC4 (including latest release)

Jan Bartel-3
Jacob,

You're right - we're handling filter initialization exceptions
differently than servlet initialization exceptions.

Raised: https://bugs.eclipse.org/bugs/show_bug.cgi?id=375009

thanks
Jan

On 22 March 2012 06:07, Jacob Kjome <[hidden email]> wrote:

>
> No comment on this Jetty behavioral change which appears pretty clear to me
> to be a bug?
>
> Jake
>
>
> On Mon, 19 Mar 2012 17:17:39 -0500
>  "Jacob Kjome" <[hidden email]> wrote:
>>
>>
>> I'm using the Jetty Servlet Tester library to test a Filter.  The
>> following test works fine in version 7.5.4.v20111024 and right up through
>> 7.6.0.RC3....
>>
>> @Test(expected = ServletException.class)
>>     public void initMissingHttpFilterRequiredParamContainer() throws
>> Exception
>>     {
>>         final ServletTester localTester = new ServletTester();
>>         localTester.addFilter(HttpFilter.class, "/httpfilter/arbitrary/*",
>> FilterMapping.REQUEST);
>>         localTester.setContextPath("");
>>         localTester.start();
>>     }
>>
>> I expect a ServletException because a required init parameter wasn't set
>> and, in such case, my filter throws a ServletException to indicate the
>> problem.
>>
>> But as of version 7.6.0.RC4 and right up through the latest
>> 7.6.2.v20120308, I get the following error....
>>
>>
>> initMissingHttpFilterRequiredParamContainer(com.blah.servlet.HttpFilterTest):
>> Unexpected exception, expected<javax.servlet.ServletException> but
>> was<org.eclipse.jetty.util.MultiException>
>>
>>
>> It is not helpful to mask the real exception, and I certainly don't want
>> to test specifically for "org.eclipse.jetty.util.MultiException" because
>> that's not what I'm throwing and because it's Jetty-specific.
>>
>> Was this change intentional or is an oversight/bug?
>>
>>
>> Jake
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>   http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: test-jetty-servlet masks thrown exception types as of 7.6.0.RC4 (including latest release)

Jacob Kjome

I see the bug is fixed for jetty-7.6.3/8.1.3.  Thanks for the quick work Jan!

Jake


On Thu, 22 Mar 2012 11:30:28 +1100
 Jan Bartel <[hidden email]> wrote:

> Jacob,
>
> You're right - we're handling filter initialization exceptions
> differently than servlet initialization exceptions.
>
> Raised: https://bugs.eclipse.org/bugs/show_bug.cgi?id=375009
>
> thanks
> Jan
>
> On 22 March 2012 06:07, Jacob Kjome <[hidden email]> wrote:
>>
>> No comment on this Jetty behavioral change which appears pretty clear to me
>> to be a bug?
>>
>> Jake
>>
>>
>> On Mon, 19 Mar 2012 17:17:39 -0500
>>  "Jacob Kjome" <[hidden email]> wrote:
>>>
>>>
>>> I'm using the Jetty Servlet Tester library to test a Filter.  The
>>> following test works fine in version 7.5.4.v20111024 and right up through
>>> 7.6.0.RC3....
>>>
>>> @Test(expected = ServletException.class)
>>>     public void initMissingHttpFilterRequiredParamContainer() throws
>>> Exception
>>>     {
>>>         final ServletTester localTester = new ServletTester();
>>>         localTester.addFilter(HttpFilter.class, "/httpfilter/arbitrary/*",
>>> FilterMapping.REQUEST);
>>>         localTester.setContextPath("");
>>>         localTester.start();
>>>     }
>>>
>>> I expect a ServletException because a required init parameter wasn't set
>>> and, in such case, my filter throws a ServletException to indicate the
>>> problem.
>>>
>>> But as of version 7.6.0.RC4 and right up through the latest
>>> 7.6.2.v20120308, I get the following error....
>>>
>>>
>>> initMissingHttpFilterRequiredParamContainer(com.blah.servlet.HttpFilterTest):
>>> Unexpected exception, expected<javax.servlet.ServletException> but
>>> was<org.eclipse.jetty.util.MultiException>
>>>
>>>
>>> It is not helpful to mask the real exception, and I certainly don't want
>>> to test specifically for "org.eclipse.jetty.util.MultiException" because
>>> that's not what I'm throwing and because it's Jetty-specific.
>>>
>>> Was this change intentional or is an oversight/bug?
>>>
>>>
>>> Jake
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list, please visit:
>>>
>>>     http://xircles.codehaus.org/manage_email
>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>   http://xircles.codehaus.org/manage_email
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email