Testing package
The idea behind this package is to use junit
in a different way. In a config
file the test classes are defined which should executed.
The testing package contains a class TestFramework
which implements
the main method. This program reads a configuration file with name testcase.conf
.
This file will read by the BootManager
and can be either in the local directory
or neither in the classpath. The file contains a list of
junit
testcases. The testcases will run in the same sort order of the file
entries.
Additional the testcase file can also contains some macro calls. Each macro
starts with ::
and followed by the macro name. The following macros are
available:
verbose
: the verbose macro enables/disables the jptools logger.
examples:::verbose # enables verbose mode ::verbose = on # enables verbose mode ::verbose = off # disables verbose mode
stop
: this macro stops the processing.
examples:::stop
The framework supports additional profile information of testcases. The profile can configurated with the following macros:
profileHistory
: This macro defines the number of supported history profiles. As default there is no limitation.
examples:profileHistory = 10
profileUpdate
: This macro stores the profile data after a run in thetestcase.profile
file.
examples:profileUpdate # stores the profile data with a generated name profileUpdate = myTest # stores the profile data with the name myTest
profileCompare
: This macro compares the current run with the last profile run.
examples:profileCompare
profileTolerance
: This macro defines the profile tolerance.
examples:profileTolerance = 100 # profile time tolerance of 100ms
profileMemory
: This macro enables the memory profile. This is currently experimental!
examples:profileMemory
The framework implements also a simple GUI to compare profiles. The profile can be started with the
testcasehistory.bat
script.
The link testcase.conf shows a simple example.
Design
The classes LoggerTestCase
enables to check and test log entries of the jptools
logger. Different additional assert methods are implemented. To use this additional assert methods
subclasses have to inherit from this class which is a junit
TestCase
class.
The class DatabaseTestCase
implements additional methods for database checks.
The class diagramm shows the relations between the library and the
junit
classes: