Tests are not just about testing

Tests in the context of software development have a surprisingly broad field of uses which exceeds "just" testing. Those further uses paint a more colourful picture of tests than just regression keepers. Tests as a component runtime: a test is the workbench on which the component is developed. Instead of constantly restarting an application server … Continue reading Tests are not just about testing

Getting test coverage reports for integration test

I'm a vociferous supporter of integration tests with an embedded servlet container and in this post I'll show how to get test coverage for the classes touched in those integration tests. All test coverage gauging tools I know instrument code under test either at build time or run time through Java agents. Because the code … Continue reading Getting test coverage reports for integration test

End-to-end testing Java web applications with an embedded Tomcat

 In this instalment on assembly testing [1] I'll talk about how automated system tests run over my Java web applications. The set-up is rather cheap, not very labour-intensive and can incrementally evolve from a simple assembly test (aka smoke test) to a full-fledged system test. Since this post is rather concrete naming tools and frameworks, … Continue reading End-to-end testing Java web applications with an embedded Tomcat

Integration testing Spring controllers

Time-constrained projects sometimes mandate crude realism as to the type and extent of test coverage in a software project. You'll find arguments for and against testing in the entire spectrum of opinions from "tests are luxury we can't afford" to "regressions are luxury we can't afford". Constrained or not, there is rarely a good excuse … Continue reading Integration testing Spring controllers

Compact mockito: shorter answer notation

[Update 2014.10.08] The code is now on github. If you value brevity in tests like I do then maybe you would agree that mockito's doAnswer statements contain much boilerplate. That is certainly not mockito's fault but rather a result of java's inflexible syntax. When testing, i.e. GWT code one will frequently find the need to … Continue reading Compact mockito: shorter answer notation

A better eq() when matching method arguments with Mockito

I learned late of Mockito [1], even so more I love it. Walking a little farther away from the basics, a frequent needs presents itself to match method parameters (either when specifying or verifying behaviour) based on properties of complex objects which do not implement the java equals contract. Such an example would be verifying … Continue reading A better eq() when matching method arguments with Mockito

Missing history update when clicking on links in GWT and HtmlUnit unittests

I'm still pretty enthusiastic about the benefits of templating [1] GWT UIs with HTML as it turns out to be a productive way for altering UIs without going through a tedious compilation and deployment procedure. HtmlUnit 2.9 is a great java browser for integration-testing Ajax applications. It works fine with GWT and we use it … Continue reading Missing history update when clicking on links in GWT and HtmlUnit unittests