21.5. Unit Testing with HackyInstaller

21.5.1. Overview

HackyInstaller's unit testing uses JUnit and JFCUnit. The base code is tested using JUnit and the GUI is tested with JFCUnit.

When HackyInstaller runs it usually requires several configuration files (sensor.properties, hackyinstaller.xml, and usermaps.xml). It is no different during unit testing. Much of the HackyInstaller code accesses these files. Therefore, we must ensure that all the files needed by HackyInstaller are available during the testing. We achieve this goal with a custom class called HackyInstallerTestCase.

21.5.2. HackyInstaller's Testing Environment

HackyInstaller's testing environment consists of temporary directory that contains a dummy .hackystat folder with dummy configuration files.

21.5.3. The Purpose of HackyInstallerTestCase

HackyInstallerTestCase is used to provide extra methods and fields to the test cases requiring access to the HackyInstaller testing environment.