cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vanyatka <ibalas...@gmail.com>
Subject ClassCastException prevents thorough endpoint testing
Date Sat, 29 May 2010 22:59:36 GMT

Hey,

Just ran into the problem of testing endpoint when the endpoint method
should throw business exception. In the Integration Test I have to catch &
verify this exception. To my frustration, the call on the endpoint does not
throw desired exception, but rather 

java.lang.ClassCastException: java.lang.Class cannot be cast to
javax.ws.rs.core.Response

The endpoint configuration (client test side) is done via Spring, as
follows:

    <jaxrs:client id="helloWorldEndpoint" 
        address="${jetty.url}"
        serviceClass="endpoint.HelloWorldEndpointImpl">
    </jaxrs:client>


In the business scenario when endpoint finishes normally, the test works
fine, endpoint returns Response object.

Tried to register ResponseExceptionMapper, but no avail, ClassCastException
issue persists.

Any suggestions on what could be the matter and how to make IT tests handle
exceptions in endpoints are very welcome :thinking:

-Ivan
-- 
View this message in context: http://old.nabble.com/ClassCastException-prevents-thorough-endpoint-testing-tp28719118p28719118.html
Sent from the cxf-user mailing list archive at Nabble.com.


Mime
View raw message