Clean Integration Testing with JUnit Rules

On September 28, 2015, Posted by , In JUnit, By ,,,, , With Comments Off on Clean Integration Testing with JUnit Rules

The benefits of JUnit Rules, especially when dealing with integration testing, can hardly be overrated. In this post, we’ll shine a light on the usefulness of ExternalResource extensions. These simplify fixture control in cases where we have to work with external-resource-abstracting third-party libraries. As an example, we’ll have a look…

Getting Java Event Notification Right

On March 11, 2015, Posted by , In Common,Spotlight, By ,, , With 6 Comments

Implementing the observer pattern to provide Java event notification seems to be a straight forward thing to do. However, there are some pitfalls one easily can run into. Here comes an explanation of common mistakes I carelessly have produced myself on various occasions… Java Event Notification Let’s start with a…

How to Map Distinct Value Types Using Java Generics

On March 4, 2015, Posted by , In Common,Spotlight, By ,, , With 6 Comments

Occasionally the average developer runs into a situation where he has to map values of arbitrary types within a particular container. However, the Java collection API provides container related parameterization only. Which limits the type safe usage of HashMap for example to a single value type. But what if you…

Lightweight Integration Tests for Eclipse Extensions

On November 3, 2014, Posted by , In Eclipse,JUnit, By ,,,, , With Comments Off on Lightweight Integration Tests for Eclipse Extensions

Recently I introduced a little helper for Eclipse extension point evaluation. The auxiliary strives to reduce boilerplate code for common programming steps, while increasing development guidance and readability at the same time. This post is the promised follow-up that shows how to combine the utility with an AssertJ custom assert…

Clean Unit Test Patterns – Presentation Slides

On October 27, 2014, Posted by , In JUnit, By ,, , With Comments Off on Clean Unit Test Patterns – Presentation Slides

I was given the opportunity to talk at the GDG DevFestKarlsruhe 2014 conference about ‘Clean Unit Test Patterns’. Thanks to the organizers for inviting me and thanks to all people listening to my talk. As promised I shared the presentation e.g. for those who want to have a look at…

Eclipse Extension Point Evaluation Made Easy

On October 13, 2014, Posted by , In Eclipse, By ,, , With 2 Comments

Coding Eclipse Extension Point evaluations comes in a bit verbose and sparsely self-explaining. As I got round to busy myself with this topic recently, I wrote a little helper with the intent to reduce boilerplate code for common programming steps, while increasing development guidance and readability at the same time….

Clean JUnit Throwable-Tests with Java 8 Lambdas

On July 28, 2014, Posted by , In JUnit, By ,,,, , With 7 Comments

Recently I was involved in a short online discussion on twitter and google+ which concerned the question why the arrival of Java 8 Lambda expressions makes the catch-exception library1 obsolete. This was triggered by a brief announcement that the library won’t be longer maintained as lambdas will make it redundant….

Java Code Style: The Final Decision

On April 28, 2014, Posted by , In Common, By ,,,, , With 6 Comments

Isn’t it funny how the alleged most unremarkable things can lead to controversial discussions or sometimes even heated debates with hardened fronts? I witnessed on several occasions, for example, how the usage of the Java final keyword triggered quite passionate arguments. And for an outside observer this might have looked…

Clean Synchronization Using ReentrantLock and Lambdas

Recently I was reading an informative post about the differences between synchronized vs ReentrantLock by Javin Paul1. He emphasises on the advantages of the latter, but does not withhold some downsides, which are related to the cumbersome try-finally block needed for proper usage. While agreeing with his statements I brooded…

Slim Down SWT FormLayout Usage

On March 31, 2014, Posted by , In Eclipse, By ,,,, , With 2 Comments

Always on the quest for efficiency I reconsidered the usability of SWT FormLayout lately. Although it is one of my favored core layouts with respect to flexibility, I had to recognize that it is only reluctantly used by most of my fellow workers. Proposing it for an appropriate task sometimes…

Getting JUnit Test Names Right

Finding good names is one of the challenges of crafting software. And you need to find them all the time and for everything – classes, methods, variables, just to name a few. But what makes a name a good name? To quote Uncle Bob: ‘Three things: Readability, readability, and readability!’…

Clean SWT Listener Notifcations with SWTEventHelper

On March 10, 2014, Posted by , In Eclipse, By ,,,,,, , With 2 Comments

Writing tests for SWT based UIs often requires to notify widget listeners programmatically. Unfortunately, the code to create, initialize and finally to trigger the event is a bit verbose and distracts from the actual purpose of the test. After writing similar initialization routines a couple of times I came up…

More Units with MoreUnit

Just over a year ago I wrote a post about working with JUnit in Eclipse. One of the commenters recommended MoreUnit in order to increase testing efficiency even more. Giving it a try I was delighted and the plugin’s keyboard shortcuts were immediately memorized by my autonomic nervous system… Additionally,…