Docker + Java + Vagrant+ GO.CD

Hello folks. Today, I would like to write about something interesting and close to me at the moment. I’m going to setup with Docker, and I’m going to get a Ruby Lotus app running. Let’s get started. ...

June 6, 2015 · 6 min · hannibal

Example when to use the Strategy Pattern

Hello folks. A quick post about an interesting idea. I want to elaborate on a possibility to use the Strategy Design pattern. ...

February 19, 2014 · 3 min · hannibal

Cucumber-Jvm And @AfterAll

Hey folks. I find out something new about cucumber-jvm every day. If you want something that is executed after all of the tests have finished you must use the Java shutdownHook. It’s simple really you add in a block of code that can run right before the JVM quits. I know I know. It sounds awful but I found out that this is the actual way of doing this with java / cucumber....

April 18, 2013 · 2 min · hannibal

Cucumber Test Name and Tags on Feature

Hello everybody. I would like to show you a gem today that I found out. Apparently there is no easy way to get to the name of an executing cucumber scenario in cucumber-jvm You can try something like that: @After //this is cucumbers @Afters public static void afterExecution(Scenario scenario) { logger.log("The status of the test is: " + scenario.getStatus()); } But that isn’t giving you too much now is it? And the API of scenario is as small as it can get....

April 15, 2013 · 2 min · hannibal

How to eliminate a parameter boom

Hello folks. Today I want to write about a little trick I learned. If you are working with legacy code and you don’t have the chance to eliminate core design problems, you can use this little pattern to help you out. Problem Problem is that you have a class that has a gazillion collaborators and at some point in time one of the clever devs thought it would be a cool idea to do dependancy injection via the constructor....

October 9, 2012 · 3 min · hannibal

TDD and Game of Life

So today at 8-12PM I had a great session with two friends of mine. It was awesome. Like a mini code retreat. We set down in a musky bar, drank wine and beer and cider, and decided to practice some TDD with the well known problem of Conway’s Game of Life. This challenge is really interesting. I never done it before, ever. So it was a really good practice for me....

July 12, 2012 · 3 min · hannibal

Solution to Wrap Kata

My solution to the String Wrap Kata. The goal is to have it wrap a text on a given column width. It is not the best solution but this is my first try. I did it with TDD so there were tests first, which I’m not going to copy in.. public class WrapKata { public String wrap(String input, int columnSize) { if (input.length() <= columnSize) return input; else { return wrapLines(input, columnSize); } } private String wrapLines(String input, int columnSize) { int breakPoint = getBreakPoint(input, columnSize); String head = createHead(input, breakPoint); String tail = createTail(input, breakPoint); return head += "\n" + wrap(tail, columnSize); } private String createTail(String input, int breakPoint) { return input....

June 26, 2012 · 1 min · hannibal

Don’t throw Exception

Hi. Today I want to talk about a common problem in many frameworks I encountered over the course of my carrier as a Java dev / automation engineer, whatnot. Throwing Exceptions. That is in your method you have something like this: public void insertMethodNameHere(String param) throws Exception {} This is bad. And I will tell you in short forms why. Hides exceptions This one should be obvious. When a method throws exception you can never be sure what kind of exceptions it handles....

June 13, 2012 · 4 min · hannibal

JMS Connection setup and Framework

Hello chumps. Today I want to write about jms connection testing with a small framework. I wrote a small thing using a factory object model. It’s a lead, a proof of concept. You can use this to go onward. First, let’s begin with the JMS connection it self. JMS Connection First rule of thumb is: “Don’t wait for a response when dealing with JMS queues.” How so? Because, a JMS queue is asynchronous so you wont get back anything....

March 4, 2012 · 5 min · hannibal


When I see something like this: public class Config { public static final string DATABASELINK = "linkhere"; . . . } It sends a small, but chilling shiver down my spine. Just. don’t. There are a lot of possibilities to use configuration in Java. Java property files. Xml. Xml serialization. CSV file. Whatever suits you best, but this? DON’T!

February 27, 2012 · 1 min · hannibal