Stop sleeping, start awaiting

On Devoxx there was a quicky session named ‘Stop sleeping, start awaiting’

The speaker presented Awaitility. A test-framework for helping you out waiting on objects. Mainly usable for testing asynchronous code in unit testing. A unit test does not wait for code to be executed, developers tend to use Object.sleep(xxx) but this will not always work. On some systems the xxx needs more milliseconds then on others. In the end you’ll be waiting ( rather sleeping) while all the tests that have sleep() run. The whole testsuite will go very slow.

Awaitility is a framework to help you wait for code to be executed,
It goes like:

await().untilCall(wrappedCallMethod).statusOf(xxx).is(OKAY);

It’s like a mocking framework. Personally I do the same with mockito and java.util.concurrency waiting and locking classes. But perhaps Awaitility will make you create the tests faster.

This is certainly one framework I will try out!

JRebel time-savings

I’ve been using JRebel for little more then a month now on the yellow pages project. It think it’s safe to say it saves me about a day of waiting for deployments in a 30 day time frame.
UPDATE: I forgot to mention, on those 30 days I worked only 12 days. I think JRebel stats don’t take that into account so it’s more like 2 days in 30.

In the previous post I wrote that the actual time savings is probably a bit less because you can do other stuff. But during Devoxx Joachim claimed ‘you safe more then JRebel shows you’. And you know what, he’s right.

What happens without JRebel?

You deploy, restart server. During waiting time you check email or twitter or stare outside thinking … (fill in what you do). This means you get distracted from your ‘coding flow’. You get distracted more often then every 25 minutes.

What happens when JRebel is active?

You don’t deploy, JRebel does that for you when hitting a page that has changed Java code behind it. This means you don’t start reading email or twitter or … Hence you don’t get distracted and can stay in your ‘coding flow’. You don’t have to refresh your memory every time you turn back towards your IDE to pick up where you left before deploying and reading email or …. Consequence: you can keep writing code and don’t get distracted, most likely resulting in better code.

Devoxx 2011

This year I choose to visit the Conference only. I’ve skipped the University as there were to many equal subjects with the conference. At the university you get a real in depth view on subjects but at the conference there are more different talks which triggers me to do more research myself.

This years Devoxx was less of an information overload then previous editions. Although there were many interesting subjects, I found myself wandering around in the hallway and the sponsors hall a lot.  But no worries, I had my portion of fun and chatter in the sponsors hall. It’s only normal I wandered around the iText booth once every 2 hours as I’ve worked for them for 9 months. It was nice to see the XMLWorker demo in action as an iText power demo and to meet the newly hired internal developers of iText.

I also got to meet the faces behind JRebel. ( Speaking of that, I need to give an update on how much time it saved me since install )

Another opportunity I took, was having a chat with the guys from Terracotta (ehcache) and the jsr107 spec lead Greg Luck. More details about jsr107 in a later blog post.

In the upper hallway I finally got the time to catch up stories with Joachim.

And last but not least, thank you Oracle for the lucky draw in the contest, 3 books to read during commuting time!

Oh forgot some WiFi  ranting: the WiFi sucked! Although there was a gigabit line and a supposedly available 9000 connections, I had a hard time getting connected with the netbook. That’s why I haven’t written any #DevoxxBlog yet. The Devoxx WiFi also triggered my HTC Wildfire to reboot once every 2 hours or so.

Enough ranting now. Overall I had fun at Devoxx and picked up some new ideas and tools to check out. I’ll post them later this week or month when I find the time.

Thank you Stephan!