use of org.eclipse.persistence.testing.models.employee.domain.EmployeePopulator in project eclipselink by eclipse-ee4j.
the class SessionsXMLBasicTestModel method getInsertObjectTestSuite.
public static TestSuite getInsertObjectTestSuite() {
TestSuite suite = new TestSuite();
suite.setName("EmployeeInsertObjectTestSuite");
suite.setDescription("This suite tests the insertion of each object in the employee demo.");
EmployeePopulator system = new EmployeePopulator();
suite.addTest(new InsertObjectTest(system.basicEmployeeExample1()));
suite.addTest(new InsertObjectTest(system.basicEmployeeExample2()));
suite.addTest(new InsertObjectTest(system.basicEmployeeExample3()));
suite.addTest(new InsertObjectTest(system.basicEmployeeExample4()));
suite.addTest(new InsertObjectTest(system.basicEmployeeExample5()));
suite.addTest(new InsertObjectTest(system.basicSmallProjectExample1()));
suite.addTest(new InsertObjectTest(system.basicSmallProjectExample2()));
suite.addTest(new InsertObjectTest(system.basicSmallProjectExample3()));
suite.addTest(new InsertObjectTest(system.basicLargeProjectExample1()));
suite.addTest(new InsertObjectTest(system.basicLargeProjectExample2()));
suite.addTest(new InsertObjectTest(system.basicLargeProjectExample3()));
return suite;
}
use of org.eclipse.persistence.testing.models.employee.domain.EmployeePopulator in project eclipselink by eclipse-ee4j.
the class SessionsXMLBasicTestModel method getSRGInsertObjectTestSuite.
// SRG test set is maintained by QA only, do NOT add any new tests into it.
public static TestSuite getSRGInsertObjectTestSuite() {
TestSuite suite = new TestSuite();
suite.setName("EmployeeInsertObjectTestSuite");
suite.setDescription("This suite tests the insertion of each object in the employee demo.");
EmployeePopulator system = new EmployeePopulator();
suite.addTest(new InsertObjectTest(system.basicEmployeeExample1()));
suite.addTest(new InsertObjectTest(system.basicEmployeeExample2()));
suite.addTest(new InsertObjectTest(system.basicEmployeeExample3()));
suite.addTest(new InsertObjectTest(system.basicEmployeeExample4()));
suite.addTest(new InsertObjectTest(system.basicEmployeeExample5()));
suite.addTest(new InsertObjectTest(system.basicSmallProjectExample1()));
suite.addTest(new InsertObjectTest(system.basicSmallProjectExample2()));
suite.addTest(new InsertObjectTest(system.basicSmallProjectExample3()));
suite.addTest(new InsertObjectTest(system.basicLargeProjectExample1()));
suite.addTest(new InsertObjectTest(system.basicLargeProjectExample2()));
suite.addTest(new InsertObjectTest(system.basicLargeProjectExample3()));
return suite;
}
use of org.eclipse.persistence.testing.models.employee.domain.EmployeePopulator in project eclipselink by eclipse-ee4j.
the class CloseConnAfterDatabaseSessionTxnTest method test.
@Override
public void test() {
EmployeePopulator system = new EmployeePopulator();
Object employee = system.basicEmployeeExample1();
session.insertObject(employee);
session.deleteObject(employee);
}
use of org.eclipse.persistence.testing.models.employee.domain.EmployeePopulator in project eclipselink by eclipse-ee4j.
the class NestedUnitOfWorkTest method changeNestedUnitOfWorkWorkingCopy.
protected void changeNestedUnitOfWorkWorkingCopy() {
Employee employee = (Employee) this.nestedUnitOfWorkWorkingCopy;
// Transformation
employee.setNormalHours(new java.sql.Time[3]);
employee.setStartTime(Helper.timeFromHourMinuteSecond(2, 2, 2));
employee.setEndTime(Helper.timeFromHourMinuteSecond(2, 2, 2));
// Aggregate
employee.setPeriod(new EmploymentPeriod(Helper.dateFromYearMonthDate(1903, 3, 3), Helper.dateFromYearMonthDate(1904, 4, 4)));
// One to many private
employee.setPhoneNumbers(new Vector());
employee.addPhoneNumber(new PhoneNumber("cell", "514", "2263374"));
employee.addPhoneNumber(new PhoneNumber("shop", "509", "8224599"));
employee.addPhoneNumber(new PhoneNumber("fax", "509", "8224798"));
// Many to many
employee.setProjects(new Vector());
employee.addProject((Project) this.nestedUnitOfWork.readObject(SmallProject.class));
// Test adding new objects.
employee.addProject(new SmallProject());
employee.addProject(new SmallProject());
// Direct collection
employee.setResponsibilitiesList(new Vector());
employee.addResponsibility("does not make cofffee");
employee.addResponsibility("does not buy donuts");
// One to one private/public
employee.setAddress((new EmployeePopulator()).addressExample1());
}
use of org.eclipse.persistence.testing.models.employee.domain.EmployeePopulator in project eclipselink by eclipse-ee4j.
the class NestedUnitOfWorkDeleteNewObjectTest method test.
@Override
public void test() {
UnitOfWork uow = getSession().acquireUnitOfWork();
UnitOfWork nestedUow1 = uow.acquireUnitOfWork();
Employee original = (Employee) new EmployeePopulator().basicEmployeeExample1();
Employee employee = (Employee) nestedUow1.registerObject(original);
nestedUow1.commit();
UnitOfWork nestedUOW2 = uow.acquireUnitOfWork();
nestedUOW2.deleteObject(nestedUOW2.registerObject(original));
nestedUOW2.commit();
uow.commit();
if (((UnitOfWorkImpl) uow).getNewObjectsCloneToOriginal().containsKey(original)) {
throw new TestErrorException("Failed to move the deleted new object into the parent UOW");
}
}
Aggregations