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: 36
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Source code misaligned when partial mocking private methods using JMockit
 
Similar Threads
Need help in understanding JMockit Usage
Jmockit with idea problem
Returning an array of mock objects and testing their order using jmockit
Using Jmock to mock out calls to external components
TestNG vs JUnit, mockito + Powermock vs jmockit