Infinitest

Anders Eriksson

The Infinitest Eclipse plug-in looks for unit tests and have them run as soon as changes are detected. Just as modern IDEs have provided automatic compilation for ages this can now also be provided for unit testing. The test outcome shows up as a green or red bar in the bottom of the Eclipse application [...]

Tags: , ,

PowerMock for Integration Testing

Johan Haleby

A while ago I blogged about how to use the PowerMock Rule to bootstrap PowerMock without using a JUnit runner. A problem that you’ll likely run into sooner or later when using this approach in an integration test is the need to ignore certain classes or packages from being loaded by the PowerMock classloader using [...]

Tags: , , ,

The easy way to test Android applications

Renas Reda

I’m going to guess that most of you know what instrumentation is. In the event that you don’t, instrumentation is a feature in which specific monitoring of the interactions between an application and the system is made possible. Instrumentation also makes it possible to write test cases that interact with the application. The problem with [...]

Tags: , , , ,

Classloader Deep-Cloning without Serialization

Johan Haleby

Background In PowerMock we’re using a custom classloader to byte-code manipulate classes that are normally not mockable to make them mockable. But when running a test case there may be some cases when the user needs to byte-code manipulate a certain class (X) in the first test method but needs to have the class unmodified [...]

Tags: , , , , , , , ,

Getting started with JavaME jUnit testing

Mattias Severson

Introduction Unit testing is a very powerful tool that should be included in every developer’s toolbox. Unfortunately, this has not always been the case, especially not among MIDlet developers. One reason is that JavaME projects usually are small (compared to Java SE projects), which implies that manual testing could be enough. However, as soon as [...]

Tags: , , ,

How to mock MIDP RecordStore

Mattias Severson

The challenge PowerMock is a mocking framework that claims to have almost supernatural powers. According to its documentation it is able to mock both static and private methods, final classes, and other nasty things that would be insurmountable obstacles for other mock frameworks. As a result, it has been stated that it should be able [...]

Tags: , , ,

Mocking Eclipse IResource.accept()

Tobias Södergren

I had a junit test situation where I wanted to mock an Eclipse IResource instance but still be able to test a call-back implementation given as parameter to the mocked IResource.accept(IResourceVisitor visit) method. By default, mocking an interface gives you “call count” and expected return values but no code is executed. In order to test the implementation of IResourceVisitor, something more had to be done. Here is how I did it.

Tags: , , ,

PowerMock 1.0 released

Jan Kronquist

We have released 1.0 of PowerMock just in time for the Øredev conference! PowerMock is an open source mock framework based on EasyMock that allow you to mock static methods, private methods and even constructors. Our intent is mainly to allow unit testing of legacy code and people really seemed to appreciate this idea at the conference.

Tags: , , , , ,

PowerMock 0.8 released

Johan Haleby

Previously a colleague of mine described an idea for mocking static methods. Earlier this year we started an open source project to implement these ideas in a very simple to use form. The idea is that it will just be a normal jar file that extends EasyMock and JUnit. Instead of using AspectJ we have [...]

Tags: , , , , ,

Testing Among the Clouds, Part 2

Mattias Hellborg Arthursson

In a recent post I wrote about the particular problems we’ve been having with integration testing the Spring LDAP project and the use we’ve made of Amazon EC2 for solving these problems. In this post I’ll present the implementation details. Prerequisites In order to keep this reasonably brief I’ll have to refer to the getting [...]

Tags: , , , , , ,

Testing Among the Clouds

Mattias Hellborg Arthursson

One of the major challenges we’ve been facing in the Spring LDAP project is to make certain that the library works together with different LDAP servers. Different servers behave differently in certain situations; some functionality might only be supported on select servers, etc. In the ideal situation we would run our automated test suite against [...]

Tags: , , , , , , ,