JUnit Rule + Java 8 Repeatable Annotations == Clean Tests

Last couple of months I am spending most of my free time writing Docker Java REST API client using RxJava and OkHttp. I have been following TDD for developing this API. Some of the test cases in RxDockerClientTest have to first create a docker container and then they perform other operations. For example, shouldStartCreatedContainer test case will test that API can start a created container. Similarly, there are test cases that need a container. One common solution to achieve this is to use @Before setUp and @After tearDown methods that take care of creating a container before test case is executed and removing the container after test execution. The problem with this solution is that container will be created for every test case in the test class. I only wanted to create a container for test cases that need it. Continue reading “JUnit Rule + Java 8 Repeatable Annotations == Clean Tests”

Writing Test Automation Framework for Installers

Last few weeks I have spent considerable time writing integration test suite for one of our product installers. The goal of this test suite is to automatically test functionality of the product on various operating systems. Currently, we are running our automated test suite on Windows 2008, Windows 7, and Windows 8 systems. In this blog, I will first talk about the technology stack that we used to build our automation framework and then I explain  how you can write such test suite using Java installer as an example. Continue reading “Writing Test Automation Framework for Installers”