onlinetestcase support for failure on failed connection - STEMLab/geotools GitHub Wiki

Description

OnlineTestCase provides infrastructure for configuring online test case fixtures. The current behaviour disables the test if an exception is thrown in the connect() method. It is proposed that an optional key be added to the test fixture property file to change this behaviour to failing if connect() fails.

From the javadoc (proposed code):

The default behaviour of this class is that if connect() throws an exception, the test
suite is disabled, causing each test to pass without being run. In addition, exceptions thrown by
disconnect() are ignored. This behaviour allows tests to be robust against transient
outages of online resources, but also means that local software failures in connect() or
disconnect() will be silent.

To have exceptions thrown by connect() and disconnect() cause tests to fail,
set skip.on.failure=false in the fixture property file. This restores the
traditional behaviour of unit tests, that is, that exceptions cause unit tests to fail.

Discussion

Announcement of this proposal, and following discussion:

Status

This proposal has been accepted. The implementation is complete.

Voting was:

Tasks

        | :white_check_mark: | :no_entry: | :warning:               | :negative_squared_cross_mark: |

------------|--------------------|------------|-------------------------|-------------------------------| no progress | done | impeded | lack mandate/funds/time | volunteer needed |

  • :white_check_mark: Update implementation (patch attached to Jira issue above).
  • :white_check_mark: Commit changes to subversion.
  • :white_check_mark: Update documentation.

Implementation Changes

The optional key skip.on.failure may be added to an OnlineTestCase fixture property file. For example:

skip.on.failure = false

If this key is absent or set to true, the original behaviour is retained.

Documentation Changes

A note will be added to the testing page to record this optional behaviour: