Search in sources :

Example 1 with LargeProject

use of org.eclipse.persistence.testing.models.employee.domain.LargeProject 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 2 with LargeProject

use of org.eclipse.persistence.testing.models.employee.domain.LargeProject in project eclipselink by eclipse-ee4j.

the class EmployeeChangeFlagBasicTestModel method getDeleteObjectTestSuite.

public static TestSuite getDeleteObjectTestSuite() {
    TestSuite suite = new TestSuite();
    suite.setName("EmployeeDeleteObjectTestSuite");
    suite.setDescription("This suite tests the deletion 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 EmployeeDeleteTest(manager.getObject(employeeClass, "0001")));
    suite.addTest(new EmployeeDeleteTest(manager.getObject(employeeClass, "0002")));
    suite.addTest(new EmployeeDeleteTest(manager.getObject(employeeClass, "0003")));
    suite.addTest(new EmployeeDeleteTest(manager.getObject(employeeClass, "0004")));
    suite.addTest(new EmployeeDeleteTest(manager.getObject(employeeClass, "0005")));
    suite.addTest(new ProjectDeleteTest(manager.getObject(smallProjectClass, "0001")));
    suite.addTest(new ProjectDeleteTest(manager.getObject(smallProjectClass, "0002")));
    suite.addTest(new ProjectDeleteTest(manager.getObject(smallProjectClass, "0003")));
    suite.addTest(new ProjectDeleteTest(manager.getObject(largeProjectClass, "0001")));
    suite.addTest(new ProjectDeleteTest(manager.getObject(largeProjectClass, "0002")));
    suite.addTest(new ProjectDeleteTest(manager.getObject(largeProjectClass, "0003")));
    return suite;
}
Also used : SmallProject(org.eclipse.persistence.testing.models.employee.domain.SmallProject) EmployeeDeleteTest(org.eclipse.persistence.testing.tests.employee.EmployeeDeleteTest) ProjectDeleteTest(org.eclipse.persistence.testing.tests.employee.ProjectDeleteTest) Employee(org.eclipse.persistence.testing.models.employee.domain.Employee) TestSuite(org.eclipse.persistence.testing.framework.TestSuite) PopulationManager(org.eclipse.persistence.tools.schemaframework.PopulationManager) LargeProject(org.eclipse.persistence.testing.models.employee.domain.LargeProject)

Example 3 with LargeProject

use of org.eclipse.persistence.testing.models.employee.domain.LargeProject in project eclipselink by eclipse-ee4j.

the class EmployeeChangeFlagBasicTestModel method getUpdateObjectTestSuite.

public static TestSuite getUpdateObjectTestSuite() {
    TestSuite suite = new TestSuite();
    suite.setName("EmployeeUpdateObjectTestSuite");
    suite.setDescription("This suite tests the updating 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 WriteObjectTest(manager.getObject(employeeClass, "0001")));
    suite.addTest(new WriteObjectTest(manager.getObject(employeeClass, "0002")));
    suite.addTest(new WriteObjectTest(manager.getObject(employeeClass, "0003")));
    suite.addTest(new WriteObjectTest(manager.getObject(employeeClass, "0004")));
    suite.addTest(new WriteObjectTest(manager.getObject(employeeClass, "0005")));
    suite.addTest(new WriteObjectTest(manager.getObject(smallProjectClass, "0001")));
    suite.addTest(new WriteObjectTest(manager.getObject(smallProjectClass, "0002")));
    suite.addTest(new WriteObjectTest(manager.getObject(smallProjectClass, "0003")));
    suite.addTest(new WriteObjectTest(manager.getObject(largeProjectClass, "0001")));
    suite.addTest(new WriteObjectTest(manager.getObject(largeProjectClass, "0002")));
    suite.addTest(new WriteObjectTest(manager.getObject(largeProjectClass, "0003")));
    return suite;
}
Also used : SmallProject(org.eclipse.persistence.testing.models.employee.domain.SmallProject) Employee(org.eclipse.persistence.testing.models.employee.domain.Employee) TestSuite(org.eclipse.persistence.testing.framework.TestSuite) WriteObjectTest(org.eclipse.persistence.testing.framework.WriteObjectTest) PopulationManager(org.eclipse.persistence.tools.schemaframework.PopulationManager) LargeProject(org.eclipse.persistence.testing.models.employee.domain.LargeProject)

Example 4 with LargeProject

use of org.eclipse.persistence.testing.models.employee.domain.LargeProject in project eclipselink by eclipse-ee4j.

the class SimultaneousTestsModel method getReadEmployeeTestSuite.

public static TestSuite getReadEmployeeTestSuite() {
    TestSuite suite = new TestSuite();
    suite.setName("Employee Multithread Test Suite");
    suite.setDescription("This suite tests the reading of all the objects of each class in the employee demo.");
    Vector tests = new Vector();
    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();
    tests.add(new ReadObjectTest(manager.getObject(employeeClass, "0001")));
    tests.add(new ReadObjectTest(manager.getObject(employeeClass, "0002")));
    tests.add(new ReadObjectTest(manager.getObject(employeeClass, "0003")));
    tests.add(new ReadObjectTest(manager.getObject(employeeClass, "0004")));
    tests.add(new ReadObjectTest(manager.getObject(employeeClass, "0005")));
    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())));
    tests.add(test);
    tests.add(new ReadObjectTest(manager.getObject(smallProjectClass, "0001")));
    tests.add(new ReadObjectTest(manager.getObject(smallProjectClass, "0002")));
    tests.add(new ReadObjectTest(manager.getObject(smallProjectClass, "0003")));
    tests.add(new ReadObjectTest(manager.getObject(largeProjectClass, "0001")));
    tests.add(new ReadObjectTest(manager.getObject(largeProjectClass, "0002")));
    tests.add(new ReadObjectTest(manager.getObject(largeProjectClass, "0003")));
    tests.add(new ReadAllTest(org.eclipse.persistence.testing.models.employee.domain.Employee.class, 12));
    tests.add(new ReadAllTest(org.eclipse.persistence.testing.models.employee.domain.Project.class, 15));
    tests.add(new ReadAllTest(org.eclipse.persistence.testing.models.employee.domain.LargeProject.class, 5));
    tests.add(new ReadAllTest(org.eclipse.persistence.testing.models.employee.domain.SmallProject.class, 10));
    suite.addTest(new MultithreadTestCase(tests));
    return suite;
}
Also used : SmallProject(org.eclipse.persistence.testing.models.employee.domain.SmallProject) LargeProject(org.eclipse.persistence.testing.models.employee.domain.LargeProject) SmallProject(org.eclipse.persistence.testing.models.employee.domain.SmallProject) Employee(org.eclipse.persistence.testing.models.employee.domain.Employee) PopulationManager(org.eclipse.persistence.tools.schemaframework.PopulationManager) Vector(java.util.Vector) LargeProject(org.eclipse.persistence.testing.models.employee.domain.LargeProject)

Example 5 with LargeProject

use of org.eclipse.persistence.testing.models.employee.domain.LargeProject in project eclipselink by eclipse-ee4j.

the class SessionsXMLBasicTestModel method getUpdateObjectTestSuite.

public static TestSuite getUpdateObjectTestSuite() {
    TestSuite suite = new TestSuite();
    suite.setName("EmployeeUpdateObjectTestSuite");
    suite.setDescription("This suite tests the updating of each object in the employee demo.");
    Class<Employee> employeeClass = Employee.class;
    Class<LargeProject> largeProjectClass = LargeProject.class;
    Class<SmallProject> smallProjectClass = SmallProject.class;
    PopulationManager manager = PopulationManager.getDefaultManager();
    suite.addTest(new WriteObjectTest(manager.getObject(employeeClass, "0001")));
    suite.addTest(new WriteObjectTest(manager.getObject(employeeClass, "0002")));
    suite.addTest(new WriteObjectTest(manager.getObject(employeeClass, "0003")));
    suite.addTest(new WriteObjectTest(manager.getObject(employeeClass, "0004")));
    suite.addTest(new WriteObjectTest(manager.getObject(employeeClass, "0005")));
    suite.addTest(new WriteObjectTest(manager.getObject(smallProjectClass, "0001")));
    suite.addTest(new WriteObjectTest(manager.getObject(smallProjectClass, "0002")));
    suite.addTest(new WriteObjectTest(manager.getObject(smallProjectClass, "0003")));
    suite.addTest(new WriteObjectTest(manager.getObject(largeProjectClass, "0001")));
    suite.addTest(new WriteObjectTest(manager.getObject(largeProjectClass, "0002")));
    suite.addTest(new WriteObjectTest(manager.getObject(largeProjectClass, "0003")));
    return suite;
}
Also used : SmallProject(org.eclipse.persistence.testing.models.employee.domain.SmallProject) Employee(org.eclipse.persistence.testing.models.employee.domain.Employee) TestSuite(org.eclipse.persistence.testing.framework.TestSuite) WriteObjectTest(org.eclipse.persistence.testing.framework.WriteObjectTest) PopulationManager(org.eclipse.persistence.tools.schemaframework.PopulationManager) LargeProject(org.eclipse.persistence.testing.models.employee.domain.LargeProject)

Aggregations

LargeProject (org.eclipse.persistence.testing.models.employee.domain.LargeProject)11 Employee (org.eclipse.persistence.testing.models.employee.domain.Employee)10 SmallProject (org.eclipse.persistence.testing.models.employee.domain.SmallProject)10 PopulationManager (org.eclipse.persistence.tools.schemaframework.PopulationManager)10 TestSuite (org.eclipse.persistence.testing.framework.TestSuite)9 ReadObjectTest (org.eclipse.persistence.testing.framework.ReadObjectTest)3 WriteObjectTest (org.eclipse.persistence.testing.framework.WriteObjectTest)3 Project (org.eclipse.persistence.testing.models.employee.domain.Project)3 EmployeeDeleteTest (org.eclipse.persistence.testing.tests.employee.EmployeeDeleteTest)3 ProjectDeleteTest (org.eclipse.persistence.testing.tests.employee.ProjectDeleteTest)3 Vector (java.util.Vector)1 DatabaseException (org.eclipse.persistence.exceptions.DatabaseException)1 SQLCall (org.eclipse.persistence.queries.SQLCall)1 UnitOfWork (org.eclipse.persistence.sessions.UnitOfWork)1 ReadObjectCallTest (org.eclipse.persistence.testing.framework.ReadObjectCallTest)1 TestErrorException (org.eclipse.persistence.testing.framework.TestErrorException)1