JUnit
-
Core Java
Yet another way to handle exceptions in JUnit: catch-exception
There are many ways of handling exceptions in JUnit (3 ways of handling exceptions in JUnit. Which one to choose?,…
Read More » -
Core Java
JUnit ExpectedException rule: beyond basics
There are different ways of handling exceptions in JUnit tests. As I wrote in one of my previous posts, my…
Read More » -
Core Java
Getting JUnit Test Names Right
Finding good names is one of the challanges of crafting software. And you need to find them all the time…
Read More » -
Enterprise Java
Parameterized JUnit tests
Sometimes you encounter a problem that just screams for using “parameterized” tests rather than copy/pasting the same method many times.…
Read More » -
Enterprise Java
HOW-TO: Test dependencies in a Maven project (JUnit, Mockito, Hamcrest, AssertJ)
JUnit itself is not enough for most of today’s Java projects. You also need a mocking library, maybe something else.…
Read More » -
Core Java
Testing for expected exceptions in JUnit
Unit tests are used to verify that a piece of code operates as the developer expects it to. Sometimes, that…
Read More » -
Core Java
Access private fields in unit tests
First of all, let me say out louder, you need to design your code to be testable, so you test…
Read More » -
Desktop Java
More Units with MoreUnit
Just over a year ago I wrote a post about working with JUnit in Eclipse. One of the commenters recommended…
Read More » -
Core Java
Introduction To JUnit Theories
Have you ever read a mathematical theory? It typically reads something like this: For all a, b > 0 the…
Read More »