Annotation Type FixtureMethod


  • @Retention(RUNTIME)
    @Target(METHOD)
    public @interface FixtureMethod
    This annotation must be added to all methods to be denoted as fixture methods. Fixtures are the primary way for Integrity test scripts to interact with the System Under Test. Fixture classes implement fixture methods for this purpose, which are then referenced in test scripts.

    The way to implement a fixture method is to take any POJO class and implement a method of any desired name. This method must be decorated with the FixtureMethod annotation to be called by Integrity. Parameters may be created by simply adding standard Java parameters to the method in question, annotated with a FixtureParameter annotation. Integrity will take care of the necessary conversions of user-provided data into the parameter data types.

    The method may return either nothing at all, a value of one of the supported types, or an instance of a custom class that acts as a container for multiple named result values. The first two cases are suited for use in test and call statements, while the latter is suitable for test statements with named results.

    Author:
    Rene Schneider - initial API and implementation
    • Element Detail

      • description

        java.lang.String description
        The description for the method. This text is intended to be a human-readable description of "what the fixture does". It is highly suggested to provide such a description, since it's one of the main mechanisms used by Integrity to create human-readable test results.

        You may use placeholder values in the description string enclosed in dollar signs, like this: $parameter$. These will be replaced by the matching parameter values at runtime.
        Placeholders can also be conditional (printed only when a parameter is provided or not) like this:
        {parameter?...and $parameter$} - this whole block would not appear if "parameter" is not provided, but if it is, it would be replaced by the text "...and [value of parameter]". By specifying a ^ in front of the parameter name the meaning is reversed: the block will appear if the parameter is NOT specified ({^parameter?not specified}).

        For fixture methods which are suitable in both 'call' and 'test' scenarios, you can define separate description texts via descriptionCall() and descriptionTest(). If such a specific text is defined, it does automatically override this generic description text.
        Returns:
        Default:
        ""
      • descriptionTest

        java.lang.String descriptionTest
        The description for the method, to be used if the method is included via 'testdef'.
        Returns:
        See Also:
        description()
        Default:
        ""
      • descriptionCall

        java.lang.String descriptionCall
        The description for the method, to be used if the method is included via 'calldef'.
        Returns:
        See Also:
        description()
        Default:
        ""
      • i18nDescriptions

        FixtureMethod.I18NDescription[] i18nDescriptions
        Internationalized descriptions can be provided in addition to the "default" descriptions (via description() or descriptionTest()/descriptionCall()). These are used if a custom result locale parameter is provided to the test runner. If no match for a requested locale is found, the default description is used.
        Returns:
        Default:
        {}