Using Cucumber in Java unit testing

While working in Ruby at my previous workplace we were required to write unit tests using RSpec and end-to-end tests using Cucumber and Watir webdriver. I wasn't a big fan nor am I today of writing tests, but for some reason I just loved Cucumber. We wrote them together with the members of the QA and it was fun, because we both were thinking about all the possible cases to test and not about the way the tests were going to be implemented. Furthermore, it was clear for everybody what I wanted to test, as the scenarios were written in…

Read this article »

Why I don't write comments anymore

I remember when I was 16 and I started writing my first web application (actually just a simple PHP page that processed some inputs from a form) in PHP. I didn't really know PHP at all, I have started reading some basic tutorials and then sat down to put in practice what I just learned. I have been familiar with pascal at that time, so I knew how to achieve what I wanted, but I didn't know the PHP statements, so after finding the right statement I have added a line comment after it, so that I would know what…

Read this article »

Creating REST web services with Apache Wink on Tomcat

Wink is the JAX-RS implementation from Apache. I have never used it in a real-life project, but I thought it would be a good idea to create a small, dummy example as I did with RESTEasy and Jersey before just to see how easy/hard it is to get started with it. First of all, let's import the dependencies. We need to list wink-server in our pom.xml. <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache…

Read this article »

RESTful Web Service example on Tomcat using Jersey

Previously I have published a small example of a RESTful Web Service in Java using RESTEasy and JBoss. Today I have created another example, which uses Jersey and may be deployed on Tomcat... Jersey is the implementation of the JAX-RS from Oracle, so if I want to deploy a REST services on a simple web server, such as Tomcat, which does not come with any implementation of the JAX-RS, this is what I personally would use. First of all we need to list our dependecies in the pom.xml. We need to add both com.sun.jersey.jersey-server and com…

Read this article »

Simple JAX-RS Web Service on JBoss (RESTEasy)

Implementing RESTful services in PHP or Ruby was very easy, I love its simplicity compared to SOAP. But implementing a RESTful service for the first time in Java has caused me a bit of a headache. In the beginning I was quite confused when it came to JAX-RS specification and the different implementations (Jersey, RESTEasy, ...), but then it's so easy, I don't know why I have wasted so much time figuring out what I needed... We are using JBoss to deploy our application, which comes packed with RESTEasy, JBoss's implementation of the JAX-RS, so setting up a project is piece…

Read this article »

Bye, bye Hostgator!

I have been hosting my websites at Hostgator for more than 4 years, the first invoice being paid at 2010.02.10. In the beginning it was OK, it was my first paid hosting and I was very happy that I didn't have ads above my website placed inside an ugly iframe by the hosting company that provided free web hosting... The move from free hosting to paid, shared hosting was a big one for me at that time, I had no idea what a DNS was, how to register my own domain name or how to create sub-domains. Simple…

Read this article »