clearer intention in test on serialization with extra interfaces
moved serialization utility method in a separate class in tests
reformatted a bit
externalized isolating classloader
First working steps to have a serialization that works across classloaders/JVMs
Made the serialization feature thread-safe
Document the code
This test didn't pass when run with all the other test. This is due to objenesis cache not resetted, it uses an instantiation strategy that creates a mock that belongs to another classloader, hence a classcast was thrown in the ClassImposterizer. And all of this because IMethods was already used. This commit makes use of some class only loaded in the classloader being used here (so objenesis only sees that class in this test)
For the sake of coherence, the other method here will be using the current thread classloader when executing the Callable
typo and a bit more of documentation in some tests
Tweaked the check for serialization, to narrow down serialization issues when there's no zero-arg constructor in types that don't implement Serializable
added simple classes that could be run outside the test suite to demonstrate the ability to serialize a mock and deserialize it in another VM
Document the code
Use a new MockitoMock interface to mark a mockito mock instead of retrieving the mock handler, when we just want to identify a mockito mock
Also created a new getMockSetting in MockUtil to avoid breaking demeter law
Removed the ClassNameFinder, is it used an unreliable way to get the mocked type, now the code will read this information from the creation settings
Identify mocks class in MockUtil
add @see for classes that uses this class
use a constant for the mockito marker in serialization stream
added test that document the fact that mocks cannot be deserialized if the mocked type has a private constructor. It might be possible in the future though it might requires tricks with objenesis and the custom object streams.
removed unneeded deserialization as it isn't affected by concurrency problems