Search in sources :

Example 1 with ReadObjectCallTest

use of org.eclipse.persistence.testing.framework.ReadObjectCallTest in project eclipselink by eclipse-ee4j.

the class NLSEmployeeBasicTestModel method getReadObjectTestSuite.

public static TestSuite getReadObjectTestSuite() {
    TestSuite suite = new TestSuite();
    suite.setName("EmployeeReadObjectTestSuite");
    suite.setDescription("[NLS_Japanese] This suite test the reading of each object in the employee demo.");
    Class<NLSEmployee> employeeClass = NLSEmployee.class;
    Class<LargeProject> largeProjectClass = LargeProject.class;
    Class<SmallProject> smallProjectClass = SmallProject.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")));
    NLSEmployee employee = (NLSEmployee) manager.getObject(employeeClass, "0001");
    suite.addTest(new ReadObjectCallTest(employeeClass, new SQLCall("SELECT t0.\u306b\u304a\u3064\u3066\u3051\u305d\u305b, t1.\u304a\u3059\u305f_\u3051\u3048, t0.\u3057_\u305b\u3042\u3059\u304a, t0.\u304b_\u305b\u3042\u3059\u304a, t1.\u3066\u3042\u3057\u3042\u3064\u306e, t0.\u304a\u3059\u305f_\u3051\u3048, t0.\u304d\u304a\u305b\u3048\u304a\u3064, t0.\u304a\u305b\u3048_\u3048\u3042\u3068\u304a, t0.\u3066\u3068\u3042\u3064\u3068_\u3048\u3042\u3068\u304a, t0.\u3059\u3042\u305b\u3042\u304d\u304a\u3064_\u3051\u3048, t0.\u304a\u305b\u3048_\u3068\u3051\u3059\u304a, t0.\u3066\u3068\u3042\u3064\u3068_\u3068\u3051\u3059\u304a, t0.\u3042\u3048\u3048\u3064_\u3051\u3048 FROM \u304a\u3059\u305f t0, \u3066\u3042\u3057\u3042\u3064\u306e t1 WHERE t1.\u304a\u3059\u305f_\u3051\u3048 = t0.\u304a\u3059\u305f_\u3051\u3048 AND t0.\u304b_\u305b\u3042\u3059\u304a = '" + employee.getFirstName() + "' AND t0.\u3057_\u305b\u3042\u3059\u304a = '" + employee.getLastName() + "'")));
    employee = (NLSEmployee) manager.getObject(employeeClass, "0002");
    suite.addTest(new ReadObjectCallTest(employeeClass, new SQLCall("SELECT  t0.\u306b\u304a\u3064\u3066\u3051\u305d\u305b, t1.\u304a\u3059\u305f_\u3051\u3048, t0.\u3057_\u305b\u3042\u3059\u304a, t0.\u304b_\u305b\u3042\u3059\u304a, t1.\u3066\u3042\u3057\u3042\u3064\u306e, t0.\u304a\u3059\u305f_\u3051\u3048, t0.\u304d\u304a\u305b\u3048\u304a\u3064, t0.\u304a\u305b\u3048_\u3048\u3042\u3068\u304a, t0.\u3066\u3068\u3042\u3064\u3068_\u3048\u3042\u3068\u304a, t0.\u3059\u3042\u305b\u3042\u304d\u304a\u3064_\u3051\u3048, t0.\u304a\u305b\u3048_\u3068\u3051\u3059\u304a, t0.\u3066\u3068\u3042\u3064\u3068_\u3068\u3051\u3059\u304a, t0.\u3042\u3048\u3048\u3064_\u3051\u3048 FROM \u304a\u3059\u305f t0, \u3066\u3042\u3057\u3042\u3064\u306e t1 WHERE t1.\u304a\u3059\u305f_\u3051\u3048 = t0.\u304a\u3059\u305f_\u3051\u3048 AND t0.\u304b_\u305b\u3042\u3059\u304a = '" + employee.getFirstName() + "' AND t0.\u3057_\u305b\u3042\u3059\u304a = '" + employee.getLastName() + "'")));
    employee = (NLSEmployee) manager.getObject(employeeClass, "0003");
    suite.addTest(new ReadObjectCallTest(employeeClass, new SQLCall("SELECT  t0.\u306b\u304a\u3064\u3066\u3051\u305d\u305b, t1.\u304a\u3059\u305f_\u3051\u3048, t0.\u3057_\u305b\u3042\u3059\u304a, t0.\u304b_\u305b\u3042\u3059\u304a, t1.\u3066\u3042\u3057\u3042\u3064\u306e, t0.\u304a\u3059\u305f_\u3051\u3048, t0.\u304d\u304a\u305b\u3048\u304a\u3064, t0.\u304a\u305b\u3048_\u3048\u3042\u3068\u304a, t0.\u3066\u3068\u3042\u3064\u3068_\u3048\u3042\u3068\u304a, t0.\u3059\u3042\u305b\u3042\u304d\u304a\u3064_\u3051\u3048, t0.\u304a\u305b\u3048_\u3068\u3051\u3059\u304a, t0.\u3066\u3068\u3042\u3064\u3068_\u3068\u3051\u3059\u304a, t0.\u3042\u3048\u3048\u3064_\u3051\u3048 FROM \u304a\u3059\u305f t0, \u3066\u3042\u3057\u3042\u3064\u306e t1 WHERE t1.\u304a\u3059\u305f_\u3051\u3048 = t0.\u304a\u3059\u305f_\u3051\u3048 AND t0.\u304b_\u305b\u3042\u3059\u304a = '" + employee.getFirstName() + "' AND t0.\u3057_\u305b\u3042\u3059\u304a = '" + employee.getLastName() + "'")));
    Project project = (Project) manager.getObject(largeProjectClass, "0001");
    ReadObjectTest test = new ReadObjectTest(project);
    test.setQuery(new org.eclipse.persistence.queries.ReadObjectQuery(Project.class, new ExpressionBuilder().get("id").equal(project.getId())));
    suite.addTest(test);
    suite.addTest(new ReadObjectTest(manager.getObject(smallProjectClass, "0001")));
    suite.addTest(new ReadObjectTest(manager.getObject(smallProjectClass, "0002")));
    suite.addTest(new ReadObjectTest(manager.getObject(smallProjectClass, "0003")));
    suite.addTest(new ReadObjectTest(manager.getObject(largeProjectClass, "0001")));
    suite.addTest(new ReadObjectTest(manager.getObject(largeProjectClass, "0002")));
    suite.addTest(new ReadObjectTest(manager.getObject(largeProjectClass, "0003")));
    return suite;
}
Also used : SQLCall(org.eclipse.persistence.queries.SQLCall) ExpressionBuilder(org.eclipse.persistence.expressions.ExpressionBuilder) ReadObjectTest(org.eclipse.persistence.testing.framework.ReadObjectTest) ReadObjectCallTest(org.eclipse.persistence.testing.framework.ReadObjectCallTest) PopulationManager(org.eclipse.persistence.tools.schemaframework.PopulationManager)

