[VOTE] Start using Mockito instead of JMock

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[VOTE] Start using Mockito instead of JMock

vmassol
Administrator
Hi devs,

This week end I've been (at last) experimenting with Mockito (http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html) and it's been successful so far :)

I've converted a first test to use it as a demonstrator of its power (http://jira.xwiki.org/browse/XCOMMONS-316):
https://github.com/xwiki/xwiki-commons/commit/7b45b48de1c6915294736dfddda7479213e754fd

I'd like to propose to start using it and start writing our tests with it since:
* It's very easy to use. I was able to very simply migrate an existing test to it
* It makes our tests much more readable to read and maintain IMO because 1) there's less boilerplate code, 2) it provides default values for mocks and 3) no more of ugly expectations syntax
* It's powerful, just see http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html
* It's actively maintained and developed, see http://code.google.com/p/mockito/downloads/list and http://code.google.com/p/mockito/source/list and http://code.google.com/p/mockito/people/list 

After we've written/converted a few tests (let's say in 1 month or so) we can really decide if we like it and make it our official mocking tool or if we should go back to JMock (but I have little doubts ;)).

WDYT?

Thanks
-Vincent

_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs
Reply | Threaded
Open this post in threaded view
|

Re: [VOTE] Start using Mockito instead of JMock

vmassol
Administrator

On Dec 8, 2012, at 3:12 PM, Vincent Massol <[hidden email]> wrote:

> Hi devs,
>
> This week end I've been (at last) experimenting with Mockito (http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html) and it's been successful so far :)
>
> I've converted a first test to use it as a demonstrator of its power (http://jira.xwiki.org/browse/XCOMMONS-316):
> https://github.com/xwiki/xwiki-commons/commit/7b45b48de1c6915294736dfddda7479213e754fd
>
> I'd like to propose to start using it and start writing our tests with it since:
> * It's very easy to use. I was able to very simply migrate an existing test to it
> * It makes our tests much more readable to read and maintain IMO because 1) there's less boilerplate code, 2) it provides default values for mocks and 3) no more of ugly expectations syntax
> * It's powerful, just see http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html
> * It's actively maintained and developed, see http://code.google.com/p/mockito/downloads/list and http://code.google.com/p/mockito/source/list and http://code.google.com/p/mockito/people/list 
>
> After we've written/converted a few tests (let's say in 1 month or so) we can really decide if we like it and make it our official mocking tool or if we should go back to JMock (but I have little doubts ;)).
>
> WDYT?

+1

Thanks
-Vincent

_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs
Reply | Threaded
Open this post in threaded view
|

Re: [VOTE] Start using Mockito instead of JMock

Sergiu Dumitriu-3
In reply to this post by vmassol
On 12/08/2012 09:12 AM, Vincent Massol wrote:

> Hi devs,
>
> This week end I've been (at last) experimenting with Mockito (http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html) and it's been successful so far :)
>
> I've converted a first test to use it as a demonstrator of its power (http://jira.xwiki.org/browse/XCOMMONS-316):
> https://github.com/xwiki/xwiki-commons/commit/7b45b48de1c6915294736dfddda7479213e754fd
>
> I'd like to propose to start using it and start writing our tests with it since:
> * It's very easy to use. I was able to very simply migrate an existing test to it
> * It makes our tests much more readable to read and maintain IMO because 1) there's less boilerplate code, 2) it provides default values for mocks and 3) no more of ugly expectations syntax
> * It's powerful, just see http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html
> * It's actively maintained and developed, see http://code.google.com/p/mockito/downloads/list and http://code.google.com/p/mockito/source/list and http://code.google.com/p/mockito/people/list 
>
> After we've written/converted a few tests (let's say in 1 month or so) we can really decide if we like it and make it our official mocking tool or if we should go back to JMock (but I have little doubts ;)).
>
> WDYT?

Looks good, +1.

--
Sergiu Dumitriu
http://purl.org/net/sergiu/
_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs
Reply | Threaded
Open this post in threaded view
|

Re: [VOTE] Start using Mockito instead of JMock

Denis Gervalle-2
+1, sounds good


On Sat, Dec 8, 2012 at 6:10 PM, Sergiu Dumitriu <[hidden email]> wrote:

