Class SqlOperatorBaseTest.ValueOrExceptionResultChecker

  • All Implemented Interfaces:
    SqlTester.ResultChecker
    Enclosing class:
    SqlOperatorBaseTest

    private static class SqlOperatorBaseTest.ValueOrExceptionResultChecker
    extends java.lang.Object
    implements SqlTester.ResultChecker
    Result checker that considers a test to have succeeded if it returns a particular value or throws an exception that matches one of a list of patterns.

    Sounds peculiar, but is necessary when eager and lazy behaviors are both valid.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Object expected  
      private java.util.regex.Pattern[] patterns  
    • Constructor Summary

      Constructors 
      Constructor Description
      ValueOrExceptionResultChecker​(java.lang.Object expected, java.util.regex.Pattern... patterns)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void checkResult​(java.sql.ResultSet result)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • expected

        private final java.lang.Object expected
      • patterns

        private final java.util.regex.Pattern[] patterns
    • Constructor Detail

      • ValueOrExceptionResultChecker

        ValueOrExceptionResultChecker​(java.lang.Object expected,
                                      java.util.regex.Pattern... patterns)
    • Method Detail

      • checkResult

        public void checkResult​(java.sql.ResultSet result)
                         throws java.lang.Exception
        Specified by:
        checkResult in interface SqlTester.ResultChecker
        Throws:
        java.lang.Exception