In addition to the
Setup and Cleanup
decorations a test can also be preceded by a list of conditions
. If one the conditions is not validated, the test will be
ignored (and not failed)
. An appropriate message will be inserted into the ignore message to explain why the test has been ignored by the framework.
This may be really interesting if you don't want that all your tests related to a specific windows service (SSRS or SSIS) fail, just because this service has not been started in the server executing your test-suite.
Note that the conditions are executed before
the list of commands registered in the
! In consequence, it's not expected to validate that a service is running in the
and start it during the cleanup
. If the service is not started when performing the check over the condition, the test will stop and be reported as ignored.
The following predicate is defined:
- service-running: this service will validate if the service is effectively running.
If the service is not in the expected state, NBi will wait maximum the time set in the attribute named
to ensure that the service is not changing his state before reporting the test has ignored. If this timeout is not defined, a default value of 5 seconds will be used.
<service-running name="MyService2" timeout-milliseconds="1000"/>