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 [...]
Classloader Deep-Cloning without Serialization
December 23rd, 2009 by Johan Haleby — Java, Testing
Tags: classloader, deep-cloning, frameworks, junit, manipulate, open source, powermock, serialization, tools
PowerMock + TestNG = True
December 14th, 2009 by Johan Haleby — Java, Testing
After having it on our todo list for at least a year we’ve finally managed to integrate PowerMock with TestNG 5.11 as of PowerMock version 1.3.5. This is a big milestone of the project since we’ve now demonstrated that PowerMock is decoupled from both a specific test framework and a specific mock framework. The TestNG [...]
Tags: frameworks, open source, powermock, testng
Untestable code with Mockito and PowerMock
October 28th, 2009 by Johan Haleby — Testing
With the new release of PowerMock 1.3 we’ve focused a lot on getting the Mockito support up to par with the EasyMock support allowing mocking of e.g. final classes, static methods and new object construction using a Mockito-like syntax. Below you’ll find some examples of how to use the Mockito extension API, aka PowerMockito. Hopefully [...]
Getting Android SDK working on Ubuntu 64
October 21st, 2009 by Johan Haleby — Android
Today I was trying to setup the Android SDK (version 1.6_r1) on the 64 bit version of Ubuntu 9.04 (Jaunty Jackalope). After having installed the ADT Eclipse plugin and pointed out the Android SDK directory in the settings I immediately ran into the following error:
Failed to get the adb version: Cannot run program [...]
Tags: linux, open source, tools, ubuntu
Mocking static methods in Java system classes
May 17th, 2009 by Johan Haleby — Java, Testing
As you may already know PowerMock can be used to easily mock static methods which is normally not possible with standard mock frameworks such as EasyMock, JMock or Mockito. All you have to do is to use mockStatic in one of the PowerMock extension API’s as well as telling PowerMock to enable the class for [...]
Tags: frameworks, open source, powermock, tdd, tools
PowerMock Part 2
May 1st, 2009 by Johan Haleby — Java, Testing
In JayView 17 we presented a short introduction to PowerMock, a framework that allows you to create automated tests for almost any code in isolation from its environment. In this article we’ll dig a bit deeper into PowerMock and explore the goals and more of its feature set.
Background
PowerMock is intended for developers who want [...]
Tags: automated testing, frameworks, open source, powermock
What’s new in PowerMock 1.1
December 15th, 2008 by Johan Haleby — Java, Testing
We’re proud to announce that PowerMock 1.1 was released a couple of days ago and it has many new interesting features.
Framework independence
First of all the internal structure of the project has undergone major changes. PowerMock core is no longer coupled to EasyMock which means that PowerMock can now be used as a foundation for [...]
Tags: commons-logging, easymock, frameworks, jmock, log4j, mockito, open source, powermock, slf4j, testng
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
