Search in sources :

Example 6 with WriteObjectTest

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

the class SessionsXMLBasicTestModel method getSRGUpdateObjectTestSuite.

// SRG test set is maintained by QA only, do NOT add any new tests into it.
public static TestSuite getSRGUpdateObjectTestSuite() {
    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)

Example 7 with WriteObjectTest

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

the class CustomSQLTestModel method getUpdateObjectTestSuite.

public static TestSuite getUpdateObjectTestSuite() {
    TestSuite suite = new TestSuite();
    suite.setName("CustomSQLUpdateObjectTestSuite");
    suite.setDescription("This suite tests update sql.");
    Class<Employee> employeeClass = Employee.class;
    PopulationManager manager = PopulationManager.getDefaultManager();
    suite.addTest(new WriteObjectTest(manager.getObject(employeeClass, "0001")));
    suite.addTest(new WriteObjectTest(manager.getObject(employeeClass, "0005")));
    suite.addTest(new WriteObjectTest(manager.getObject(SmallProject.class, "0003")));
    suite.addTest(new WriteObjectTest(manager.getObject(LargeProject.class, "0001")));
    suite.addTest(new SetCustomSQLQueryTest("UPDATE EMPLOYEE SET F_NAME = 'Fatima?' WHERE L_NAME = 'Smith'"));
    Vector v = new Vector();
    v.addElement("L_NAME");
    Vector myV = new Vector();
    myV.addElement("Smith");
    suite.addTest(new SetCustomSQLQueryTest("UPDATE EMPLOYEE SET F_NAME = 'Fatima' WHERE L_NAME = #L_NAME", v, myV));
    return suite;
}
Also used : WriteObjectTest(org.eclipse.persistence.testing.framework.WriteObjectTest)

Example 8 with WriteObjectTest

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

the class MappingTestModel method getUpdateObjectTestSuite.

public static TestSuite getUpdateObjectTestSuite() {
    TestSuite suite = new TestSuite();
    suite.setName("MappingUpdateObjectTestSuite");
    suite.setDescription("This suite tests the updating of each object in the mapping model.");
    PopulationManager manager = PopulationManager.getDefaultManager();
    suite.addTest(new WriteObjectTest(manager.getObject(Employee.class, "example1")));
    suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(Employee.class, "example1")));
    suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(Employee.class, "example2")));
    suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(Employee.class, "example3")));
    suite.addTest(new WriteObjectTest(manager.getObject(Shipment.class, "example1")));
    suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(Shipment.class, "example1")));
    suite.addTest(new AddObjectNonPrimaryKeyManyToManyTest());
    return suite;
}
Also used : UnitOfWorkBasicUpdateObjectTest(org.eclipse.persistence.testing.framework.UnitOfWorkBasicUpdateObjectTest) TestSuite(org.eclipse.persistence.testing.framework.TestSuite) WriteObjectTest(org.eclipse.persistence.testing.framework.WriteObjectTest) PopulationManager(org.eclipse.persistence.tools.schemaframework.PopulationManager)

Example 9 with WriteObjectTest

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

the class MappingTestModel method getAdditionalJoinTest.

