tips Tag

This post describes an easy – but little known way – to use native libraries (.dlls) with Eclipse RCP. In my current work, I'm shipping an RCP application that interacts directly with hardware connected to the user's machine. These interactions are done through drivers, written in C, that are available in binary form as shared libraries. The use of shared libraries introduces a few problems: In order to load...

Read More

Apache CouchDB offers high availability, excellent throughput and scalability. These goals were achieved using immutable data structures - but they have a price: disk space. CouchDB was designed under the assumption that disk space is cheap. Though it is indeed getting cheaper and cheaper, it is not infinite. Here's a tip to reduce CouchDB database files' disk consumption. When a CouchDB document is updated, the new...

Read More

The release of the RAP protocol is an important milestone. The protocol enables native mobile client Apps (in addition to the existing browser client) to connect to the RAP server. In other words, the data is now sent over the network by using JSON instead of proprietary JavaScript. One thing we noticed, was that the server responses were not compressed anymore by the server. On company...

Read More

Recently, I was asked how to create a web application that allows the user to draw on images: We have an application to deliver training content to medical professionals. An important issue for us is user-interaction with images. E.g. displaying images and allowing users to draw on them. The example below shows how to draw on a static image using our Eclipse RAP framework. It works as follows: Create...

Read More

JUnit and Eclipse are a great combination, but one thing that I missed every time I worked with JUnit4 was the code templates. Currently, Eclipse ships with pre-defined templates for JUnit3 but not for JUnit4. So, I wrote three basic JUnit4 templates that can be imported from the "Templates" Preference Page. Take a look at the screenshot below to see how to get there. The...

Read More

This Effective Mockito Post will be IDE specific again but related to the last post on Mockito's spies. If you've read Part 3 you should now be familiar how to use them to "pseudo mock" statics. When writing code it often comes to a point where we want to debug using single step debugging. When using Mockito and especially when spies come into the game...

Read More

In the previous Effective Mockito post we saw how to use the @Mock Annotation to get a clean test. In this post I want to show you how to use Mockito's spy mechanism to eliminate testing troubles with third party libraries. Testing is one of the most important things in software development. I assume you agree with me because you decided to read this blog post...

Read More

As promised in the first part of the "Effective Mockito" blog series, I will concentrate on Mockito specifics in the followup posts. So, the main topic for Part 2 is Mockito's @Mock Annotation. When I write tests I try to follow an explicit pattern, called the build-operate-check pattern. This was described by Uncle Bob in his book "Clean Code" (Page 127, Chapter 9). The main idea...

Read More