Tuesday, February 17, 2015

Java Testing with Spock...introducing #spock #manning #java #book

Well tested code  is a concept that many developers talk about every day, lots of great authors write books and articles around it, several tools are being developed that aim to help developers to do it faster and efficiently.

Despite all the above, testing is something like a lost art, many development teams ignore it, do not do it at all, or it is considered as a waste of time!!! Look no further, poorly tested code (and systems) is one of the major reason that many of our software projects and code fail now-days. 

There are a few people that I have worked with all these years, that stick to their principles regarding quality in the code, testing and continuous refactoring. One of them is Kostis Kapelonis, who I had the pleasure to work with a couple of years ago under the same corporate roof, and is actively involved in our small Java community here in Athens.

 If the name sounds familiar, then most probably you might have attended one of his many presentations during our local Java User Group here in Athens or red some of his articles in InfoQ. A couple of weeks ago, Kostis sent  an email asking for help on reviewing his first draft chapters on an upcoming book, around Spock, another cool and interesting tool, that aims to take it's place (hopefully) in our every day testing tool set as Java developers.

Despite the fact that I still have not used Spock in my day job (projects), reading these  drafts chapters helped me discover a new tool with similar concepts comparing to tools I am already familiar with  eg Mockito, Jmock + a yet another reason to study Groovy. I always enjoyed Kostis's presentations and I find his writing simple and clear.

So if you love well tested code, if you love Groovy or you feel that your current testing tool set does not cut it towards your needs, have a look on Java Testing with Spock which currently has just entered the MEAP 'phase' in Manning. Maybe Spock is something you should review and assess, so why not let an expert guide you through the process!

: ) 


I am very very happy and proud that the list with Greek book authors (especially Java freaks, is getting bigger), my other fav one is Patroklos. I hope one day to join them as well!

Sunday, February 01, 2015

How to install 3 popular NoSQL databases for development in MacOSX for newbies Part 3 (CouchBase ) #nosql #couchbase

In this post we are going to install CouchBase, a NoSQL database that has gained a lot of momentum latetly. CouchBase is very very developer friendly in terms of setting up and getting started time. Actually is the simplest. It offers a single download for many platforms (including MacOSX). You can find them here.

It is dead simple, as already described in the instructions. Just download, unzip and move the CouchBaseServer.app to your Applications folder or anywhere else you like. Done!

In order to start the server just double click on the .app, and a small icon will be loaded on your top right corner of the menu.

 The server will start and by pressing the Open Admin Console link, you will be redirected to a web page with the Server's Admin console (

That's it, the admin console, offers you similar functionality to a GUI client, so you can review and manipulate your buckets, views etc!

Easy! So easy that you must try it!!! : )

How to install 3 popular NoSQL databases for development in MacOSX for newbies Part 2 (Cassandra ) #nosql #cassandra #datastax

In this post we will install on our local MacOSX (Yosemite) environment, another famous NoSQL database, the Apache Cassandra. As a developer, I found Datastax, community packaging of Cassandra, very handy, seems they offer ready made MacOSX specific packages. 

You can of course download and install the the tarballs from Apache or use their virtual box images,  offered in the site.

We will be downloading Datastax Community Cassandra edition from here. The current version is 2.1.2, after downloading the tar.gz file, I will be extracting it, to a folder similar to the previous post of MongoDB. So my cassandra installation will be  under


Eventually that is all about (I assume you already have Java/JDK installed on your MacOSX). If not please check this post.

Your Cassandra folder should like the image below:

In order to start your test Cassandra cluster and nodes, just type the following

> cd \home\work\dsc-cassandra-2.2.1\bin\(or whatever is your path)

> ./cassandra -f 

The -f switch will start the process in the foreground, so it would be easier for starters to shutdown the process by pressing Ctrl +C .

 If you omit the -f, the process will start by default in the background and in order to stop you need to use the kill command and search for the process. More info here.

Well this is it, easy enough. When your cluster starts you should see something like the image below in your command line window.

What about a gui client for starters?

Well, Datastax offers a very handy client called DevCenter. 
Download the MacOSX, tar.gz, and extract it to a folder similar to the one, we extracted cassandra.


Double click on the DevCenter.app . It is actually a tool based on Eclipse. Create a new connection as shown in the image below.

You can play around and create a DEMO keyspace as shown below.

You can find  a very simple intro post here.