Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JMock and Web Service

 
Giovanni Esposito
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new with Jmock and I have a test case with Web Services that is implemented like i described ahead, however i can't inyect the mock of WebServiceContext and i dont know how i can do that.

Can anybody give me a hand with this... Thank in advance

 
Marshall Blythe
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could add a setter method to your WebServiceBean to allow injection of a WebServiceContext and move the @Resource annotation to this method:



Now you can use JMock to create a mock WebServiceContext and inject it via the setter method.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic