We can throw an exception AbandonTestSuiteException anywhere in fixture or Domain Adapter
code to stop execution of the entire test suite. The exception can be constructed with a custom message which will appear in the test result.
throw new AbandonTestSuiteException();
throw new AbandonTestSuiteException("my message"); Folder Runner
stops reading input files when the suite is abandoned.
The following sets up two tests. The first one throws AbandonTestSuiteException so the second is not run.
|make new folder⇓ ||test\input |
|with ||new file⇓ ||test\input\abandon.txt |
|write line ||test@ sampledomainadapter |
|write line ||throwabandonsuite |
|with ||new file⇓ ||test\input\another.txt |
|with ||execute folder runner⇓ |
|check ||results ||0 right, 0 wrong, 0 ignored, 1 exceptions |
FitServer throws an exception when the suite is abandoned to make FitNesse stop sending tests.
The following runs a suite with two tests. The first one throws AbandonTestSuiteException so the second is not run.
|configure ||processor ||add operator ||compareregex |
|add page ||test@,fit.Test.Double.SampleDomainAdapter,throwabandonsuite |
|check ||results ||/.*SampleDomainAdapter.* \(Test completed\) \(Suite abandoned\)/ test@ | (Test completed) (Suite abandoned)
fitSharp.Fit.Exception.AbandonSuiteException: Suite abandoned.
at fit.Test.Double.SampleDomainAdapter.ThrowAbandonSuite() in /home/mikes/code/fitsharp/source/fitTest/Double/SampleDomainAdapter.cs:line 29