Search in sources :

Example 6 with PopulationManager

use of org.eclipse.persistence.tools.schemaframework.PopulationManager in project eclipselink by eclipse-ee4j.

the class MappingTestModel method getTransformationMappingTestSuite.

public static TestSuite getTransformationMappingTestSuite() {
    TestSuite suite = new TestSuite();
    suite.setName("MappingTransformationTestSuite");
    suite.setDescription("This suite tests the reading of objects where the transformation mapping uses two parameters in the accessor method");
    PopulationManager manager = PopulationManager.getDefaultManager();
    suite.addTest(new TwoParametersTransformationMappingTest(manager.getObject(Address.class, "example1")));
    suite.addTest(new TwoParametersTransformationMappingTest(manager.getObject(Address.class, "example2")));
    return suite;
}
Also used : TestSuite(org.eclipse.persistence.testing.framework.TestSuite) PopulationManager(org.eclipse.persistence.tools.schemaframework.PopulationManager)

Example 7 with PopulationManager

use of org.eclipse.persistence.tools.schemaframework.PopulationManager in project eclipselink by eclipse-ee4j.

the class NLSEmployeeBasicTestModel method getReadObjectTestSuite.

public static TestSuite getReadObjectTestSuite() {
    TestSuite suite = new TestSuite();
    suite.setName("EmployeeReadObjectTestSuite");
    suite.setDescription("[NLS_Japanese] This suite test the reading of each object in the employee demo.");
    Class<NLSEmployee> employeeClass = NLSEmployee.class;
    Class<LargeProject> largeProjectClass = LargeProject.class;
    Class<SmallProject> smallProjectClass = 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")));
    NLSEmployee employee = (NLSEmployee) manager.getObject(employeeClass, "0001");
    suite.addTest(new ReadObjectCallTest(employeeClass, new SQLCall("SELECT t0.\u306b\u304a\u3064\u3066\u3051\u305d\u305b, t1.\u304a\u3059\u305f_\u3051\u3048, t0.\u3057_\u305b\u3042\u3059\u304a, t0.\u304b_\u305b\u3042\u3059\u304a, t1.\u3066\u3042\u3057\u3042\u3064\u306e, t0.\u304a\u3059\u305f_\u3051\u3048, t0.\u304d\u304a\u305b\u3048\u304a\u3064, t0.\u304a\u305b\u3048_\u3048\u3042\u3068\u304a, t0.\u3066\u3068\u3042\u3064\u3068_\u3048\u3042\u3068\u304a, t0.\u3059\u3042\u305b\u3042\u304d\u304a\u3064_\u3051\u3048, t0.\u304a\u305b\u3048_\u3068\u3051\u3059\u304a, t0.\u3066\u3068\u3042\u3064\u3068_\u3068\u3051\u3059\u304a, t0.\u3042\u3048\u3048\u3064_\u3051\u3048 FROM \u304a\u3059\u305f t0, \u3066\u3042\u3057\u3042\u3064\u306e t1 WHERE t1.\u304a\u3059\u305f_\u3051\u3048 = t0.\u304a\u3059\u305f_\u3051\u3048 AND t0.\u304b_\u305b\u3042\u3059\u304a = '" + employee.getFirstName() + "' AND t0.\u3057_\u305b\u3042\u3059\u304a = '" + employee.getLastName() + "'")));
    employee = (NLSEmployee) manager.getObject(employeeClass, "0002");
    suite.addTest(new ReadObjectCallTest(employeeClass, new SQLCall("SELECT  t0.\u306b\u304a\u3064\u3066\u3051\u305d\u305b, t1.\u304a\u3059\u305f_\u3051\u3048, t0.\u3057_\u305b\u3042\u3059\u304a, t0.\u304b_\u305b\u3042\u3059\u304a, t1.\u3066\u3042\u3057\u3042\u3064\u306e, t0.\u304a\u3059\u305f_\u3051\u3048, t0.\u304d\u304a\u305b\u3048\u304a\u3064, t0.\u304a\u305b\u3048_\u3048\u3042\u3068\u304a, t0.\u3066\u3068\u3042\u3064\u3068_\u3048\u3042\u3068\u304a, t0.\u3059\u3042\u305b\u3042\u304d\u304a\u3064_\u3051\u3048, t0.\u304a\u305b\u3048_\u3068\u3051\u3059\u304a, t0.\u3066\u3068\u3042\u3064\u3068_\u3068\u3051\u3059\u304a, t0.\u3042\u3048\u3048\u3064_\u3051\u3048 FROM \u304a\u3059\u305f t0, \u3066\u3042\u3057\u3042\u3064\u306e t1 WHERE t1.\u304a\u3059\u305f_\u3051\u3048 = t0.\u304a\u3059\u305f_\u3051\u3048 AND t0.\u304b_\u305b\u3042\u3059\u304a = '" + employee.getFirstName() + "' AND t0.\u3057_\u305b\u3042\u3059\u304a = '" + employee.getLastName() + "'")));
    employee = (NLSEmployee) manager.getObject(employeeClass, "0003");
    suite.addTest(new ReadObjectCallTest(employeeClass, new SQLCall("SELECT  t0.\u306b\u304a\u3064\u3066\u3051\u305d\u305b, t1.\u304a\u3059\u305f_\u3051\u3048, t0.\u3057_\u305b\u3042\u3059\u304a, t0.\u304b_\u305b\u3042\u3059\u304a, t1.\u3066\u3042\u3057\u3042\u3064\u306e, t0.\u304a\u3059\u305f_\u3051\u3048, t0.\u304d\u304a\u305b\u3048\u304a\u3064, t0.\u304a\u305b\u3048_\u3048\u3042\u3068\u304a, t0.\u3066\u3068\u3042\u3064\u3068_\u3048\u3042\u3068\u304a, t0.\u3059\u3042\u305b\u3042\u304d\u304a\u3064_\u3051\u3048, t0.\u304a\u305b\u3048_\u3068\u3051\u3059\u304a, t0.\u3066\u3068\u3042\u3064\u3068_\u3068\u3051\u3059\u304a, t0.\u3042\u3048\u3048\u3064_\u3051\u3048 FROM \u304a\u3059\u305f t0, \u3066\u3042\u3057\u3042\u3064\u306e t1 WHERE t1.\u304a\u3059\u305f_\u3051\u3048 = t0.\u304a\u3059\u305f_\u3051\u3048 AND t0.\u304b_\u305b\u3042\u3059\u304a = '" + employee.getFirstName() + "' AND t0.\u3057_\u305b\u3042\u3059\u304a = '" + employee.getLastName() + "'")));
    Project project = (Project) manager.getObject(largeProjectClass, "0001");
    ReadObjectTest test = new ReadObjectTest(project);
    test.setQuery(new org.eclipse.persistence.queries.ReadObjectQuery(Project.class, new 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) ExpressionBuilder(org.eclipse.persistence.expressions.ExpressionBuilder) ReadObjectTest(org.eclipse.persistence.testing.framework.ReadObjectTest) ReadObjectCallTest(org.eclipse.persistence.testing.framework.ReadObjectCallTest) PopulationManager(org.eclipse.persistence.tools.schemaframework.PopulationManager)

Example 8 with PopulationManager

use of org.eclipse.persistence.tools.schemaframework.PopulationManager in project eclipselink by eclipse-ee4j.

the class NLSEmployeeBasicTestModel method getDeleteObjectTestSuite.

public static TestSuite getDeleteObjectTestSuite() {
    TestSuite suite = new TestSuite();
    suite.setName("EmployeeDeleteObjectTestSuite");
    suite.setDescription("[NLS_Japanese] This suite tests the deletion of each object in the employee demo.");
    Class<NLSEmployee> employeeClass = NLSEmployee.class;
    Class<LargeProject> largeProjectClass = LargeProject.class;
    Class<SmallProject> smallProjectClass = SmallProject.class;
    PopulationManager manager = PopulationManager.getDefaultManager();
    suite.addTest(new NLSEmployeeDeleteTest(manager.getObject(employeeClass, "0001")));
    suite.addTest(new NLSEmployeeDeleteTest(manager.getObject(employeeClass, "0002")));
    suite.addTest(new NLSEmployeeDeleteTest(manager.getObject(employeeClass, "0003")));
    suite.addTest(new NLSEmployeeDeleteTest(manager.getObject(employeeClass, "0004")));
    suite.addTest(new NLSEmployeeDeleteTest(manager.getObject(employeeClass, "0005")));
    suite.addTest(new NLSProjectDeleteTest(manager.getObject(smallProjectClass, "0001")));
    suite.addTest(new NLSProjectDeleteTest(manager.getObject(smallProjectClass, "0002")));
    suite.addTest(new NLSProjectDeleteTest(manager.getObject(smallProjectClass, "0003")));
    suite.addTest(new NLSProjectDeleteTest(manager.getObject(largeProjectClass, "0001")));
    suite.addTest(new NLSProjectDeleteTest(manager.getObject(largeProjectClass, "0002")));
    suite.addTest(new NLSProjectDeleteTest(manager.getObject(largeProjectClass, "0003")));
    return suite;
}
Also used : PopulationManager(org.eclipse.persistence.tools.schemaframework.PopulationManager)

Example 9 with PopulationManager

use of org.eclipse.persistence.tools.schemaframework.PopulationManager in project eclipselink by eclipse-ee4j.

the class OuterJoinWithMultipleTablesTestModel method getReadObjectTestSuite.

public static TestSuite getReadObjectTestSuite() {
    TestSuite suite = new TestSuite();
    suite.setName("OuterJoinWithMultipleTablesReadObjectTestSuite");
    suite.setDescription("This suite tests the reading of each object in the outer join test model.");
    PopulationManager manager = PopulationManager.getDefaultManager();
    suite.addTest(new ReadObjectTest(manager.getObject(Student.class, "example1")));
    suite.addTest(new ReadObjectTest(manager.getObject(Student.class, "example5")));
    suite.addTest(new ReadObjectTest(manager.getObject(Student.class, "example3")));
    return suite;
}
Also used : PopulationManager(org.eclipse.persistence.tools.schemaframework.PopulationManager)

Example 10 with PopulationManager

use of org.eclipse.persistence.tools.schemaframework.PopulationManager in project eclipselink by eclipse-ee4j.

the class OuterJoinWithMultipleTablesTestModel method getUpdateObjectTestSuite.

public static TestSuite getUpdateObjectTestSuite() {
    TestSuite suite = new TestSuite();
    suite.setName("OuterJoinWithMultipleTablesUpdateObjectTestSuite");
    suite.setDescription("This suite tests the updating of each object in the Outer join test model.");
    PopulationManager manager = PopulationManager.getDefaultManager();
    suite.addTest(new WriteObjectTest(manager.getObject(Student.class, "example2")));
    suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(Student.class, "example2")));
    suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(Student.class, "example3")));
    suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(Student.class, "example4")));
    suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(Student.class, "example5")));
    return suite;
}
Also used : PopulationManager(org.eclipse.persistence.tools.schemaframework.PopulationManager)

