Posts tagged with "tips"

Jul 4th, 2014

Do you know the SWT templates in Eclipse?

mainloop template

Often when I use SWT templates in a presentation, some people look amazed, so I thought it’s worth sharing. If you write SWT code and don’t know these templates yet, you may be wasting time typing the same code over and over again. Whenever you write an SWT snippet, you start with a Display, a [...]

Leave a Comment
Jun 20th, 2014

Even fancier RAP Tables with Templates & native CSS

template-with-css

In RAP 2.2 we introduced the Row Templates feature, which allows you to layout the cells of table rows in different ways than just in columns. In RAP 2.3 we improve on this a bit by allowing not just absolute (pixel) but also percentage values for positioning. However, another cool feature that isn’t documented (because [...]

Leave a Comment
Jun 12th, 2014

Parsing JSON responses with JMeter

9066963819_cd73a17fae_n

JSON is becoming more and more important as a data exchange format, especially in Ajax web frameworks and RESTful web services. Apache JMeter, which is a very popular tool to perform load tests for web applications, does not come with native support to handle HTTP responses with JSON bodies. This post shows different possibilities how [...]

Leave a Comment
Apr 29th, 2014

How to write UI tests for RAP with Selenium 2.0

controlsdselenium

We’re occasionally asked how RAP supports UI tests. And while we were aware that there are developers creating UI tests for RAP, we never gathered much experience ourselves. However, in recent months I had the opportunity to delve deeper into this topic myself, specifically researching if Selenium 2.0 works with RAP 2.x. Spoiler: It does. [...]

11 Comments
Mar 27th, 2014

How to write better Jasmine tests with mocks

Jasmine project logo

I recently started using Jasmine to write my JavaScript tests. I really like it – it made writing tests actually kind of fun. I especially love that you can write tests with mocks in a similar manner as you would using Mockito in the Java world. A mock is basically a lightweight object that imitates [...]

Leave a Comment
Mar 7th, 2014

How to get the “Push to Gerrit” Action back with EGit

This week I updated my IDE to Eclipse 4.3.2 which comes with Egit 3.2. After that my “Push to Gerrit” action was gone from the usual place. If the same thing happens to you, here is how to get it back: In the context menu, select Team > Remote > Configure Push to Upstream. In [...]

1 Comment
Feb 10th, 2014

SWT Best Practices: Changing Fonts

Here is a widespread way of creating a label with a bold font: Everything seems to be fine with this code. A Label is created with the default font “Arial”, the default size “12″ and our desired style “BOLD”. So what’s the problem with this snippet? With the above code that creates a BOLD font, you [...]

7 Comments
Dec 6th, 2013

Run UI tests in the background on Linux

UI tests on a virtual display

When you run JUnit tests that open windows and dialogs, all these windows pop up on your screen like fireworks, making your desktop unusable for minutes. If you’re lucky enough to work on Linux, there’s an easy way to get rid of all the flickering. You can simply redirect your UI tests onto a virtual [...]

3 Comments
Nov 6th, 2013

Get rid of your StringUtils!

5480421664_b545d6083c_n

Probably every Java developer has developed at least one String utility class in his life. Need a proof? Feed "java StringUtil" to your favorite search engine – I found 20 different implementations among the first 30 search hits only! There is a simple reason for that – Strings are used quite frequently in common Java [...]

9 Comments