JUnit
-
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 » -
Core Java
Parameterized JUnit tests with JUnitParams
Parameterized unit tests are used to to test the same code under different conditions. Thanks to parameterized unit tests we…
Read More » -
Core Java
Run, JUnit! Run!!!
JUnit together with JavaScript and SVN are some of the technologies that programmers often start using without even reading a…
Read More » -
Enterprise Java
JBoss Drools unit testing with junit-drools
Recently I’ve been working with a project heavily using JBoss Drools. I am not Drools expert – I am not…
Read More » -
Core Java
A JUnit Rule to Conditionally Ignore Tests
I always believed that using @Ignore to deactivate tests is a bad idea. Except, maybe as one way to put…
Read More » -
Core Java
3 ways of handling exceptions in JUnit. Which one to choose?
In JUnit there are 3 popular ways of handling exceptions in your test code: try-catch idiom With JUnit rule With…
Read More »