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 [...]
The easy way to test Android applications
January 28th, 2010 by Renas Reda — Android, Testing
Tags: automated testing, frameworks, junit, open source, tools
Classloader Deep-Cloning without Serialization
December 23rd, 2009 by Johan Haleby — Java, Testing
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 in [...]
Tags: classloader, deep-cloning, frameworks, junit, manipulate, open source, powermock, serialization, tools
Getting started with JavaME jUnit testing
March 22nd, 2009 by Mattias Severson — Embedded, Java, Testing
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 you [...]
Tags: java me, junit, mock, powermock
How to mock MIDP RecordStore
March 22nd, 2009 by Mattias Severson — Embedded, Java, Testing
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 to [...]
Tags: java me, junit, mock, powermock
Mocking Eclipse IResource.accept()
January 15th, 2009 by Tobias Södergren — Java, Testing, Tips & Tricks
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: eclipse, junit, mock, programming
PowerMock 1.0 released
November 21st, 2008 by Jan Kronquist — Java, Testing
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: easymock, junit, mock, open source, oredev, powermock
PowerMock 0.8 released
October 27th, 2008 by Johan Haleby — Java, Testing
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: easymock, frameworks, junit, mock, open source, powermock
Testing Among the Clouds, Part 2
October 20th, 2008 by Mattias Hellborg Arthursson — Cloud, Java, Testing
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 started guide [...]
Tags: automated testing, ec2, junit, spring, spring ldap, tdd, typica
Testing Among the Clouds
September 11th, 2008 by Mattias Hellborg Arthursson — Cloud, Java, Testing
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: automated testing, continuous integration, ec2, junit, spring, spring ldap, tdd, typica
