junit Tag

When you test components of a RAP application, you have to simulate the environment that RAP UI code normally runs in. Thanks to a new API, this becomes easier in RAP 3.0. In an earlier post, my colleague Johannes explained how to write unit tests for RAP 2.x. This approach required more boilerplate code to set up and tear down the RAP environment in every single...

Read More

Many test cases for an application involve data defined by the data model. To achieve good test coverage it is customary to run the test cases for a variety of input data sets. This can be achieved by manually specifying input data. However, this is a complex task and it is easy to miss important input data and thereby miss bugs. Fuzz testing is about...

Read More

Writing JUnit Tests for an application is always a good thing. Writing tests for a Tabris or RAP application for the first time seems more challenging: You might encounter an "java.lang.IllegalStateException: No context available outside of the request processing." exception while running the tests. So, after a quick google you will find a blog post from my dear fellow Johannes that explains that you need to...

Read More

Editor's note: the Restfuse tool is no longer maintained and has been archived. However, you can still access the sources on GitHub. A few days ago my fellow Frank wrote about running HTTP/REST Integration Tests efficiently in Eclipse. Today I want to show you how to embed those tests in a headless build using Eclipse Tycho. Embedding restfuse in a build is as simple as embedding...

Read More

Editor's note: This project is no longer maintained and has been archived. However, you can still access the sources on GitHub. It has been almost a year since the last restfuse news. In the meantime restfuse was adopted by a lot of individuals and companies. Since the last release the development continued on github and made it now worthwhile to publish an update. Last week we released...

Read More

This year marks the third Eclipse Testing Day, where the community gathers for a day focusing on testing with, for and at Eclipse. The event takes place on September 05 in Darmstadt. The general theme for this year's testing day is "Testing and Beyond". Topics of interest include: Testing Eclipse applications Testing within the Eclipse Ecosystem Testing on Eclipse Projects Design for testability in Eclipse Case studies of testing projects Eclipse tooling...

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

With this effective Mockito Post I want to share a really simple pattern with you. We call this pattern "check answers" and we use it whenever we work with Mockito Answers. The code resulting from creating Mockito Answers generally looks ugly. But, as good programmers we care about test quality, right? :) Let's see how we can make better looking answers using the "check answer" pattern....

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