Search in sources :

Example 1 with SmallProject

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

the class ManyToManyMergeTest method modifyCollection.

@Override
protected void modifyCollection(UnitOfWork uow, Object objectToModify) {
    SmallProject newSmallProjectWC = (SmallProject) uow.registerNewObject(newItemForCollection());
    ((Employee) objectToModify).addProject(newSmallProjectWC);
// newSmallProjectWC.setTeamLeader((Employee)objectToModify);
}
Also used : SmallProject(org.eclipse.persistence.testing.models.employee.domain.SmallProject) Employee(org.eclipse.persistence.testing.models.employee.domain.Employee)

Example 2 with SmallProject

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

the class ManyToManyMergeTest method newItemForCollection.

protected Object newItemForCollection() {
    SmallProject project = new SmallProject();
    project.setName("DUP TEST");
    project.setDescription("AT: " + System.currentTimeMillis());
    return project;
}
Also used : SmallProject(org.eclipse.persistence.testing.models.employee.domain.SmallProject)

Example 3 with SmallProject

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

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

use of org.eclipse.persistence.testing.models.employee.domain.SmallProject 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)

Aggregations

SmallProject (org.eclipse.persistence.testing.models.employee.domain.SmallProject)24 Employee (org.eclipse.persistence.testing.models.employee.domain.Employee)22 LargeProject (org.eclipse.persistence.testing.models.employee.domain.LargeProject)10 PopulationManager (org.eclipse.persistence.tools.schemaframework.PopulationManager)10 TestSuite (org.eclipse.persistence.testing.framework.TestSuite)9 UnitOfWork (org.eclipse.persistence.sessions.UnitOfWork)5 Address (org.eclipse.persistence.testing.models.employee.domain.Address)5 Project (org.eclipse.persistence.testing.models.employee.domain.Project)5 ReadObjectQuery (org.eclipse.persistence.queries.ReadObjectQuery)3 ReadObjectTest (org.eclipse.persistence.testing.framework.ReadObjectTest)3 WriteObjectTest (org.eclipse.persistence.testing.framework.WriteObjectTest)3 EmployeeDeleteTest (org.eclipse.persistence.testing.tests.employee.EmployeeDeleteTest)3 ProjectDeleteTest (org.eclipse.persistence.testing.tests.employee.ProjectDeleteTest)3 Vector (java.util.Vector)2 UnitOfWorkImpl (org.eclipse.persistence.internal.sessions.UnitOfWorkImpl)2 TestErrorException (org.eclipse.persistence.testing.framework.TestErrorException)2 PhoneNumber (org.eclipse.persistence.testing.models.employee.domain.PhoneNumber)2 Enumeration (java.util.Enumeration)1 Expression (org.eclipse.persistence.expressions.Expression)1 ExpressionBuilder (org.eclipse.persistence.expressions.ExpressionBuilder)1