testdriven.com Wrangling quality out of chaos

Posts Tagged ‘Mock Objects’

mockito: Java mock objects library

03.04.2008 · Posted in Links

Java mocking is dominated by expect-run-verify libraries like EasyMock or jMock. Mockito offers simpler and more intuitive approach: you ask questions about interactions after execution. Using mockito, you can verify what you want, without expensive setup upfront. Mockito aims to be transparent and let the developer to focus on testing selected behavior.

MockMe: service layer mock for Java mobile applications

10.24.2007 · Posted in Links

MockMe is a simple tool to test Java mobile application’s client code without waiting for the service layer to become available. In complex applications this means not having to wait for data to become available for processing.

MockMe is essentially a configurable servlet based on properties files, which searches for XML files from a local directory according to a parameter passed in with a data access request. It then emulates the future server to facilitate testing. Once you have defined the XML and configured MockMe, both parts can work in parallel.

BeanCooker: mock values generator for Java Beans

10.24.2007 · Posted in Links

BeanCooker is a tool to automatically set mock values to all properties of any java bean.

The simplest usage will put "fooBar" in Strings, 12345 in integers, 123.123 in floats … and the most advanced usage will pull values from a csv file.

– very easy to use, good default settings.
– no external dependency, just JRE 5
– designed to be open and expansible (for example, you can configure it from Spring easily)

Spring Automock: expose mocked beans automatically

09.19.2007 · Posted in Links

Spring AutoMock is a test enabling framework to allow automatic exposure of Mocked beans for a Spring application. Used in conjunction with Spring autowiring of bean dependencies you can develop teired application contexts that represent the architectural tiers of your application, and thus you testing strategy. The simplest example is a separation of service beans and DAO beans into separate xml application contexts so that the services can be fully tested in isolation of the DAOs. The DAO beans are still required by the services typically as an injected property. Spring AutoMock can automatically register a Mock and a proxy of certain beans, so that the Mocks can be injected into your test cases and the matching proxy into the item under test. This reduces the need for repeated Spring test configuration.

JBI Mock Framework: mock testing framework for JBI components

03.14.2007 · Posted in Links

The JBI Mock Framework is a set of classes allowing developers to test JBI components at a unit level, mocking out the Normalized Message Router (NMR). Using the mock classes, developers can achieve high test coverage for their JBI Components. It provides:

– Mock interfaces and Basic implementations for the majority of JBI interfaces
– Mock classes to write unit tests for Binding Components and Service Engines
– Examples showing how to use the Spring Framework and JUnit to create a unit test

svnmock: simulate interaction with a real Subversion repository

10.02.2006 · Posted in Links

svnmock is a Python library designed to ease the pain of testing applications that use Subversion’s Python bindings.

Rather than having your test suite create, populate and destroy actual repositories, svnmock allows you to simulate interaction with a real repository programmatically. In place of messy, complicated invocations of Subversion’s command-line tools, you just tell svnmock what API functions you expect to be called, with what arguments and in what order. If your application deviates from this, svnmock will raise an exception, helping you pinpoint the exact location where your code might be going awry.

svnmock provides emulation support for the entire Python-language API, allowing you to test applications using even the most remote corners of Subversion’s bindings. In addition to normal workflow, svnmock provides facilities for simulating conditions — such as certain error conditions — that would otherwise be difficult or impossible to test against.

JSMock: Mock Objects for JavaScript

08.09.2006 · Posted in Links

JSMock is a fully featured Mock Object library for JavaScript that provides the necessary tools to do effective interactive based testing.

JSMock provides expectation recording and matching, and has the ability to return, throw, and stub on object method calls. The interface is simple and easy to use, which makes testing easy.

POCMock for Microsoft.NET

11.12.2005 · Posted in Links

POCMock is a commercial tool for mocking classes and interfaces for Microsoft .NET. It is based on the virtual machine possibilities of .NET, and matches exactly the specificities of your .NET language whatever they might be. POCMock creates a new module statically, which generates exactly the same module but with some or all the mocked classes.

The standard version is free.

rMock: Java virtual Mock Object framework

10.26.2005 · Posted in Links

rMock 2.0.0 is a Java mock object framework to use with JUnit. rMock has support for a setup-modify-run-verify workflow when writing jUnit tests. It integrates better with IDE refactoring support and allows designing classes and interfaces in a true test-first fashion. rMock has the flexibility and power of jMock, while the recording of mock calls is influenced by EasyMock.

Rhino Mocks: .NET mocking framework

06.22.2005 · Posted in Links

A dynamic mock object framework for the .Net platform. Its purpose is to ease testing by allowing the developer to create mock implementations of custom objects and verify the interactions using unit testing.

Rhino.Mocks is an attempt to create easier way to build and use mock objects and allow better refactoring support from the current tools. It’s a hybrid approach between the pure Record/Replay of EasyMock.Net’s model and NMock’s expectation based model.

OCMock: Mock Objects for Objective-C

05.26.2005 · Posted in Links

OCMock is an Objective-C implementation of mock objects.

This implementation fully utilises the dynamic nature of Objective-C. It creates mock objects on the fly and uses the trampoline pattern so that you can define expectations and stubs using the same syntax that you use to call methods. No strings, no @selector, just simple method invocations.

MockCreator: Java Mock Generator

02.16.2005 · Posted in Links

When tests multiply, they often become too complex to support, since minor changes in code often require to alter a bunch of unit tests. MockCreator’s special features (such as Dummy, Blocks and Accepts) are targeted to writing test code that knows as little as possible about the actual implementation, testing only logic.

MockCreator is in use in large projects, featuring thousands of tests, and it helps users to reduce the pain of test maintenance.

Eclipse plugin available.

Ruby/Mock: mock objects for RubyUnit

09.19.2004 · Posted in Links

Ruby/Mock is a package that makes it easy to implement Mock Objects in RubyUnit test cases. It provides a generic Mock class that can be used to create mock objects for any interface. A test uses closures to define the expectations of a mock object. Tests can also encapsulate protocols into reusable mock-object classes.