Class Expectations.BasicExpectation

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected BasicExpectation​(int expectedRowCount)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canBeBatched()
      Is it acceptable to combiner this expectation with statement batching?
      protected int determineRowCount​(int reportedRowCount, java.sql.PreparedStatement statement)  
      int prepare​(java.sql.PreparedStatement statement)
      Perform any special statement preparation.
      void verifyOutcome​(int rowCount, java.sql.PreparedStatement statement, int batchPosition, java.lang.String statementSQL)
      Perform verification of the outcome of the RDBMS operation based on the type of expectation defined.
      • Methods inherited from class java.lang.Object

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

      • BasicExpectation

        protected BasicExpectation​(int expectedRowCount)
    • Method Detail

      • verifyOutcome

        public final void verifyOutcome​(int rowCount,
                                        java.sql.PreparedStatement statement,
                                        int batchPosition,
                                        java.lang.String statementSQL)
        Description copied from interface: Expectation
        Perform verification of the outcome of the RDBMS operation based on the type of expectation defined.
        Specified by:
        verifyOutcome in interface Expectation
        Parameters:
        rowCount - The RDBMS reported "number of rows affected".
        statement - The statement representing the operation
        batchPosition - The position in the batch (if batching)
        statementSQL - The SQL backing the prepared statement, for logging purposes
      • prepare

        public int prepare​(java.sql.PreparedStatement statement)
                    throws java.sql.SQLException,
                           HibernateException
        Description copied from interface: Expectation
        Perform any special statement preparation.
        Specified by:
        prepare in interface Expectation
        Parameters:
        statement - The statement to be prepared
        Returns:
        The number of bind positions consumed (if any)
        Throws:
        java.sql.SQLException - Exception from the JDBC driver
        HibernateException - Problem performing preparation.
      • canBeBatched

        public boolean canBeBatched()
        Description copied from interface: Expectation
        Is it acceptable to combiner this expectation with statement batching?
        Specified by:
        canBeBatched in interface Expectation
        Returns:
        True if batching can be combined with this expectation; false otherwise.
      • determineRowCount

        protected int determineRowCount​(int reportedRowCount,
                                        java.sql.PreparedStatement statement)