...
This page shows the fixture code that supports the examples introduced in the Writing a Do With specification(link to-do).
Fixture for Bank
Consider the first example of business flow described in Writing a Do With specification
...
, shown again below.
do with | bank |
open checking account | 12345-67890 | under the name of | Spongebob | Squarepants |
...
Building on the Bank example
The second example in Writing a Do With specification
...
, shown again below, presents a more complete business flow using the bank fixture.
do with | bank |
open checking account | 12345-67890 | under the name of | Spongebob | Squarepants |
...
This page shows the fixture code that supports the examples introduced in the Writing a Scenario specification(link to-do).
Fixture for Bank
Consider the first example of business flow described in Writing a Scenario specification
...
, shown again below.
scenario | bank |
open checking account 12345-67890 under the name of Spongebob Squarepants |
...
Building on the Bank example
The second example in Writing a Scenario specification(link to-do), shown again below, presents a more complete business flow using the bank fixture.
...
As we've seen in Setup Definition, a table of rules is used to simplify the creation of a particular state for the system under development. Once the state is created, we can focus on the business process to test.
This page shows the fixture code that supports the examples introduced in the Writing a Setup specification
...
.
Fixture to create bank customers
Consider the example of setup table described in Writing a Setup specification
...
:
setup | a group of customers | |||
number | type | first name | last name | balance |
11111-11111 | checking | Fred | Flintstone | $250.00 |
22222-22222 | savings | Fred | Flintstone | $10 000.00 |
44444-44444 | savings | Wilma | Flintstone | $10 000.00 |
55555-55555 | checking | Barney | Rubble | $999.54 |
...
How to run a specification (suite) using the command line?
Requirements
...
- Installed java runtime
- Your compiled fixture classes/jar (System under Test)
- Your compiled classes/jar (System under Development)
- Your specifications files
- greenpepper-cli-plugin-x.x.x.jar
- A command line tool.
...
Code Block | ||
---|---|---|
| ||
java -cp greenpepper-core-X.X.X-all.jar;path/to/systemundertest/classes;path/to/systemunderdevelopment/classes; com.greenpepper.runner.Main -s /path/to/myspecs /path/to/outputresults |
Configuration
GreenPepper CommandLineConfiguration
Arguments
Invoking the command line interface with the --help option brings up the usual help message:
Panel | ||||
---|---|---|---|---|
| ||||
Usage: greenpepper [options] input [ouput]
Run the input specification and produce a report in output file or in directory specified by -o
Options:
--lazy Execute document in lazy mode
-l, --locale LANG Set application language (en, fr, ...)
-f, --sud CLASS;ARGS Use CLASS as the system under development and instantiate it with ARGS
-o DIRECTORY Produce reports in DIRECTORY (defaults to current directory)
-r CLASS;ARGS Use CLASS as the document repository and instantiate it with ARGS (defaults to com.greenpepper.repository.FileSystemRepository)
--selector CLASS Use CLASS as the interpreter selector (defaults to com.greenpepper.document.GreenPepperInterpreterSelector)
-s, --suite Run a suite rather than a single test (output must refer to a directory)
-t SECTIONS Filter input specification to only execute SECTIONS (comma separated list of sections)
--xml Generate XML report (defaults to plain)
--help Display this help and exit
--version Output version information and exit
--debug Enable debug mode
--stop Stop the execution of the specification on the first failure |
Default options
When no option is given, defaults to the following rules:
- Input is a single specification, not a suite
- If output is not specified, reports are produced in the current directory
- Report is in plain format
- The operating system locale is used
- The input specification is not filtered
- The specification file must be located on the file system
- Fixtures are created using the default built-in mechanism
- Tables use formalism
- Lazy mode is disabled
- Debug mode is disabled
- Will not stop the execution on first failure
Any of the rules above can be overridden using command line switches.
How to deal with static fixture fields and the programmatically execution?
...