Class ConcurrentTestCommandGenerator.AbstractCommand

    • Field Detail

      • shouldFail

        private boolean shouldFail
      • failComment

        private java.lang.String failComment
      • failPattern

        private java.util.regex.Pattern failPattern
      • failureExpected

        private boolean failureExpected
    • Constructor Detail

      • AbstractCommand

        protected AbstractCommand()
    • Method Detail

      • markToFail

        public ConcurrentTestCommand markToFail​(java.lang.String comment,
                                                java.lang.String pattern)
        Description copied from interface: ConcurrentTestCommand
        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).
        Specified by:
        markToFail in interface ConcurrentTestCommand
        comment - a brief description of the expected error
        pattern - null, or a regular expression that matches the expected error message.
      • isFailureExpected

        public boolean isFailureExpected()
        Description copied from interface: ConcurrentTestCommand
        Returns true if the command should fail. This allows special error handling for expected failures that don't have patterns.
        Specified by:
        isFailureExpected in interface ConcurrentTestCommand
        true if command is expected to fail