I've waded through a bunch of the classloading machinery in mockito 1.9.5 to fix a bug with multiple overlapping classloaders - https://github.com/mockito/mockito/issues/1297Would a fix be welcome on the 1.9.5 branch? Or perhaps someone can draw inspiration from it to fix the same issue on the 2.x branch? I'm happy to provide details on the (somewhat involved) root cause.
--
You received this message because you are subscribed to the Google Groups "mockito-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mockito-dev...@googlegroups.com.
To post to this group, send email to mocki...@googlegroups.com.
Visit this group at https://groups.google.com/group/mockito-dev.
For more options, visit https://groups.google.com/d/optout.
We prefer not to update Mockito 1 any longer (even more so, I am not sure how we even can). A bugfix to 2.x (if the issue still persists) would be greatly appreciated though!
Op do 15 mrt. 2018 om 01:59 schreef Charles Munger <charles...@gmail.com>:
I've waded through a bunch of the classloading machinery in mockito 1.9.5 to fix a bug with multiple overlapping classloaders - https://github.com/mockito/mockito/issues/1297--Would a fix be welcome on the 1.9.5 branch? Or perhaps someone can draw inspiration from it to fix the same issue on the 2.x branch? I'm happy to provide details on the (somewhat involved) root cause.
You received this message because you are subscribed to the Google Groups "mockito-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mockito-dev+unsubscribe@googlegroups.com.
To post to this group, send email to mocki...@googlegroups.com.
Visit this group at https://groups.google.com/group/mockito-dev.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "mockito-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mockito-dev+unsubscribe@googlegroups.com.
To post to this group, send email to mocki...@googlegroups.com.
Visit this group at https://groups.google.com/group/mockito-dev.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "mockito-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mockito-dev/djoJxKAigIw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mockito-dev+unsubscribe@googlegroups.com.
I'm not so familiar with gradle, can anyone help me with setting up this test:Thread.currentThread().setContextClassLoader(<UrlClassLoader with same parent and classpath as current classloader>);Foo foo = Mockito.mock(Foo.class);interface Foo {void doSomething();}With a mockito-extensions file pointing to a custom mockmaker that simply forwards to the default one (ByteBuddyMockMaker?).Mockito uses the context classloader to load the custom mockmaker, which is capable of providing all the mockito classes since it shares the same classpath as the system classloader; but the cast to MockAccess fails, because the instantiated mock implements MockAccess from the first classloader, since (at least in 1.9.5) the classloaders passed in to SearchingClassLoader are simply checked in order; the first one to return a class wins. I believe MultipleParentClassLoader has this same issue.Code pointers, examples, or an @Ignored checked in test are all welcome - the fix is as simple as storing a Map<String, Class<?>> that caches the instances of classes used internally by the mockmaker, so that MockHandler and the classes it references always use the mockmaker's classloader.On Thu, Mar 15, 2018 at 7:40 AM, Szczepan Faber <szcz...@gmail.com> wrote:
+1 to Tim'sThank you Charles for reaching out!
On Thu, Mar 15, 2018 at 3:16 AM, Tim van der Lippe <tvande...@gmail.com> wrote:
We prefer not to update Mockito 1 any longer (even more so, I am not sure how we even can). A bugfix to 2.x (if the issue still persists) would be greatly appreciated though!
Op do 15 mrt. 2018 om 01:59 schreef Charles Munger <charles...@gmail.com>:
I've waded through a bunch of the classloading machinery in mockito 1.9.5 to fix a bug with multiple overlapping classloaders - https://github.com/mockito/mockito/issues/1297--Would a fix be welcome on the 1.9.5 branch? Or perhaps someone can draw inspiration from it to fix the same issue on the 2.x branch? I'm happy to provide details on the (somewhat involved) root cause.
You received this message because you are subscribed to the Google Groups "mockito-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mockito-dev...@googlegroups.com.
To post to this group, send email to mocki...@googlegroups.com.
Visit this group at https://groups.google.com/group/mockito-dev.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "mockito-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mockito-dev...@googlegroups.com.
To post to this group, send email to mocki...@googlegroups.com.
Visit this group at https://groups.google.com/group/mockito-dev.
For more options, visit https://groups.google.com/d/optout.
--
Check out how to give great code reviews. You will be glad you did!
--
You received this message because you are subscribed to a topic in the Google Groups "mockito-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mockito-dev/djoJxKAigIw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mockito-dev...@googlegroups.com.
--
To post to this group, send email to mocki...@googlegroups.com.
Visit this group at https://groups.google.com/group/mockito-dev.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "mockito-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mockito-dev...@googlegroups.com.