Blog

Articles in category Tools

Zero-downtime deployment with HAProxy as load balancer

2017-03-29 · Automation Continuous deployment Linux Tools · Thomas Sundberg

I want to deploy new versions of an application with no downtime. It turns out to be a bit tricky. Here is one solution that sort of works.

Read more →

Gatling - a tool for load testing

2016-08-04 · Load testing Scala Test automation Tools · Thomas Sundberg

The documentation for Gatling tells us that "Gatling is an open-source load testing framework based on Scala, Akka and Netty". I have heard good things about it but never tried it.

The technical parts, Scala, Akka and Netty, were less interesting from my perspective. The interesting part was its developer-friendly DSL, Domain Specific Language. I have used tools like JMeter and I have never been impressed by their user interfaces. They are too complicated. As a developer, I like when I can specify my load script using my regular tooling. That is, an editor, a build tool and a command line.

Read more →

Separating acceptance tests

2015-04-29 · Gradle Java Programming Test automation Tools · Thomas Sundberg

It is very convenient to run the unit tests separated from other, slower, tests. There are different ways to do this. One way is to have a separate module for the acceptance tests.

Separating the modules is acceptable in some cases. It is not acceptable in others. There is a simple way to separate the source code for the acceptance tests while keeping the it in the same project if you use Gradle. Separate the tests with different source sets.

Separation on source sets means that you will keep all the acceptance tests in another directory structure than the unit tests. If you use the usual separation of production code and test code, then all you want to do is to add a new source set that contains the acceptance tests.

Read more →

Removing the auto generated class header in IntelliJ IDEA

2014-10-24 · Tools · Thomas Sundberg

My weapon of choice when it comes to editors is without question IntelliJ IDEA. It is great and behaves as I want and usually expects. It has, however, one feature that I find annoying and that I always remove.

IDEA will automatically insert a header with my user name and the date when I created a new class. I use version control so this information is never important. Adding a user name implies code ownership. Code ownership is against one principle I think is very important, collective code ownership. It is a core principle in XP with the goal to make sure that every developer feels that it is ok to work on all code in a project.

The header IDEA inserts used to include where to find it so you easily could find and modify it. Today, when I set up a new environment at a new customer, I noticed that the template had changed. It didn't tell me where to find the template. It looked like below:

/**
* Created by ${USER} on ${DATE}.
*/

Read more →

Adding a JUnit test template in IntelliJ IDEA

2012-06-01 · Java Tools · Thomas Sundberg

A test template for JUnit tests doesn't exist out of the box for IntelliJ IDEA. Creating one is not complicated.

The goal is to create a simple template that will assist you when you need to write a test in JUnit. I want it to look something like this:

Read more →

Do not return null

2011-07-28 · Tools · Thomas Sundberg

Using your IDE to automatically create methods for you maybe a disaster waiting to happen.

Read more →