Re: [Resteasy-users] Unit Testing Exception Mappers

2013-08-13 Thread Adam Hotz
Hi
Actually I found the registerProvider factory to do what I wanted.

Regards,
Adam


On Fri, Aug 9, 2013 at 11:14 AM, Bill Burke bbu...@redhat.com wrote:

 Create a a ResteasyDeployment, add necessary components to it, call
 start() get the dispatch, create the mocks.

 On 8/9/2013 10:51 AM, Adam Hotz wrote:
  Hi
 
  I'm using RestEasy to implement a web service. I was previously using
  the resteasy mock objects to mock requests and also to test my custom
  exception mappers. I was testing the mappers by adding them to a mock
  dispatcher as suggested by the answer to this stack overflow question:
 
 http://stackoverflow.com/questions/5866695/resteasy-server-mock-exceptionmapper-not-found
  i.e
 
 
 |dispatcher.getProviderFactory().addExceptionMapper(SomeExceptionMapper.class);|
 
 
  However a recent patch
  (
 https://github.com/resteasy/Resteasy/commit/16721d16b235ea7a6918ae8bdecb04b73bd59204
 )
  has changed the access modifier of addExceptionMapper from public to
  protected, which means that I can no longer do this. Is there a
  recommended alternative for including ExceptionMappers in my Unit Tests?
 
  Regards,
  Adam Hotz
 
 
 
 
 --
  Get 100% visibility into Java/.NET code with AppDynamics Lite!
  It's a free troubleshooting tool designed for production.
  Get down to code-level detail for bottlenecks, with 2% overhead.
  Download for free and get started troubleshooting in minutes.
 
 http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk
 
 
 
  ___
  Resteasy-users mailing list
  Resteasy-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/resteasy-users
 

 --
 Bill Burke
 JBoss, a division of Red Hat
 http://bill.burkecentral.com


 --
 Get 100% visibility into Java/.NET code with AppDynamics Lite!
 It's a free troubleshooting tool designed for production.
 Get down to code-level detail for bottlenecks, with 2% overhead.
 Download for free and get started troubleshooting in minutes.
 http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk
 ___
 Resteasy-users mailing list
 Resteasy-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/resteasy-users

--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with 2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] Unit Testing Exception Mappers

2013-08-09 Thread Bill Burke
Create a a ResteasyDeployment, add necessary components to it, call 
start() get the dispatch, create the mocks.

On 8/9/2013 10:51 AM, Adam Hotz wrote:
 Hi

 I'm using RestEasy to implement a web service. I was previously using
 the resteasy mock objects to mock requests and also to test my custom
 exception mappers. I was testing the mappers by adding them to a mock
 dispatcher as suggested by the answer to this stack overflow question:
 http://stackoverflow.com/questions/5866695/resteasy-server-mock-exceptionmapper-not-found
 i.e

 |dispatcher.getProviderFactory().addExceptionMapper(SomeExceptionMapper.class);|


 However a recent patch
 (https://github.com/resteasy/Resteasy/commit/16721d16b235ea7a6918ae8bdecb04b73bd59204)
 has changed the access modifier of addExceptionMapper from public to
 protected, which means that I can no longer do this. Is there a
 recommended alternative for including ExceptionMappers in my Unit Tests?

 Regards,
 Adam Hotz



 --
 Get 100% visibility into Java/.NET code with AppDynamics Lite!
 It's a free troubleshooting tool designed for production.
 Get down to code-level detail for bottlenecks, with 2% overhead.
 Download for free and get started troubleshooting in minutes.
 http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk



 ___
 Resteasy-users mailing list
 Resteasy-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/resteasy-users


-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with 2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users