Example 2 with ReadObjectCallTest

use of org.eclipse.persistence.testing.framework.ReadObjectCallTest in project eclipselink by eclipse-ee4j.

the class EmployeeChangeFlagBasicTestModel method getReadObjectTestSuite.

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<Employee> employeeClass = org.eclipse.persistence.testing.models.employee.domain.Employee.class;
    Class<LargeProject> largeProjectClass = org.eclipse.persistence.testing.models.employee.domain.LargeProject.class;
    Class<SmallProject> smallProjectClass = org.eclipse.persistence.testing.models.employee.domain.SmallProject.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 t0.VERSION, t1.EMP_ID, t0.L_NAME, t0.F_NAME, t1.SALARY, t0.EMP_ID, t0.GENDER, t0.END_DATE, t0.START_DATE, t0.MANAGER_ID, t0.END_TIME, t0.START_TIME, t0.ADDR_ID FROM EMPLOYEE t0, SALARY t1 WHERE t1.EMP_ID = t0.EMP_ID AND t0.F_NAME = '" + employee.getFirstName() + "' AND t0.L_NAME = '" + employee.getLastName() + "'")));
    employee = (Employee) manager.getObject(employeeClass, "0002");
    suite.addTest(new ReadObjectCallTest(employeeClass, new SQLCall("SELECT  t0.VERSION, t1.EMP_ID, t0.L_NAME, t0.F_NAME, t1.SALARY, t0.EMP_ID, t0.GENDER, t0.END_DATE, t0.START_DATE, t0.MANAGER_ID, t0.END_TIME, t0.START_TIME, t0.ADDR_ID FROM EMPLOYEE t0, SALARY t1 WHERE t1.EMP_ID = t0.EMP_ID AND t0.F_NAME = '" + employee.getFirstName() + "' AND t0.L_NAME = '" + employee.getLastName() + "'")));
    employee = (Employee) manager.getObject(employeeClass, "0003");
    suite.addTest(new ReadObjectCallTest(employeeClass, new SQLCall("SELECT  t0.VERSION, t1.EMP_ID, t0.L_NAME, t0.F_NAME, t1.SALARY, t0.EMP_ID, t0.GENDER, t0.END_DATE, t0.START_DATE, t0.MANAGER_ID, t0.END_TIME, t0.START_TIME, t0.ADDR_ID FROM EMPLOYEE t0, SALARY t1 WHERE t1.EMP_ID = t0.EMP_ID AND t0.F_NAME = '" + employee.getFirstName() + "' AND t0.L_NAME = '" + employee.getLastName() + "'")));
    org.eclipse.persistence.testing.models.employee.domain.Project project = (org.eclipse.persistence.testing.models.employee.domain.Project) manager.getObject(largeProjectClass, "0001");
    ReadObjectTest test = new ReadObjectTest(project);
    test.setQuery(new org.eclipse.persistence.queries.ReadObjectQuery(org.eclipse.persistence.testing.models.employee.domain.Project.class, new org.eclipse.persistence.expressions.ExpressionBuilder().get("id").equal(project.getId())));
    suite.addTest(test);
    suite.addTest(new ReadObjectTest(manager.getObject(smallProjectClass, "0001")));
    suite.addTest(new ReadObjectTest(manager.getObject(smallProjectClass, "0002")));
    suite.addTest(new ReadObjectTest(manager.getObject(smallProjectClass, "0003")));
    suite.addTest(new ReadObjectTest(manager.getObject(largeProjectClass, "0001")));
    suite.addTest(new ReadObjectTest(manager.getObject(largeProjectClass, "0002")));
    suite.addTest(new ReadObjectTest(manager.getObject(largeProjectClass, "0003")));
    return suite;
}
Also used : SQLCall(org.eclipse.persistence.queries.SQLCall) SmallProject(org.eclipse.persistence.testing.models.employee.domain.SmallProject) ReadObjectTest(org.eclipse.persistence.testing.framework.ReadObjectTest) ReadObjectCallTest(org.eclipse.persistence.testing.framework.ReadObjectCallTest) Project(org.eclipse.persistence.testing.models.employee.domain.Project) SmallProject(org.eclipse.persistence.testing.models.employee.domain.SmallProject) LargeProject(org.eclipse.persistence.testing.models.employee.domain.LargeProject) Employee(org.eclipse.persistence.testing.models.employee.domain.Employee) TestSuite(org.eclipse.persistence.testing.framework.TestSuite) Project(org.eclipse.persistence.testing.models.employee.domain.Project) PopulationManager(org.eclipse.persistence.tools.schemaframework.PopulationManager) LargeProject(org.eclipse.persistence.testing.models.employee.domain.LargeProject)

