protected void verify() throws TestException {
   RecordMetaData record = (RecordMetaData) records.firstElement();
   if (!CobolTestModel.compareCompositeObjects(
       record, CobolTestModel.getComplexPicStatementRecord())) {
     TestErrorException exception = new TestErrorException("The records do not match.");
     setTestException(exception);
   }
 }
  /*
   * This verify method presumes that the stored procedure in EmployeeCustomSQLSystem.buildSQLInsertProcedure
   * has not changed and still returns an output parameter VERSION with value 952
   */
  public void verify() {
    if (this.events.isEmpty()) {
      throw new TestErrorException("No session events were thrown and some were expected");
    } else {
      if (((Number)
                  ((DatabaseRecord) ((SessionEvent) events.firstElement()).getResult())
                      .get("EMPLOYEE.VERSION"))
              .intValue()
          != 952) {
        throw new TestErrorException("Wrong value returned");
      }

      if (((WriteObjectQuery) ((SessionEvent) events.firstElement()).getQuery()).getObject()
          == null) {
        throw new TestErrorException("Object not set");
      }
    }
  }
 public void test() {
   // read data back from database literally in order to check contents of database rather than the
   // driver's TIMESTAMPTZ
   String sql =
       "select TEST_ID, to_char(TSTZ_DATA,'MM/DD/YYYY hh24:mi:ss TZR') as TSTZ_DATA FROM "
           + commonDescriptor().getTableName()
           + " where TEST_ID = "
           + getTestId();
   Vector result = getSession().executeSQL(sql);
   if (result != null & !result.isEmpty()) {
     this.result = (DatabaseRecord) result.firstElement();
   }
 }
  public void setup() {
    if ((getSession().getLogin().getPlatform().isSQLServer())) {
      throw new TestWarningException(
          "This test is not supported on SQL Server. Because 'LENGTH' is not a recognized function name on SQL Server.");
    }

    Vector employees = getSomeEmployees();
    Employee emp = (Employee) employees.firstElement();

    String ejbqlString;

    ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE ";
    ejbqlString = ejbqlString + emp.getFirstName().length();
    ejbqlString = ejbqlString + " = LENGTH(emp.firstName)";
    ejbqlString = ejbqlString + " AND ";
    ejbqlString = ejbqlString + emp.getLastName().length();
    ejbqlString = ejbqlString + " = LENGTH(emp.lastName)";

    setEjbqlString(ejbqlString);
    setOriginalOject(emp);

    super.setup();
  }
  protected void changeUnitOfWorkWorkingCopy() {
    Employee employee = (Employee) this.unitOfWorkWorkingCopy;
    AddressDescription addressDescription = employee.getAddressDescription();
    ProjectDescription projectDescription = employee.getProjectDescription();
    Language language;
    Vector languages;

    // Root object changed
    employee.setFirstName(null);
    employee.setLastName(null);
    // Third level aggregate object changed
    addressDescription.setPeriodDescription(null);
    // 1 to 1 mapped object changed
    projectDescription.getComputer().setValue(null);
    // 1 level aggregate's 1:M mapping
    projectDescription.getResponsibilities().setValue(null);
    languages = (Vector) projectDescription.getLanguages().getValue();
    language = (Language) languages.firstElement();
    language.setLanguage(null);

    // 1 level aggregate's M:M mapping, adding a new element
    // languages.addElement(null);
  }