Mock « Test « Java Articles

Home
Java Articles
1.Build Deploy
2.Class
3.Core Library
4.Data Types
5.Database JDBC
6.Design
7.Development
8.File Input Output
9.Graphics Desktop
10.J2EE Enterprise
11.J2ME Wireless
12.JVM
13.Language
14.Library Product
15.Network
16.Security
17.SOA Web Services
18.Test
19.Web Development
20.XML
Java Articles » Test » Mock 

1. Getting Started with EasyMock2    today.java.net

Writing mock objects on your own can be tedious, but there are a lot of mock frameworks out there to help you with this task. EasyMock is a library for creating mocks for interfaces on the fly using the dynamic proxy API. It's been around for a couple of years now, and besides being very stable and robust, another advantage is that it is well known. So here comes EasyMock2, ready to rock--er, mock--the world. My first idea was to introduce only the new features of version 2, but I recognized that there are still a lot of people out there not using EasyMock at all. So I'm going to show what you can do with EasyMock using the new version 2.2 API.

2. Unit Test More Efficiently with Mock Object Alternatives    devx.com

Testing Strategies, Mocks, and Stubs In interaction-based unit testing, tests typically pass mock objects into methods so that the mock objects can verify the implementation of the code that is being tested. Mocks are fake objects that record the manner upon which they are operated and can verify whether they were operated on properly.

3. jMock - A Lightweight Mock Object Library for Java    jmock.codehaus.org

JMock 2.5.1 has been released. This is a bug-fix release that improves test failure diagnostics. The full changelist is in JIRA.

4. Unit testing with mock objects    ibm.com

When you're dealing with simple data or service objects, writing unit tests is straightforward. However, many objects rely on other objects or layers of infrastructure. When it comes to testing these objects, it is often expensive, impractical, or inefficient to instantiate these collaborators.

5. Test flexibly with AspectJ and mock objects    ibm.com

Mock objects can help to solve this dilemma. Mock object tests replace domain dependencies with mock implementations used only for testing. This strategy does, however, present a technical challenge in certain situations, such as unit testing on remote systems. AspectJ, an aspect-oriented extension to the Java language, can take unit testing the rest of the way by allowing us to substitute test-only behavior in areas where traditional object-oriented techniques would fail.

6. Mock Objects in Unit Tests    onjava.com

The use of mock objects is a widely employed unit testing strategy. It shields external and unnecessary factors from testing and helps developers focus on a specific function to be tested.

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.