Posts tagged with "Java"
Look Mate, No Setters, No XML!
Lately I had a discussion about setters that have been introduced for the sake of testability. Just to be able to replace the actual collaborator with a stub or mock. The discussion went something like this: S: “We could use a dependency injection in conjunction with the @Inject annotation with a container like Spring to [...]
A Rule to Test Them All (At Once)
Unit tests often stop being useful where concurrency is involved. A special case is thread safety which can be tested relatively easily with the use of a simple JUnit rule. Suppose middle earth wants to keep track of the dragons that were slain over the centuries. The dragons are tracked in one list, and reports [...]
How to Bootstrap a Tabris Application with Maven and Eclipse
From my point of view bootstrapping a new application is always tricky. Especially when you want to bootstrap an app that uses technology you are not yet familiar with. With this post I want to give you a step by step tutorial on how to bootstrap a Tabris application using Eclipse and Maven. So, let’s [...]
When an exception gets lost
Recently I fell into the lost exception pitfall – when an exception thrown in a try block gets lost because another exception is thrown in the finally block. It wasn’t that I was not aware of the problem, but rather that I underestimated and therefore ignored it. This post describes an example where suppressed exceptions [...]
A Fast and Minimal JSON Parser for Java
In the RAP project, reading and writing JSON are critical operations, since the server processes and creates JSON messages for a large number of clients at a high rate. For this reason, we need something fast for this job. When we switched to JSON, we included the org.json parser, which is reasonably small but not [...]
JUnit – the Difference between Practice and @Theory
Lately a colleague showed me how to improve JUnit tests written for a distance calculator. Speaking with other developers I found out that the majority wasn’t aware of the undocumented @Theories Runner which can be found in an experimental package in JUnit, so I decided to share this valuable “experiment”. In contrast to the parameterized [...]
Use your HEAD – checking CouchDB document existence
One common task when working with CouchDB is to find out whether a document with a given ID exists. A simple solution is to send an HTTP GET request with the ID to CouchDB and check the response’s HTTP status code. A GET request, executed, for example with curl curl http://localhost:5984/mydatabase/mydocumentid will return the document [...]
API Tools revisited
Defining API’s is crucial to maintaining modularity. OSGi defines the concepts necessary for API definition such as a service concept and package visibility. However, pure OSGi is not enough to really maintain an API and its potential usages. There are several cases in an API definition where it is required to do more than restrict [...]
Inside the Tabris UI
As you may have read in the Tabris 0.11.0 new and noteworthy post, we have created a small UI framework called the “Tabris UI”. In this post I will dive into the details of this framework. Grab a coffee and open your mind . Let’s get started… Background Almost a year ago we released our [...]





