The PowerMockRunner class sets the current's thread contextClassLoader with the
mock'd classloader, this is not done in TestNG PowerMockObjectFactory.
Consequently if there is dependent classes that are using reflection by pulling
the contextClassLoader from the current thread, it has class cast exception
issues.
I ran accross the issue trying to use Drools with TestNG + PowerMock. Simply
ignoring the drools packages keeps the rules it runs to properly recognize the
classes.
I've attached a patch that will set the thread accordingly.
Original issue reported on code.google.com by mathos.m...@gmail.com on 10 Mar 2011 at 6:16
Original issue reported on code.google.com by
mathos.m...@gmail.com
on 10 Mar 2011 at 6:16Attachments: