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);
}
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;
}
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;
}
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;
}
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;
}
Aggregations