There are two requirements that must be satisfied for this framework.
The first requirement is that a repose-test.properties
file is on the classpath when tests are run.
The repose-test.properties
file tells that framework what version of Repose, directories, host, and ports to use.
It should be in the Java properties file format like the following example:
|
Not all properties are strictly required.
In fact, most properties have reasonable defaults.
However, any property which takes an absolute path should be given a value.
|
# Required Properties
test.root.directory=/default/test/root (1)
repose.home=/default/repose/home (2)
repose.config.templates=/default/config/templates (3)
# Required (If Used) Properties
repose.jar=/default/valve/location (4)
mocks.war=/default/mocks/war/location (5)
# Optional Properties
repose.version=${version} (6)
repose.container=valve (7)
repose.config.directory=/configs (8)
repose.log.name=/logs/repose.log (9)
repose.log.pattern=/logs/repose_%d{yyyy-MM-dd_HHmmss}.log (10)
target.hostname=localhost (11)
port.finder.port.start=10000 (12)
port.finder.port.max=65535 (13)
port.finder.port.range=100 (14)
port.finder.property.name.worker.id=org.gradle.test.worker (15)
1 |
The absolute path of the root directory to run tests under.
The user running the tests must have permission to read and write in this directory.
It is advised that this be the build directory of the build tool being used to run the tests (e.g., buildDir in Gradle).
Doing so enables the build tool to handle cleanup of any test resources. |
2 |
The absolute path of the home directory which will contain Repose artifacts, and possibly other Repose test structures. |
3 |
The absolute path of the directory which contains the configuration file templates. |
4 |
The absolute path to the Repose JAR file. |
5 |
The absolute path of the WAR file containing mock services. |
6 |
The version of Repose. |
7 |
The servlet container to run Repose in.
A value of valve will run a standalone instance of Repose using an embedded container. |
8 |
The path of the directory relative to the test.root.directory or repose.home directory which will contain Repose configuration files. |
9 |
The Repose log file path relative to the test.root.directory or repose.home directory. |
10 |
The log filename path pattern relative to the test.root.directory or repose.home directory. |
11 |
The target hostname (usually localhost ). |
12 |
The port number to start at when scanning for open ports. |
13 |
The max port number which can be used when scanning for open ports. |
14 |
The step size between workers when scanning for open ports. |
15 |
The name of a System property the value of which will be used as the worker ID. |
The second requirement is that the Repose artifacts (e.g., JARs and EARs) must be placed in the directory specified by the repose.home
property.
If they are located elsewhere, the ReposeValveTest
specification will not work.
However, other utilities provided by the framework may still be used.