> On 12/08/2012 09:12 AM, Vincent Massol wrote:
> > Hi devs,
> >
> > This week end I've been (at last) experimenting with Mockito (
> http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html)
> and it's been successful so far :)
> >
> > I've converted a first test to use it as a demonstrator of its power (
> http://jira.xwiki.org/browse/XCOMMONS-316):
> >
> https://github.com/xwiki/xwiki-commons/commit/7b45b48de1c6915294736dfddda7479213e754fd
> >
> > I'd like to propose to start using it and start writing our tests with
> it since:
> > * It's very easy to use. I was able to very simply migrate an existing
> test to it
> > * It makes our tests much more readable to read and maintain IMO because
> 1) there's less boilerplate code, 2) it provides default values for mocks
> and 3) no more of ugly expectations syntax
> > * It's powerful, just see
> http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html
> > * It's actively maintained and developed, see
> http://code.google.com/p/mockito/downloads/list and
> http://code.google.com/p/mockito/source/list and
> http://code.google.com/p/mockito/people/list
> >
> > After we've written/converted a few tests (let's say in 1 month or so)
> we can really decide if we like it and make it our official mocking tool or
> if we should go back to JMock (but I have little doubts ;)).
> >
> > WDYT?
>
> Looks good, +1.
>
> --
> Sergiu Dumitriu
> http://purl.org/net/sergiu/
> _______________________________________________
> devs mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/devs
>



--
Denis Gervalle
SOFTEC sa - CEO
eGuilde sarl - CTO
_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs
Reply | Threaded
Open this post in threaded view
|

Re: [VOTE] Start using Mockito instead of JMock

Eduard Moraru
+1,

Thanks,
Eduard


On Sat, Dec 8, 2012 at 8:09 PM, Denis Gervalle <[hidden email]> wrote:

> +1, sounds good
>
>
> On Sat, Dec 8, 2012 at 6:10 PM, Sergiu Dumitriu <[hidden email]> wrote:
>
> > On 12/08/2012 09:12 AM, Vincent Massol wrote:
> > > Hi devs,
> > >
> > > This week end I've been (at last) experimenting with Mockito (
> > http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html)
> > and it's been successful so far :)
> > >
> > > I've converted a first test to use it as a demonstrator of its power (
> > http://jira.xwiki.org/browse/XCOMMONS-316):
> > >
> >
> https://github.com/xwiki/xwiki-commons/commit/7b45b48de1c6915294736dfddda7479213e754fd
> > >
> > > I'd like to propose to start using it and start writing our tests with
> > it since:
> > > * It's very easy to use. I was able to very simply migrate an existing
> > test to it
> > > * It makes our tests much more readable to read and maintain IMO
> because
> > 1) there's less boilerplate code, 2) it provides default values for mocks
> > and 3) no more of ugly expectations syntax
> > > * It's powerful, just see
> > http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html
> > > * It's actively maintained and developed, see
> > http://code.google.com/p/mockito/downloads/list and
> > http://code.google.com/p/mockito/source/list and
> > http://code.google.com/p/mockito/people/list
> > >
> > > After we've written/converted a few tests (let's say in 1 month or so)
> > we can really decide if we like it and make it our official mocking tool
> or
> > if we should go back to JMock (but I have little doubts ;)).
> > >
> > > WDYT?
> >
> > Looks good, +1.
> >
> > --
> > Sergiu Dumitriu
> > http://purl.org/net/sergiu/
> > _______________________________________________
> > devs mailing list
> > [hidden email]
> > http://lists.xwiki.org/mailman/listinfo/devs
> >
>
>
>
> --
> Denis Gervalle
> SOFTEC sa - CEO
> eGuilde sarl - CTO
> _______________________________________________
> devs mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/devs
>
_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs
Reply | Threaded
Open this post in threaded view
|

Re: [VOTE] Start using Mockito instead of JMock

Marius Dumitru Florea
In reply to this post by vmassol
+1

Thanks,
Marius

On Sat, Dec 8, 2012 at 4:12 PM, Vincent Massol <[hidden email]> wrote:

> Hi devs,
>
> This week end I've been (at last) experimenting with Mockito (http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html) and it's been successful so far :)
>
> I've converted a first test to use it as a demonstrator of its power (http://jira.xwiki.org/browse/XCOMMONS-316):
> https://github.com/xwiki/xwiki-commons/commit/7b45b48de1c6915294736dfddda7479213e754fd
>
> I'd like to propose to start using it and start writing our tests with it since:
> * It's very easy to use. I was able to very simply migrate an existing test to it
> * It makes our tests much more readable to read and maintain IMO because 1) there's less boilerplate code, 2) it provides default values for mocks and 3) no more of ugly expectations syntax
> * It's powerful, just see http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html
> * It's actively maintained and developed, see http://code.google.com/p/mockito/downloads/list and http://code.google.com/p/mockito/source/list and http://code.google.com/p/mockito/people/list
>
> After we've written/converted a few tests (let's say in 1 month or so) we can really decide if we like it and make it our official mocking tool or if we should go back to JMock (but I have little doubts ;)).
>
> WDYT?
>
> Thanks
> -Vincent
>
> _______________________________________________
> devs mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs
Reply | Threaded
Open this post in threaded view
|

Re: [VOTE] Start using Mockito instead of JMock

Thomas Mortagne
Administrator
In reply to this post by vmassol
looks good, +1


On Sat, Dec 8, 2012 at 3:12 PM, Vincent Massol <[hidden email]> wrote:

> Hi devs,
>
> This week end I've been (at last) experimenting with Mockito (
> http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html)
> and it's been successful so far :)
>
> I've converted a first test to use it as a demonstrator of its power (
> http://jira.xwiki.org/browse/XCOMMONS-316):
>
> https://github.com/xwiki/xwiki-commons/commit/7b45b48de1c6915294736dfddda7479213e754fd
>
> I'd like to propose to start using it and start writing our tests with it
> since:
> * It's very easy to use. I was able to very simply migrate an existing
> test to it
> * It makes our tests much more readable to read and maintain IMO because
> 1) there's less boilerplate code, 2) it provides default values for mocks
> and 3) no more of ugly expectations syntax
> * It's powerful, just see
> http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html
> * It's actively maintained and developed, see
> http://code.google.com/p/mockito/downloads/list and
> http://code.google.com/p/mockito/source/list and
> http://code.google.com/p/mockito/people/list
>
> After we've written/converted a few tests (let's say in 1 month or so) we
> can really decide if we like it and make it our official mocking tool or if
> we should go back to JMock (but I have little doubts ;)).
>
> WDYT?
>
> Thanks
> -Vincent
>
> _______________________________________________
> devs mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/devs
>



--
Thomas Mortagne
_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs
Reply | Threaded
Open this post in threaded view
|

Re: [VOTE] Start using Mockito instead of JMock

Fabian Pichler
In reply to this post by vmassol
a little late. :-) But yep, looks good to me, +1

I think it even has the potential to replace the easymock
usage in the xwiki based celements-web project. :-)

Fabian.


2012/12/8 Vincent Massol <[hidden email]>

> Hi devs,
>
> This week end I've been (at last) experimenting with Mockito (
> http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html)
> and it's been successful so far :)
>
> I've converted a first test to use it as a demonstrator of its power (
> http://jira.xwiki.org/browse/XCOMMONS-316):
>
> https://github.com/xwiki/xwiki-commons/commit/7b45b48de1c6915294736dfddda7479213e754fd
>
> I'd like to propose to start using it and start writing our tests with it
> since:
> * It's very easy to use. I was able to very simply migrate an existing
> test to it
> * It makes our tests much more readable to read and maintain IMO because
> 1) there's less boilerplate code, 2) it provides default values for mocks
> and 3) no more of ugly expectations syntax
> * It's powerful, just see
> http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html
> * It's actively maintained and developed, see
> http://code.google.com/p/mockito/downloads/list and
> http://code.google.com/p/mockito/source/list and
> http://code.google.com/p/mockito/people/list
>
> After we've written/converted a few tests (let's say in 1 month or so) we
> can really decide if we like it and make it our official mocking tool or if
> we should go back to JMock (but I have little doubts ;)).
>
> WDYT?
>
> Thanks
> -Vincent
>
> _______________________________________________
> devs mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/devs
>
_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs