protected void resetVerify() { Session session = getSession(); // Read the object from the database Employee databaseEmployee = (Employee) session.readObject(Employee.class, getSearchExpression()); // If the employee object IS in the database then there is a problem. if (databaseEmployee != null) { throw new TestErrorException( "The example employee object should have been deleted from the database."); } }
protected void verify() { Session session = getSession(); // Read the object from the database Employee databaseEmployee = (Employee) session.readObject(Employee.class, getSearchExpression()); // If the employee object IS NOT in the database then there is a problem. if (databaseEmployee == null) { throw new TestErrorException( "Employee object should not have been deleted after transaction rollback"); } }
protected void verify() { Session session = getSession(); // Read the object from the database Employee databaseEmployee = (Employee) session.readObject(Employee.class, getSearchExpression()); // If the employee object is NOT in the database then there is a problem. if (databaseEmployee == null) { throw new TestErrorException( "Employee object should have been inserted into database after commit transaction"); } // Check that the employee read from the database is the same as the one in memory. if (!compareObjects(getEmployee(), databaseEmployee)) { throw new TestErrorException( "The object read from the database, '" + databaseEmployee + "' does not match the originial, '" + getEmployee() + "."); } }