• Post Reply Bookmark Topic Watch Topic
  • New Topic

Test code without third party source code for exception handling  RSS feed

 
albert kao
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to test my code without third party source code for exception handling?
e.g. for this program snippet, I don't have the source code for ThirdPartyException, how to test my program for exception handling?
Without the source code for ThirdPartyException, do I use mock library such as EasyMock to simulate ThirdPartyException?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would you need the source code for the exception class? If you have the class file (i.e., in a jar file) then you can create an instance of the exception and throw it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!