public static TestSuite getAdditionalJoinTest() {
    TestSuite suite = new TestSuite();
    suite.setName("AdditionalJoinTestSuite");
    suite.setDescription("This suite tests the addition of an additionalJoinExpression.");
    suite.addTest(new AdditionalJoinExpressionTest());
    PopulationManager manager = PopulationManager.getDefaultManager();
    suite.addTest(new MultipleTableReadObjectTest(manager.getObject(Employee1.class, "example1"), "amendEmployee1WithJoinWithInsert"));
    suite.addTest(new MultipleTableReadObjectTest(manager.getObject(Employee1.class, "example1"), "amendEmployee1WithFKInfo"));
    suite.addTest(new MultipleTableReadObjectTest(manager.getObject(Employee1.class, "example1"), "amendEmployee1WithJoinOnly"));
    suite.addTest(new MultipleTableInsertObjectTest(manager.getObject(Employee1.class, "example2"), "amendEmployee1WithJoinWithInsert"));
    suite.addTest(new MultipleTableInsertObjectTest(manager.getObject(Employee1.class, "example2"), "amendEmployee1WithFKInfo"));
    suite.addTest(new MultipleTableReadAllTest(Employee1.class, 2, "amendEmployee1WithJoinWithInsert"));
    suite.addTest(new MultipleTableReadAllTest(Employee1.class, 2, "amendEmployee1WithJoinOnly"));
    suite.addTest(new MultipleTableReadAllTest(Employee1.class, 2, "amendEmployee1WithFKInfo"));
    // The delete with join info would not work because of the lack of PK info.
    suite.addTest(new MultipleTableDeleteObjectTest(manager.getObject(Employee1.class, "example3"), "amendEmployee1WithFKInfo"));
    // The update with join info would not work because of the lack of PK info.
    suite.addTest(new MultipleTableWriteObjectTest(manager.getObject(Employee1.class, "example3"), "amendEmployee1WithFKInfo"));
    // Add tests for multiple table with fk from secondary table to primary table.
    suite.addTest(new ReadObjectTest(manager.getObject(Employee2.class, "example1")));
    suite.addTest(new WriteObjectTest(manager.getObject(Employee2.class, "example1")));
    suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(Employee2.class, "example1")));
    suite.addTest(new DeleteObjectTest(manager.getObject(Employee2.class, "example1")));
    suite.addTest(new InsertObjectTest(manager.getObject(Employee2.class, "example2")));
    return suite;
}
Also used : WriteObjectTest(org.eclipse.persistence.testing.framework.WriteObjectTest) DeleteObjectTest(org.eclipse.persistence.testing.framework.DeleteObjectTest) ReadObjectTest(org.eclipse.persistence.testing.framework.ReadObjectTest) Employee1(org.eclipse.persistence.testing.models.mapping.Employee1) InsertObjectTest(org.eclipse.persistence.testing.framework.InsertObjectTest) UnitOfWorkBasicUpdateObjectTest(org.eclipse.persistence.testing.framework.UnitOfWorkBasicUpdateObjectTest) TestSuite(org.eclipse.persistence.testing.framework.TestSuite) PopulationManager(org.eclipse.persistence.tools.schemaframework.PopulationManager)

Example 10 with WriteObjectTest

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

the class LegacyTestModel method getUpdateObjectTestSuite.

public static TestSuite getUpdateObjectTestSuite() {
    TestSuite suite = new TestSuite();
    suite.setName("LegacyUpdateObjectTestSuite");
    suite.setDescription("This suite tests the updating of each object in the mapping model.");
    Class<Employee> employeeClass = Employee.class;
    PopulationManager manager = PopulationManager.getDefaultManager();
    suite.addTest(new WriteObjectTest(manager.getObject(employeeClass, "example1")));
    suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(employeeClass, "example1")));
    suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(employeeClass, "example2")));
    suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(employeeClass, "example3")));
    return suite;
}
Also used : Employee(org.eclipse.persistence.testing.models.legacy.Employee) WriteObjectTest(org.eclipse.persistence.testing.framework.WriteObjectTest)

Aggregations

WriteObjectTest (org.eclipse.persistence.testing.framework.WriteObjectTest)12 TestSuite (org.eclipse.persistence.testing.framework.TestSuite)8 PopulationManager (org.eclipse.persistence.tools.schemaframework.PopulationManager)8 UnitOfWorkBasicUpdateObjectTest (org.eclipse.persistence.testing.framework.UnitOfWorkBasicUpdateObjectTest)3 Employee (org.eclipse.persistence.testing.models.employee.domain.Employee)3 LargeProject (org.eclipse.persistence.testing.models.employee.domain.LargeProject)3 SmallProject (org.eclipse.persistence.testing.models.employee.domain.SmallProject)3 Vector (java.util.Vector)1 DeleteObjectTest (org.eclipse.persistence.testing.framework.DeleteObjectTest)1 InsertObjectTest (org.eclipse.persistence.testing.framework.InsertObjectTest)1 ReadObjectTest (org.eclipse.persistence.testing.framework.ReadObjectTest)1 Client (org.eclipse.persistence.testing.models.aggregate.Client)1 Employee (org.eclipse.persistence.testing.models.aggregate.Employee)1 Employee1 (org.eclipse.persistence.testing.models.aggregate.Employee1)1 EvaluationClient (org.eclipse.persistence.testing.models.aggregate.EvaluationClient)1 Claim (org.eclipse.persistence.testing.models.insurance.Claim)1 HousePolicy (org.eclipse.persistence.testing.models.insurance.HousePolicy)1 Policy (org.eclipse.persistence.testing.models.insurance.Policy)1 PolicyHolder (org.eclipse.persistence.testing.models.insurance.PolicyHolder)1 Employee (org.eclipse.persistence.testing.models.legacy.Employee)1