Interface ConcurrentTestCommand

    • Method Detail

      • markToFail

        ConcurrentTestCommand markToFail​(java.lang.String comment,
                                         java.lang.String pattern)
        Marks a command to show that it is expected to fail, and indicates how. Used for negative tests. Normally when a command fails the embracing test fails. But when a marked command fails, the error is caught and inspected: if it matches the expected error, the test continues. However if it does not match, if another kind of exception is thrown, or if no exception is caught, then the test fails. Assumes the error is indicated by a java.sql.SQLException. Optionally checks for the expected error condition by matching the error message against a regular expression. (Scans the list of chained SQLExceptions).
        Parameters:
        comment - a brief description of the expected error
        pattern - null, or a regular expression that matches the expected error message.
      • isFailureExpected

        boolean isFailureExpected()
        Returns true if the command should fail. This allows special error handling for expected failures that don't have patterns.
        Returns:
        true if command is expected to fail