Common

Running JUnit Tests Repeatedly Without Loops

Recently I came across a problem where I had to write tests for a method that calculates randomly distributed values within a certain range of possibilities 1. More precisely if you assume a signature that looks like interface RandomRangeValueCalculator { long calculateRangeValue( long center, long radius ); } a test might verify the following2: public [...]

Posted in Common | 4 Comments »

WordPress Webhooked into GitHub

Code Affine is published using WordPress. Besides content provisioning there are technical tasks like site composition and software maintenance we have to take care of. Hence we were looking for a pragmatic but efficient way that allows us to develop locally, do versioning of changes, publish such changes automatically and last but not least run [...]

Posted in Common | No Comments »

A Simple way to extend SWTBot

SWTBot is an Eclipse project that enables you to write functional tests for SWT and Workbench based applications in Java. It has API to remote control the application under test and matcher to find widgets and examine their state. For each widget there is a corresponding bot class with methods to control the widget. To [...]

Posted in Common, Eclipse | No Comments »

JUnit Rules

The first time I stumbled over a JUnit @Rule annotation I was a bit irritated of the concept. Having a public field in a test case seemed somewhat odd and so I was reluctant to use it regularly. But after a while I got used to that and it turned out that rules can ease [...]

Posted in Common | 3 Comments »

Running HTTP/REST Integration Tests efficiently in Eclipse

Lately I had a chance to use the OSGi-JAX-RS-Connector library written by my dear fellow Holger Staudacher. The connector enables you to publish resources easily by registering @Path annotated types as OSGi services – which actually works quite nicely. While it is natural for me to write the service classes test driven using plain JUnit [...]

Posted in Common, Eclipse | 8 Comments »

How do you test equals and hashCode?

Just recently I had to implement equals() and hashCode() for several classes. With the aid of your favourite IDE, generating these methods is a matter of seconds. Well, if there weren’t the missing tests. As I tend to be obsessive when it comes to tests, I also want to have tests for equals() and hashCode(). [...]

Posted in Common | 7 Comments »

Eclipse Archive Utilities

A little while ago I started a side project to support working with (zip) archive files in the Eclipse IDE. Initially it was more meant to revive my plug-in development knowledge and play around with some technologies like Tycho or SWTBot. But in the end, I though it might be useful enough to share. The [...]

Posted in Common, Eclipse | 2 Comments »

Performance Analysis of REST/HTTP Services with JMeter and Yourkit

My last post described how to accomplish stress- or load-testing of asynchronous REST/HTTP services with JMeter. However, running such tests often reveals that the system under test does not deal well with increasing load. The question is now how to find the bottleneck? Having an in-depth look at the code to detect suspicious parts could [...]

Posted in Common | 6 Comments »

Code Centric Trainings with the Samples Manager

I recently gave a training course on – you guess it – RAP/RWT. And as it seems natural for a training targeted at developers it was very code centric and had many hands-on exercises. For hands-on exercises I find it useful to give a starting point so that tedious steps like setting up a project [...]

Posted in Common, Eclipse | 2 Comments »

Stress/Load-Testing of Asynchronous HTTP/REST Services with JMeter

Although I have been using JMeter for stress- and load-testing of web applications a good few times it took us a while to figure out how to test asynchronous HTTP/REST based services with the tool. With us I mean a fellow programmer – Holger Staudacher, I have the honor to work with currently on a [...]

Posted in Common | 16 Comments »