aspose file tools*
The moose likes Testing and the fly likes Source code misaligned when partial mocking private methods using JMockit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Source code misaligned when partial mocking private methods using JMockit" Watch "Source code misaligned when partial mocking private methods using JMockit" New topic
Author

Source code misaligned when partial mocking private methods using JMockit

Salil Surendran
Ranch Hand

Joined: Jan 16, 2004
Posts: 39
Hello Friends,
I have a class that I am partially mocking using NonStrictExpectations



The problem is that when I use Deencapsulation.invoke() to mock a private method it messes up the source code of the CampaignSelector class and hence when I debug into the getMessageFromCampaign() method the source code is misaligned in Eclipse. I understand that JMockit redefines classes but this only happens when private methods are mocked and not public. Any way to get around this problem?


Thanks,<br />Salil Surendran
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Source code misaligned when partial mocking private methods using JMockit