protected void verify() {
    if (!employee.getAddress().getCity().equals("null")) {
      throw new TestErrorException("Null value not converted correctly for string.");
    }

    if (employee.getSalary() != -1) {
      throw new TestErrorException("Null value not converted correctly for int.");
    }
  }
  protected void test() {
    UnitOfWork uow = getSession().acquireUnitOfWork();
    ReadObjectQuery query = new ReadObjectQuery(Employee.class);
    query.setLockMode(ObjectLevelReadQuery.LOCK_NOWAIT);
    Employee emp = (Employee) uow.executeQuery(query);

    emp.setSalary(emp.getSalary() + 1);
    uow.commit();
  }
 public void verify() {
   if (getObjectFromDistributedCache(manager) == null) {
     throw new TestErrorException(
         "New employee was not added to distributed cache with "
             + " SEND_NEW_OBJECTS_WITH_CHANGES descriptor CacheSynchronizationTypeSetting.");
   }
   Employee distributedEmployee = (Employee) getObjectFromDistributedCache(employee);
   Employee distributedManager = (Employee) getObjectFromDistributedCache(manager);
   if (!(distributedEmployee.getSalary() == employee.getSalary())) {
     throw new TestErrorException(
         "Changes for existing employee were not sent to the " + "distributed cache.");
   }
   if (!((AbstractSession) getSession())
       .compareObjects(distributedEmployee.getManager(), manager)) {
     throw new TestErrorException(
         "Relationship between employee and manager was not "
             + "properly maintained in distributed cache.");
   }
 }
  public void setup() {
    Employee emp = (Employee) getSomeEmployees().firstElement();

    String ejbqlString;

    ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE ";
    ejbqlString = ejbqlString + emp.getSalary();
    ejbqlString = ejbqlString + " = ABS(emp.salary)";
    setEjbqlString(ejbqlString);
    setOriginalOject(emp);
    super.setup();
  }
  /** Create a new employee and commit. */
  public void test() {
    employee = (Employee) getSession().readObject(Employee.class, expression);

    UnitOfWork uow = getSession().acquireUnitOfWork();
    Employee employeeClone = (Employee) uow.registerObject(employee);
    employeeClone.setSalary(employeeClone.getSalary() + 1);
    manager = new Employee();
    manager.setFirstName("Fred");
    manager.setLastName("Fenster");
    Employee managerClone = (Employee) uow.registerObject(manager);
    employeeClone.setManager(managerClone);
    uow.commit();
  }
  public void setup() {
    setTestEmployees(getExtraEmployees());
    Employee emp = (Employee) getTestEmployees().firstElement();

    double salarySquareRoot = Math.sqrt((new Double(emp.getSalary()).doubleValue()));
    String ejbqlString;

    ejbqlString = "SELECT OBJECT(emp) FROM Employee emp WHERE ";
    ejbqlString = ejbqlString + "SQRT(emp.salary) = ";
    ejbqlString = ejbqlString + salarySquareRoot;
    setEjbqlString(ejbqlString);
    setOriginalOject(emp);
    super.setup();
  }
  public void test() {

    ReadObjectQuery query = new ReadObjectQuery();
    query.setReferenceClass(Employee.class);
    query.setExampleObject(employee);
    query.setQueryByExamplePolicy(policy);
    Employee emp = new Employee();
    emp = (Employee) getSession().executeQuery(query);
    if (!(emp.getFirstName().charAt(0) == 'J')
        && (emp.getFirstName().charAt(3) == 'l')
        && (emp.getLastName().charAt(0) == 'M')) {
      throw (new TestErrorException("Error in using specail operators."));
    }
    if (!(emp.getSalary() < 60000)) {
      throw (new TestErrorException("Error is using spcial operators."));
    }
  }