public static TestSuite getReadObjectTestSuite() {
    TestSuite suite = new TestSuite();
    suite.setName("EmployeeReadObjectTestSuite");
    suite.setDescription("This suite test the reading of each object in the employee demo.");

    Class employeeClass = Employee.class;
    PopulationManager manager = PopulationManager.getDefaultManager();

    suite.addTest(new ReadObjectTest(manager.getObject(employeeClass, "0001")));
    suite.addTest(new ReadObjectTest(manager.getObject(employeeClass, "0002")));
    suite.addTest(new ReadObjectTest(manager.getObject(employeeClass, "0003")));
    suite.addTest(new ReadObjectTest(manager.getObject(employeeClass, "0004")));
    suite.addTest(new ReadObjectTest(manager.getObject(employeeClass, "0005")));

    Employee employee = (Employee) manager.getObject(employeeClass, "0001");
    suite.addTest(
        new ReadObjectCallTest(
            employeeClass,
            new SQLCall(
                "SELECT VERSION, EMP_ID, L_NAME, F_NAME FROM UNIDIR_EMPLOYEE WHERE F_NAME = '"
                    + employee.getFirstName()
                    + "' AND L_NAME = '"
                    + employee.getLastName()
                    + "'")));
    employee = (Employee) manager.getObject(employeeClass, "0002");
    suite.addTest(
        new ReadObjectCallTest(
            employeeClass,
            new SQLCall(
                "SELECT VERSION, EMP_ID, L_NAME, F_NAME FROM UNIDIR_EMPLOYEE WHERE F_NAME = '"
                    + employee.getFirstName()
                    + "' AND L_NAME = '"
                    + employee.getLastName()
                    + "'")));
    employee = (Employee) manager.getObject(employeeClass, "0003");
    suite.addTest(
        new ReadObjectCallTest(
            employeeClass,
            new SQLCall(
                "SELECT VERSION, EMP_ID, L_NAME, F_NAME FROM UNIDIR_EMPLOYEE WHERE F_NAME = '"
                    + employee.getFirstName()
                    + "' AND L_NAME = '"
                    + employee.getLastName()
                    + "'")));

    return suite;
  }
  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."));
    }
  }
  private void createEmployeeAndSearchExpression() {
    // Create the example employee
    employee =
        (org.eclipse.persistence.testing.models.employee.domain.Employee)
            new org.eclipse.persistence.testing.models.employee.domain.EmployeePopulator()
                .basicEmployeeExample1();
    employee.setFirstName("Timugen");
    employee.setLastName("Singaera");
    employee.addResponsibility("Answer the phones.");

    // Create an expression to retreive the employee from the database
    ExpressionBuilder expressionBuilder = new ExpressionBuilder();
    Expression exp1;
    Expression exp2;
    Expression expression;

    exp1 = expressionBuilder.get("firstName").equal(employee.getFirstName());
    exp2 = expressionBuilder.get("lastName").equal(employee.getLastName());

    searchExpression = exp1.or(exp2);
  }
  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();
  }