Re: [jetty-user] test-jetty-servlet masks thrown exception types as of 7.6.0.RC4 (including latest release)
"Jacob Kjome" <[email protected]> Wed, 21 Mar 2012 14:07:22 -0500
| Newsgroups | gmane.comp.java.jetty.support |
|---|---|
| Message-ID | <[email protected]> |
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" <[email protected]> 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