Aggregations

PopulationManager (org.eclipse.persistence.tools.schemaframework.PopulationManager)89 TestSuite (org.eclipse.persistence.testing.framework.TestSuite)37 Employee (org.eclipse.persistence.testing.models.employee.domain.Employee)16 LargeProject (org.eclipse.persistence.testing.models.employee.domain.LargeProject)11 SmallProject (org.eclipse.persistence.testing.models.employee.domain.SmallProject)11 ReadObjectTest (org.eclipse.persistence.testing.framework.ReadObjectTest)10 WriteObjectTest (org.eclipse.persistence.testing.framework.WriteObjectTest)8 Client (org.eclipse.persistence.testing.models.aggregate.Client)6 Employee (org.eclipse.persistence.testing.models.aggregate.Employee)6 SQLCall (org.eclipse.persistence.queries.SQLCall)5 Agent (org.eclipse.persistence.testing.models.aggregate.Agent)5 Builder (org.eclipse.persistence.testing.models.aggregate.Builder)5 EvaluationClient (org.eclipse.persistence.testing.models.aggregate.EvaluationClient)5 ComplexUpdateTest (org.eclipse.persistence.testing.tests.writing.ComplexUpdateTest)5 UpdateChangeNothingTest (org.eclipse.persistence.testing.tests.writing.UpdateChangeNothingTest)5 UpdateChangeObjectTest (org.eclipse.persistence.testing.tests.writing.UpdateChangeObjectTest)5 UpdateChangeValueTest (org.eclipse.persistence.testing.tests.writing.UpdateChangeValueTest)5 UpdateToNullTest (org.eclipse.persistence.testing.tests.writing.UpdateToNullTest)5 org.eclipse.persistence.testing.models.employee.domain (org.eclipse.persistence.testing.models.employee.domain)4 EmployeeDeleteTest (org.eclipse.persistence.testing.tests.employee.EmployeeDeleteTest)4