Flings
Apps and tools built by our engineers that are intended to be played with and explored.

Lmock

Lmock

Summary

Lmock is another mocking framework for Java, initially targeting Google’s Android OS, but actually works on any environment.

Details on what a mocking framework is for can be found on the wikipedia article: http://en.wikipedia.org/wiki/Mock_object

Although many frameworks are already available, none of them seems to give satisfying results to Android developers. They are either difficult to integrate or not usable at all.

Lmock was thought as a multi-platform mocking system, working from common Java environments (JRE 5/6 + JUnit 3/4) to Android. Lmock integrates a simple programming model to test multi-threaded applications.

Features

Lmock integrates the common features of mocking systems:

  • Possibility to create stubs on specific methods
  • Possibility to specify expectations so that the test checks if an invocation actually happens

Lmock comes up with two possible syntaxes:

  • “JMock” style: explicitly declare the different resources contributing to the test
  • “Mockito” style: uses spies in the code, in order to create expectations and stubs on the fly

Read the full documentation

System Requirements

Java (1.6 or 1.7) or Android SDK to develop JUnit tests.

Instructions

Lmock is delivered as a JAR file, and so should be integrate in the projects like any other jar.

Read the full documentation.

Video

Change Log

Engineers

David Furodet

Works in the Mobile group.

Add Comment

2 thoughts on “Lmock

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>