Search in sources :

Example 6 with LargeProject

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

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

the class SessionsXMLBasicTestModel method getSRGReadObjectTestSuite.

// SRG test set is maintained by QA only, do NOT add any new tests into it.
public static TestSuite getSRGReadObjectTestSuite() {
    TestSuite suite = new TestSuite();
    suite.setName("EmployeeReadObjectTestSuite");
    suite.setDescription("This suite test the reading 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 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")));
    Project project = (Project) manager.getObject(largeProjectClass, "0001");
    ReadObjectTest test = new ReadObjectTest(project);
    test.setQuery(new org.eclipse.persistence.queries.ReadObjectQuery(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 : SmallProject(org.eclipse.persistence.testing.models.employee.domain.SmallProject) ReadObjectTest(org.eclipse.persistence.testing.framework.ReadObjectTest) LargeProject(org.eclipse.persistence.testing.models.employee.domain.LargeProject) Project(org.eclipse.persistence.testing.models.employee.domain.Project) 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) PopulationManager(org.eclipse.persistence.tools.schemaframework.PopulationManager) LargeProject(org.eclipse.persistence.testing.models.employee.domain.LargeProject)

Example 8 with LargeProject

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

the class SessionsXMLBasicTestModel method getSRGDeleteObjectTestSuite.

// SRG test set is maintained by QA only, do NOT add any new tests into it.
public static TestSuite getSRGDeleteObjectTestSuite() {
    TestSuite suite = new TestSuite();
    suite.setName("EmployeeDeleteObjectTestSuite");
    suite.setDescription("This suite tests the deletion 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 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) ProjectDeleteTest(org.eclipse.persistence.testing.tests.employee.ProjectDeleteTest) Employee(org.eclipse.persistence.testing.models.employee.domain.Employee) TestSuite(org.eclipse.persistence.testing.framework.TestSuite) EmployeeDeleteTest(org.eclipse.persistence.testing.tests.employee.EmployeeDeleteTest) PopulationManager(org.eclipse.persistence.tools.schemaframework.PopulationManager) LargeProject(org.eclipse.persistence.testing.models.employee.domain.LargeProject)

Example 9 with LargeProject

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

the class SessionBrokerPlatformTest method test.

@Override
public void test() {
    try {
        UnitOfWork uow = getSession().acquireUnitOfWork();
        LargeProject project = (LargeProject) uow.readObject(LargeProject.class);
        project.setDescription("Anything but what it was");
        project.setMilestoneVersion(new java.sql.Timestamp(System.currentTimeMillis()));
        uow.commit();
    } catch (DatabaseException exception) {
        throw new TestErrorException("Failed to use the Session Platform to generate SQL.  Instead used Broker platform");
    }
}
Also used : UnitOfWork(org.eclipse.persistence.sessions.UnitOfWork) TestErrorException(org.eclipse.persistence.testing.framework.TestErrorException) DatabaseException(org.eclipse.persistence.exceptions.DatabaseException) LargeProject(org.eclipse.persistence.testing.models.employee.domain.LargeProject)

Example 10 with LargeProject

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

the class SessionsXMLBasicTestModel 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 = Employee.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")));
    Project project = (Project) manager.getObject(largeProjectClass, "0001");
    ReadObjectTest test = new ReadObjectTest(project);
    test.setQuery(new org.eclipse.persistence.queries.ReadObjectQuery(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 : SmallProject(org.eclipse.persistence.testing.models.employee.domain.SmallProject) ReadObjectTest(org.eclipse.persistence.testing.framework.ReadObjectTest) LargeProject(org.eclipse.persistence.testing.models.employee.domain.LargeProject) Project(org.eclipse.persistence.testing.models.employee.domain.Project) 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) PopulationManager(org.eclipse.persistence.tools.schemaframework.PopulationManager) LargeProject(org.eclipse.persistence.testing.models.employee.domain.LargeProject)

Aggregations

LargeProject (org.eclipse.persistence.testing.models.employee.domain.LargeProject)11 Employee (org.eclipse.persistence.testing.models.employee.domain.Employee)10 SmallProject (org.eclipse.persistence.testing.models.employee.domain.SmallProject)10 PopulationManager (org.eclipse.persistence.tools.schemaframework.PopulationManager)10 TestSuite (org.eclipse.persistence.testing.framework.TestSuite)9 ReadObjectTest (org.eclipse.persistence.testing.framework.ReadObjectTest)3 WriteObjectTest (org.eclipse.persistence.testing.framework.WriteObjectTest)3 Project (org.eclipse.persistence.testing.models.employee.domain.Project)3 EmployeeDeleteTest (org.eclipse.persistence.testing.tests.employee.EmployeeDeleteTest)3 ProjectDeleteTest (org.eclipse.persistence.testing.tests.employee.ProjectDeleteTest)3 Vector (java.util.Vector)1 DatabaseException (org.eclipse.persistence.exceptions.DatabaseException)1 SQLCall (org.eclipse.persistence.queries.SQLCall)1 UnitOfWork (org.eclipse.persistence.sessions.UnitOfWork)1 ReadObjectCallTest (org.eclipse.persistence.testing.framework.ReadObjectCallTest)1 TestErrorException (org.eclipse.persistence.testing.framework.TestErrorException)1