Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Mockito as mocking library?
Mockito as mocking library? [message #1046662] Mon, 22 April 2013 07:47 Go to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1243
Registered: October 2011
Senior Member
Some committers in the Eclipse Scout team have started to investigate Mockito as mocking library. Currently EasyMock is used (version "[2.4.0,3.0.0)").

Some questions/notes:
1) Latest version is 1.9.5. On Orbit: 1.8.4. Should we open a bug for an update?
2) Can we start using Mockito with Kepler or is this too late for introducing a new library?
3) I thing that we should not use 2 different libraries (it is possible, it can be a good transition solution, but the goal should be to use only one).

More information about Mokito on the EclipseSource blog:
=> Effective Mockito Part 1

Re: Mockito as mocking library? [message #1061138 is a reply to message #1046662] Thu, 30 May 2013 08:10 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1243
Registered: October 2011
Senior Member
I have created Bug 409461
Re: Mockito as mocking library? [message #1112130 is a reply to message #1061138] Thu, 19 September 2013 06:47 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1243
Registered: October 2011
Senior Member
I was asked per email why we want to migrate. Here is my opinion on the situation:

We need a new Mocking Framework, to be able to mock Objects.
=> This is something the Scout Commiter wants to do in there Test. I got a question about it from Adrian Moser.

Possible solution:

* Upgrade to EasyMock 3.x
* Change to Mockito

Both libs are not yet on Orbit.
(For Mockito, the version 1.8.4 in Orbit seems not to work with Tycho. See comment 1 in the bug).

To try the change, I have migrated the CellTest from EasyMock to Mockito. The effort to migrate a test is not big (the libraries are similar). The big effort is to get everything working in our CBI build.

I my opinion, the trend in the Eclipse Community is to use Mockito. The API of Mockito is more modern, simpler to learn and to use.

At the end I do not care what the final choice is (EasyMock 3.x vs Mockito).
Re: Mockito as mocking library? [message #1388428 is a reply to message #1112130] Thu, 26 June 2014 12:38 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1243
Registered: October 2011
Senior Member
Good news.

Thanks to Judith Gull, with Luna it is possible to write unit-test using Mockito.
EasyMock will probably be removed with the Eclipse Scout Mars release.
Re: Mockito as mocking library? [message #1751102 is a reply to message #1046662] Wed, 04 January 2017 13:31 Go to previous messageGo to next message
Rene Scheibe is currently offline Rene ScheibeFriend
Messages: 1
Registered: January 2017
Junior Member
Some time has passed and there is already Mockito 1.10.19 and 2.5.3 but Orbit just provides 1.9.5.

As I am quite new to dependency management in Eclipse the question is how to get the newest Mockito version for testing? How are Bundles updated in Orbit?
Re: Mockito as mocking library? [message #1751134 is a reply to message #1751102] Wed, 04 January 2017 19:22 Go to previous message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1243
Registered: October 2011
Senior Member
Last time I checked, there was a problem with the conversion of Mockito into an OSGi Bundle. I recommend you to follow/participate in the discussion here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=403676

With the Neon version, the Scout Project has moved away from OSGi and is no longer interested in dependencies hosted by the Eclipse Orbit project. We get our dependencies directly from Maven Central and we do not need them to be OSGi Bundles. Of course the IP (intellectual property) is still controled by the Eclipse Fundation.

In our master pom we depend from Version 1.10.19 see artifactIds pom "org.eclipse.scout.rt.platform.test" and "org.eclipse.scout.rt"
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>1.10.19</version>
      </dependency>


Previous Topic:scout sources checkout - problem with RWT.HYPERLINK
Next Topic:howto add a new button to toolbar
Goto Forum:
  


Current Time: Tue Aug 22 07:27:28 GMT 2017

Powered by FUDForum. Page generated in 0.03076 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software