This project is read-only.

Condition

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 setup! In consequence, it's not expected to validate that a service is running in the condition 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.

<test>
	<condition>
		...
	</condition>
	<setup>
		...
	</setup>
	<system-under-test>
		...
	</system-under-test>
</test>

Available predicates

Windows Service

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 timeout-milliseconds 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.

<condition>
	<service-running name="MyService"/>
	<service-running name="MyService2" timeout-milliseconds="1000"/>
</condition>

Last edited Mar 10, 2014 at 11:40 AM by Seddryck, version 1

Comments

No comments yet.