Thomas Sundberg

September 13, 2015

Conference do’s and don’ts

Filed under: Public speaking — Tags: , , , — Thomas Sundberg @ 12:41

I have done some conference presentations the last few years. It is interesting to compare conferences in retrospective. It is possible to notice some common mistakes as well as some really good things. It is, unfortunately, often easier to criticize instead of attributing good things.

Most conferences I attend have very engaged organizers. They don’t just do a job; they are passionate about it at the same time. It is great to be able to contribute in such environments!

Then there are some who just does a job and it is obvious that there is a difference.


September 10, 2015

Increase the available disk on a CentOS host maintained by Vagrant and VirtualBox

Filed under: Linux — Tags: , , , , — Thomas Sundberg @ 22:36

Virtual servers are fantastic when you need to test something and want to make sure that you have a well know environment. A virtual server has no value. You can create it over and over again and it will only cost you some time to start and stop.

VirtualBox and Vagrant is a really easy combination to get started with. However, it may turn ut that the base box you use need to be enhanced. I will show you how you can increase the disk space available on the virtual host. Unfortunately, it isn’t as easy as one could hope for. But it is possible and I will show you how. When the disk has been increased, I will repackage the virtual host so it can be reused easily.


YUM Cheat sheet

Filed under: Automation, Linux — Tags: , , , , — Thomas Sundberg @ 21:50

Remembering the syntax for yum is something I seem to have problems with. To simplify my own life, and possible yours, here is a list of some commands I find useful. Some of them should be executed as root.


RPM Cheat sheet

Filed under: Automation, Linux — Tags: , , , , — Thomas Sundberg @ 21:42

It turns out that I always have to search for the syntax when working with RPMs. To simplify my own life, and possible yours, here is a list of some commands I find useful. Some of them should be executed as root.


August 21, 2015

Packaging a zip file from Java using Apache Commons compress

Filed under: Gradle, Java, Programming — Tags: , , — Thomas Sundberg @ 16:10

How do you create a zip file with Java? One option is to use Apache Commons Compress.

This example shows you how.


July 17, 2015

Tell, don’t ask

Filed under: Programming — Tags: , , , , — Thomas Sundberg @ 17:02

Objects that expose wrong information are complicated to work with. They force you to dig for the information you really need. It is easy to create a model where the users are expected to know a lot about the domain and therefore force them to dig deep into an object structure to get the information they currently need. This can be avoided if you strive for telling objects what to do and only ask them occasionally.


June 19, 2015

Include header and footer in a Mustache template

A template for creating web pages is great if you want to integrate front- and backend easy. I have been using Mustache for a while and I’m quite satisfied. It works great with both Dropwizard and Spark

The documentation says how to include a snippet from another template. But searching for it was not that easy.


April 29, 2015

Separating acceptance tests

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.


April 28, 2015

Stubbing a var arg method using Mockito

Filed under: Gradle, Java, Mockito, Programming, TDD — Tags: , , , , , , , — Thomas Sundberg @ 23:28

I had a need to stub a method the other day that had a var arg method. I failed in stubbing it using Mockito. It disturb me a lot. But after mulling on the problem a while, I searched and found a simple solution.

Mockito has a anyVararg() method that you should use when you try to stub a method that takes a var arg as argument.


March 22, 2015

A Gradle plugin written in Java

Filed under: Automation, Gradle, Java, Tools — Tags: , , , , — Thomas Sundberg @ 15:28

Gradle is a build automation system. You write your build script in Groovy. This is different compared to other build system such as Ant or Maven. They both use xml. Using Groovy instead of xml gives you a lot of benefits. You have an entire programming language at your disposal. This mean that you can easily customize the build behaviour.

If you, however, want to be able to do the same thing in many projects, it may be a good idea to write a plugin that you can refer to from other projects. I will show you, step by step, how to implement a Hello World Gradle plugin.


Older Posts »

The Silver is the New Black Theme. Create a free website or blog at


Get every new post delivered to your Inbox.

Join 73 other followers