-
Notifications
You must be signed in to change notification settings - Fork 99
5. Fit Fixtures
Fit is the older, and non-cross platform, test system supported by FitNesse out of the box. These days we prefer to use the Slim fixtures because they tend to make the tests more self describing by allowing far more of a test to be described in the wiki, without ‘hiding’ logic in code. But Fit it is still fully supported and we have some fixtures to assist writing tests using it.
These fixtures are all derived from column fixture, Fit’s version of Slim’s decision table. Usually a subclass of one of these fixtures must be written to define what each row will do.
MapColumnFixture |
A column fixture that does not require a field for each input column. Instead all columns are stored in a Map. Similar to Slim’s dynamic decision table. Mostly used as a base class to define other fixtures. |
MapDefinitionFixture |
Fixture where each row defines a Map<String,Object> as a symbol, so it can be passed to other fixtures as a single parameter. The input column names define the keys, the row values the value per key. The created map can be retrieved by a parameter result column (e.g. a column with header ‘=result?’). Mostly useful if the same set of input values is needed by multiple test table rows. MapColumnFixtures can also refer to individual values in such a Map by using ‘symbolName.key’ value in an input parameter column (i.e. a column with header ‘inputParameterName=’). |
SoapCallMapColumnFixture |
Fixture that first performs a SOAP call to web service and then (optionally) sends out another SOAP call to check the result of the first call. The contents of the SOAP calls is configured using Freemarker templates, to which all input columns are available. Result columns are defined writing methods on either the first or second service call’s response. Helper methods are available to simplify writing such methods using XPath expressions. So defining a test on a SOAP service with this fixture, usually entails no more than writing one (or two) Freemarker templates and a Java class that specifies the template(s) to use and a method for each result column. Some standard result columns are available to: display the SOAP request(s) and response(s) and time each call took. Furthermore a feature is available to configure that the check SOAP call must be executed multiple times, with a configured interval between them, until a certain condition is met. This allow tests in a single table row where the first call is not fully processed before it returns, but usually is fully processed a short time later. |
SymbolsFixture |
A fixture that allows a set of key/values to be stored as Symbols that can also be accessed by (fixture) code without having to show them in the table for a fixture. This is, for instance, useful to define the URL of a service to test (configurable in the wiki), without having to put them in each table that tests that service. |
Some extra features are also added to add some flexibility to result columns and make the comparisons inside table cells more powerful. These are document inside the baseline installation under: .HsacExamples.FitTests