Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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 withbank
open checking account12345-67890under the name ofSpongebob 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 withbank
open checking account12345-67890under the name ofSpongebob 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.

scenariobank
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

...

:

setupa group of customers
numbertypefirst namelast namebalance
11111-11111checkingFredFlintstone$250.00
22222-22222savingsFredFlintstone$10 000.00
44444-44444savingsWilmaFlintstone$10 000.00
55555-55555checkingBarneyRubble$999.54

...

How to run a specification (suite) using the command line?

Requirements

...

  1. Installed java runtime
  2. Your compiled fixture classes/jar (System under Test)
  3. Your compiled classes/jar (System under Development)
  4. Your specifications files
  5. greenpepper-cli-plugin-x.x.x.jar
  6. A command line tool.

...

Code Block
languagejava
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
bgColorlightgrey
borderStyledashed
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, Image Added 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 Image Added 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?

...