Monthly Archives: July 2015

Concurrent Unit Tests

In general, my heart sinks when I think I may have to write some unit tests for threaded code. This can be fiendishly difficult, and the secret with it is not to test things too absolutely, as timings and orders

Tagged with: , ,
Posted in Uncategorized

Signalling between threads in Java

Various releases of Java have introduced more sophisticated concurrency patterns to Java. You don’t need to build your own thread pooling techniques, or queues between threads. However, for a lot of uses, the synchronized keyword is pretty much all you

Tagged with: , ,
Posted in Uncategorized

Mockito Chaining

Dynamic mocks are great. I believe it was Martin Fowler who first switched me onto them. What we should be testing is how an object interacts with its surroundings. Often this means setting it running and verifying that it made

Tagged with: , ,
Posted in Uncategorized

Allow me to assert something

Stories from the code review. You will sometimes find the most innocuous of lines of coding causing some surprises. Consider this assertion: Seems reasonable enough – the thing will fail the assertion if the result is not as expected. A

Tagged with: ,
Posted in Uncategorized