JUnit 4 introduced a fancy DSL based on the Hamcrest framework for expressing assertions. JUnit ships with the most important matchers and you can always add Hamcrest to your classpath if you need more. Sometimes no existing matcher fits your needs and you have to roll your own. Since it's …
read moreOther articles
JUnit: Using External Resources
Many integration test cases need access to external resources like files or databases. Dealing with external resources is always messy because you have to set up state and tear it down later. Since JUnit 4.7, there's a mechanism that makes things a bit more convenient.Previously when you had …
read moreJava: Finding Package Cycles
JDepend is a tool for detecting cycles between your Java packages. It is often used from a Maven plugin to generate reports for the project's Maven site.In most teams, however, people only look at these reports from time to time. So when a cycle has been introduced, it takes …New Project: JSysTest
I love unit tests and use them whenever possible. But in the end, there's no substitute for a full scale system test. Only after system testing, you can be sure that everything works as intended. When I was looking for a way to test a REST-style JSON web service, I …
read moreTesting C++ Applications using CppUnit
Unit testing is hip these days and every programming language has its own JUnit clone that mimics the original more or less closely. For C++, there's the excellent CppUnit package that I've been using extensively lately. Unfortunately, C++ is less dynamic than languages like Java, so you can't simply tell …
read more