Example 3 with ReadObjectCallTest

use of org.eclipse.persistence.testing.framework.ReadObjectCallTest in project eclipselink by eclipse-ee4j.

the class JPQLSimpleSelectTestSuite method addTests.

@Override
public void addTests() {
    addSpecialTest(new SelectSimpleAbsTest());
    addTest(new SelectSimpleBetweenTest());
    addTest(new SelectSimpleBetweenAndTest());
    addTest(SelectSimpleBooleanTest.getSimpleTrueTest());
    addTest(SelectSimpleBooleanTest.getSimpleFalseTest());
    addTest(SelectSimpleBooleanTest.getSimpleNotEqualsTrueTest());
    addTest(SelectSimpleBooleanTest.getSimpleNotEqualsFalseTest());
    addTest(new SelectSimpleConcatTest());
    addTest(new SelectSimpleDoubleOrTest());
    addTest(new SelectSimpleEqualsTest());
    addTest(new SelectSimpleEqualsBracketsTest());
    addTest(new SelectSimpleEqualsMultipleDots());
    addTest(new SelectSimpleEqualsWithAs());
    addTest(new SelectSimpleFromFailed());
    addTest(new SelectSimpleInTest());
    addTest(new SelectSimpleInOneDotTest());
    // addTest(new SelectSimpleInClauseInFromEmployeeManagerAndPhoneNumbers());
    addTest(new SelectSimpleLengthTest());
    addTest(new SelectSimpleLikeTest());
    addTest(new SelectSimpleLikeEscapeTest());
    addTest(new SelectSimpleNotBetweenTest());
    addTest(new SelectSimpleNotEqualsVariablesIngeter());
    addTest(new SelectSimpleNotInTest());
    addTest(new SelectSimpleNotLikeTest());
    addTest(new SelectSimpleOrTest());
    addTest(new SelectSimpleParameterTest());
    addSpecialTest(new SelectSimpleReverseAbsTest());
    addTest(new SelectSimpleReverseConcatTest());
    addTest(new SelectSimpleReverseEqualsTest());
    addTest(new SelectSimpleReverseLengthTest());
    addTest(new SelectSimpleReverseParameterTest());
    addSpecialTest2(new SelectSimpleReverseSqrtTest());
    addTest(new SelectSimpleReverseSubstringTest());
    addSpecialTest2(new SelectSimpleSqrtTest());
    addTest(new SelectSimpleSubstringTest());
    // SELECT tests
    // addTest(new SimpleSelectPhoneNumber());
    // BAD EJBQL
    // addTest(new SimpleSelectPhoneNumberFullyQualifiedInSELECT());
    // addTest(new SimpleSelectPhoneNumberWithEmployee());
    // BAD EJBQL
    // addTest(new SimpleSelectPhoneNumberWithEmployeeWithExplicitJoin());
    // BAD EJBQL
    // addTest(new SimpleSelectPhoneNumberWithEmployeeWithFirstNameFirst());
    // SELECT changing the reference class tests
    // addTest(new SimpleSelectPhoneNumberOwnerAddressesUsingInClause());
    // SELECT attribute tests
    // addTest(new SimpleSelectPhoneNumberAreaCode());
    // EJBQL no longer valid
    // addTest(new SimpleSelectPhoneNumberAreaCodeFullyQualifiedInSELECT());
    // addTest(new SimpleSelectPhoneNumberAreaCodeWithEmployee());
    // EJBQL no longer valid
    // addTest(new SimpleSelectPhoneNumberNumberWithEmployeeWithExplicitJoin());
    // addTest(new SimpleSelectPhoneNumberNumberWithEmployeeWithFirstNameFirst());
    // SELECT from CALLS
    addTest(new ReadObjectCallTest(Employee.class, new JPQLCall("SELECT OBJECT(emp) FROM Employee emp")));
    addTest(new ReadAllCallTest(Employee.class, 12, new JPQLCall("SELECT OBJECT(emp) FROM Employee emp")));
    addTest(new SelectSimpleMemberOfTest());
    addTest(new SelectSimpleMemberOfWithParameterTest());
    addTest(new SelectSimpleNotMemberOfWithParameterTest());
    addTest(new SelectSimpleBetweenWithParametersTest());
    addTest(SelectSimpleNullTest.getSimpleNullTest());
    addTest(SelectSimpleNullTest.getSimpleNotNullTest());
}
Also used : ReadObjectCallTest(org.eclipse.persistence.testing.framework.ReadObjectCallTest) ReadAllCallTest(org.eclipse.persistence.testing.framework.ReadAllCallTest)

Aggregations

ReadObjectCallTest (org.eclipse.persistence.testing.framework.ReadObjectCallTest)3 SQLCall (org.eclipse.persistence.queries.SQLCall)2 ReadObjectTest (org.eclipse.persistence.testing.framework.ReadObjectTest)2 PopulationManager (org.eclipse.persistence.tools.schemaframework.PopulationManager)2 ExpressionBuilder (org.eclipse.persistence.expressions.ExpressionBuilder)1 ReadAllCallTest (org.eclipse.persistence.testing.framework.ReadAllCallTest)1 TestSuite (org.eclipse.persistence.testing.framework.TestSuite)1 Employee (org.eclipse.persistence.testing.models.employee.domain.Employee)1 LargeProject (org.eclipse.persistence.testing.models.employee.domain.LargeProject)1 Project (org.eclipse.persistence.testing.models.employee.domain.Project)1 SmallProject (org.eclipse.persistence.testing.models.employee.domain.SmallProject)1