Background and introduction

TestCase4j is a test case framework implemented in Java for monitoring live services. Initially it was designed as a cross-platform replacement of NRPE (Nagios Remote Plugin Executor), providing a way for Nagios to invoke test cases on a remote host. TestCase4j is not limited for use by Nagios nor does it require you to use Nagios. You may use it for other purposes that you see fit.

In short, TestCase4j uses the concept of a test case and a test case container. A test case is a Java class implementing one or more steps. Each step is a method in the Java class. It performs a task, like logging in to a server, logging out, counting the number of rows in a database, etc. In the Nagios world, a test case is the same as a plugin. The test case container is a placeholder for all test cases. It exposes an API that can be used for managing it, like adding/removing/executing a test case.

Test case configuration may be configured in a XML file (you may write Java code that manually builds the configuration instances if you like). The configuration file defines a test case in terms of its name, step order, step configuration attributes, maximum retry count and timeout. The name of the implementation class, i.e. the Java class holding the implementation, is also a part of this configuration.

TestCase4j is developed and maintained as packages: core packages and add-ons packages.

Core packages

  • TestCase4j Core - core classes and interfaces for those who wants to incorporate the test case framework in a application of their own

Add-on packages

  • TestCase4j Server - for those who wants a working server for executing test cases from a remote host (includes the Core package)
  • TestCase4j Nagios Client - what you need to have in order for Nagios to communicate with TestCase4j Server


  • Runs on all platforms capable of running Java applications
  • Provides a container with locally and/or remotely accessible test cases
  • Simple API for easy incorporation of test cases in your application
  • Highly extendable server - add your own invokers and protocols to meet your specific need
  • Dynamic class-loading lets you add class libraries that your test cases are dependent on without interruptions
  • Minimal class library dependencies, only Log4j is used (Core and Server packages)
  • Update test case configuration in runtime by modifying its XML configuration

Why use TestCase4j?

  • Free and open source (GNU GPL)
  • Platform-independent
  • Write test cases (plugins) as plain Java classes and let TestCase4j make all the plumbing for you
  • Extend TestCase4j to fit your special needs in order to integrate with other applications
Unless otherwise stated, the content of this page is licensed under GNU Free Documentation License.