Posts under ‘Default’

Automated integration testing with Selenium, Maven and Jetty

Here at The Server Labs we place a high value on automated unit and integration tests and believe that they are fundamental whether you are using an agile methodology or not.
We use Maven on the vast majority of our projects and we often use Jetty as a web container in plain Java web projects [...]

Using Java Enums

This week I discovered two useful things you can do with Enums in Java.
The first and probably the more useful of the two is for formatting error messages in a consise and type safe way.

public enum ErrorMessageKey {
 
FILE_NOT_FOUND( "Cannot find file {0}"),
 
CANNOT_READ_FILE( "Cannot read file {0}"),
 
FILESTORE_CANNOT_OPEN_FILE( "Unable to open {0} nor {1}");
 
private final String message; [...]