Development documentation

Internal configuration

Logging

The process excution support project uses Log4j for logging. Each project which links to this project must provide a Log4j configuration which is accessible at runtime as a result of the build process.

The project does not provide a Log4j configuration as part of its production build. A log4j configuration file is defined in the project in the directory src/test/resources/log4.properties for testing.

The test configuration configures Log4j to write to the log file to ${user.home}/.pineapple/logs/pineapple.log.

Spring configuration file(s)

The project contains a configuration file which defines a Spring application context which initializes the object in the project and can be imported into other projects who wishes to use the content of this project. The file is located in src/main/resources/com.alpha.pineapple.process.execution-config.xml.

Internationalization (I18N) configuration file

The project uses internationalization. Messages used by classes in the project are located in the file src/main/resources/com.alpha.pineapple.process.execution-messages.properties.

Unit test of the project

Test scripts

The directory src/test/resources contains test scripts used for testing:

  • test.cmd
  • forever.cmd

The scripts are inspired by the test scripts used to test the Commons Exec project which can be found at: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/test/scripts/

Helper classes

Helper classes:

  • com.alpha.testutils.ObjectMotherScript
ObjectMotherScript

com.alpha.testutils.ObjectMotherScript is an implementation of the ObjectMother pattern. The class provides helper functions for creating and resolving test scripts which can be used in unit tests.