Search in sources :

Example 1 with Client

use of org.eclipse.persistence.testing.models.aggregate.Client in project eclipselink by eclipse-ee4j.

the class DistributedServersModel method addTests.

@Override
public void addTests() {
    PopulationManager manager = PopulationManager.getDefaultManager();
    Employee employee = (Employee) manager.getObject(Employee.class, "0001");
    // Tests with using unit of work.
    ComplexUpdateTest test = new UpdateToNullTest(employee);
    addTest(test);
    test = new UpdateChangeValueTest(employee);
    addTest(test);
    test = new UpdateChangeNothingTest(employee);
    addTest(test);
    test = new UpdateChangeObjectTest(employee);
    addTest(test);
    // bug 205939
    addTest(new UpdateChangeObjectTestEmployee1((Employee1) manager.getObject(Employee1.class, "example1")));
    // cr 4143
    addTest(new UpdateCollectionWithNewValueTest(employee));
    addTest(new VerifyDeletedObjectsTest());
    addTest(new VerifyObjectsDeletedFromCacheTest());
    addTest(new InsertNewCycleTest());
    addTest(new InsertNewObjectIntoCycleTest());
    // CR 4080
    addTest(new VerifyAggregateCollectionObjectsDeletedFromCacheTest((Agent) manager.getObject(Agent.class, "example1")));
    addTest(new VerifyAggregateCollectionObjectsDeletedFromCacheTest((Builder) manager.getObject(Builder.class, "example1")));
    // cr 4143
    addTest(new VerifyAggregateCollectionNewObjectTest((Agent) manager.getObject(Agent.class, "example1")));
    addTest(new VerifyAggregateCollectionNewObjectTest((Builder) manager.getObject(Builder.class, "example1")));
    // bug 3443422
    addTest(new UpdateChangeObjectWithOptimisticLockTest(employee));
    // bug 3485635
    addTest(new StoredInObjectOptimisticLockTest((Client) manager.getObject(Client.class, "example1")));
}
Also used : Agent(org.eclipse.persistence.testing.models.aggregate.Agent) Builder(org.eclipse.persistence.testing.models.aggregate.Builder) Employee1(org.eclipse.persistence.testing.models.aggregate.Employee1) Employee(org.eclipse.persistence.testing.models.employee.domain.Employee) PopulationManager(org.eclipse.persistence.tools.schemaframework.PopulationManager) Client(org.eclipse.persistence.testing.models.aggregate.Client)

Example 2 with Client

use of org.eclipse.persistence.testing.models.aggregate.Client in project eclipselink by eclipse-ee4j.

the class AggregateTestModel 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("AggregateReadObjectTestSuite");
    suite.setDescription("This suite test the reading of each object in the aggregate model.");
    // =====================================
    Class<Employee1> employee1Class = Employee1.class;
    // ======================================
    Class<Employee> employeeClass = Employee.class;
    Class<Client> clientClass = Client.class;
    Class<EvaluationClient> evaluationClientClass = EvaluationClient.class;
    PopulationManager manager = PopulationManager.getDefaultManager();
    // ===============================================================================
    suite.addTest(new ReadObjectTest(manager.getObject(employee1Class, "example1")));
    suite.addTest(new ReadObjectTest(manager.getObject(employee1Class, "example2")));
    // ==================================================================================
    suite.addTest(new ReadObjectTest(manager.getObject(employeeClass, "example1")));
    suite.addTest(new ReadObjectTest(manager.getObject(employeeClass, "example2")));
    suite.addTest(new ReadObjectTest(manager.getObject(employeeClass, "example3")));
    suite.addTest(new ReadObjectTest(manager.getObject(clientClass, "example1")));
    suite.addTest(new ReadObjectTest(manager.getObject(clientClass, "example2")));
    suite.addTest(new ReadObjectTest(manager.getObject(clientClass, "example3")));
    suite.addTest(new ReadObjectTest(manager.getObject(evaluationClientClass, "example1")));
    suite.addTest(new ReadObjectTest(manager.getObject(evaluationClientClass, "example2")));
    suite.addTest(new ReadObjectTest(manager.getObject(evaluationClientClass, "example3")));
    // aggregate collection read
    suite.addTest(new ReadObjectTest(manager.getObject(Agent.class, "example1")));
    if (useNewAggregateCollection) {
        suite.addTest(new ReadObjectTest(manager.getObject(Builder.class, "example1")));
    }
    return suite;
}
Also used : Employee(org.eclipse.persistence.testing.models.aggregate.Employee) TestSuite(org.eclipse.persistence.testing.framework.TestSuite) PopulationManager(org.eclipse.persistence.tools.schemaframework.PopulationManager) EvaluationClient(org.eclipse.persistence.testing.models.aggregate.EvaluationClient) Client(org.eclipse.persistence.testing.models.aggregate.Client) EvaluationClient(org.eclipse.persistence.testing.models.aggregate.EvaluationClient) ReadObjectTest(org.eclipse.persistence.testing.framework.ReadObjectTest) Employee1(org.eclipse.persistence.testing.models.aggregate.Employee1)

Example 3 with Client

use of org.eclipse.persistence.testing.models.aggregate.Client in project eclipselink by eclipse-ee4j.

the class AggregateTestModel 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("AggregateDeleteObjectTestSuite");
    suite.setDescription("This suite tests the deletion of each object in the aggregate model.");
    Class<Employee> employeeClass = Employee.class;
    Class<Client> clientClass = Client.class;
    Class<EvaluationClient> evaluationClientClass = EvaluationClient.class;
    PopulationManager manager = PopulationManager.getDefaultManager();
    suite.addTest(new DeleteObjectTest(manager.getObject(employeeClass, "example1")));
    suite.addTest(new DeleteObjectTest(manager.getObject(employeeClass, "example2")));
    suite.addTest(new DeleteObjectTest(manager.getObject(employeeClass, "example3")));
    suite.addTest(new DeleteObjectTest(manager.getObject(clientClass, "example1")));
    suite.addTest(new DeleteObjectTest(manager.getObject(clientClass, "example2")));
    suite.addTest(new DeleteObjectTest(manager.getObject(clientClass, "example3")));
    suite.addTest(new DeleteObjectTest(manager.getObject(evaluationClientClass, "example1")));
    suite.addTest(new DeleteObjectTest(manager.getObject(evaluationClientClass, "example2")));
    suite.addTest(new DeleteObjectTest(manager.getObject(evaluationClientClass, "example3")));
    // aggregate 1:m delete test
    suite.addTest(new DeleteObjectTest(manager.getObject(Agent.class, "example1")));
    suite.addTest(new VerifyCascadeDelete(Agent.class));
    suite.addTest(new AggregateCollectionClearTest(Agent.class));
    if (useNewAggregateCollection) {
        suite.addTest(new DeleteObjectTest(manager.getObject(Builder.class, "example1")));
        suite.addTest(new VerifyCascadeDelete(Builder.class));
        suite.addTest(new AggregateCollectionClearTest(Builder.class));
    }
    return suite;
}
Also used : Agent(org.eclipse.persistence.testing.models.aggregate.Agent) Builder(org.eclipse.persistence.testing.models.aggregate.Builder) DeleteObjectTest(org.eclipse.persistence.testing.framework.DeleteObjectTest) Employee(org.eclipse.persistence.testing.models.aggregate.Employee) TestSuite(org.eclipse.persistence.testing.framework.TestSuite) PopulationManager(org.eclipse.persistence.tools.schemaframework.PopulationManager) EvaluationClient(org.eclipse.persistence.testing.models.aggregate.EvaluationClient) Client(org.eclipse.persistence.testing.models.aggregate.Client) EvaluationClient(org.eclipse.persistence.testing.models.aggregate.EvaluationClient)

Example 4 with Client

use of org.eclipse.persistence.testing.models.aggregate.Client in project eclipselink by eclipse-ee4j.

the class AggregateTestModel method getSRGUnitOfWorkTestSuite.

// SRG test set is maintained by QA only, do NOT add any new tests into it.
public static TestSuite getSRGUnitOfWorkTestSuite() {
    TestSuite suite = new TestSuite();
    suite.setName("AggregateUnitOfWorkTestSuite");
    suite.setDescription("This suite tests updating objects with UOW in the aggregate model.");
    Class<Employee> employeeClass = Employee.class;
    Class<Client> clientClass = Client.class;
    PopulationManager manager = PopulationManager.getDefaultManager();
    suite.addTest(new UnitOfWorkTest(manager.getObject(employeeClass, "example1")));
    suite.addTest(new UnitOfWorkTest(manager.getObject(employeeClass, "example2")));
    suite.addTest(new UnitOfWorkTest(manager.getObject(employeeClass, "example3")));
    /*    suite.addTest(new DeletionUnitOfWorkTest(manager.getObject(clientClass, "example1")));
            suite.addTest(new DeleteObjectTest(manager.getObject(clientClass, "example2")));
            suite.addTest(new DeleteObjectTest(manager.getObject(clientClass, "example3"))); */
    // aggregate collection UoW test
    suite.addTest(new AggregateCollectionUoWTest(manager.getObject(Agent.class, "example1")));
    suite.addTest(new AggregateCollectionMultipleUoWTest(manager.getObject(Agent.class, "example1")));
    // aggregate with transformation mapping test
    suite.addTest(new TransformationMappingTest());
    // For CR#2285, handle adding nulls to a collection.
    suite.addTest(new AddNullToAggregateCollectionTest((Agent) manager.getObject(Agent.class, "example1")));
    if (useNewAggregateCollection) {
        suite.addTest(new AggregateCollectionUoWTest(manager.getObject(Builder.class, "example1")));
        suite.addTest(new AggregateCollectionMultipleUoWTest(manager.getObject(Builder.class, "example1")));
        suite.addTest(new AddNullToAggregateCollectionTest((Builder) manager.getObject(Builder.class, "example1")));
    }
    return suite;
}
Also used : Agent(org.eclipse.persistence.testing.models.aggregate.Agent) Builder(org.eclipse.persistence.testing.models.aggregate.Builder) Employee(org.eclipse.persistence.testing.models.aggregate.Employee) TestSuite(org.eclipse.persistence.testing.framework.TestSuite) PopulationManager(org.eclipse.persistence.tools.schemaframework.PopulationManager) Client(org.eclipse.persistence.testing.models.aggregate.Client) EvaluationClient(org.eclipse.persistence.testing.models.aggregate.EvaluationClient)

Example 5 with Client

use of org.eclipse.persistence.testing.models.aggregate.Client in project eclipselink by eclipse-ee4j.

the class StoredInObjectOptimisticLockTest method changeObject.

@Override
protected void changeObject() {
    Client client = (Client) this.workingCopy;
    // Transformation
    client.setName("Name:" + System.currentTimeMillis());
}
Also used : Client(org.eclipse.persistence.testing.models.aggregate.Client)

Aggregations

Client (org.eclipse.persistence.testing.models.aggregate.Client)8 PopulationManager (org.eclipse.persistence.tools.schemaframework.PopulationManager)6 TestSuite (org.eclipse.persistence.testing.framework.TestSuite)5 Employee (org.eclipse.persistence.testing.models.aggregate.Employee)5 EvaluationClient (org.eclipse.persistence.testing.models.aggregate.EvaluationClient)5 Agent (org.eclipse.persistence.testing.models.aggregate.Agent)3 Builder (org.eclipse.persistence.testing.models.aggregate.Builder)3 Employee1 (org.eclipse.persistence.testing.models.aggregate.Employee1)3 Session (org.eclipse.persistence.sessions.Session)1 DeleteObjectTest (org.eclipse.persistence.testing.framework.DeleteObjectTest)1 ReadObjectTest (org.eclipse.persistence.testing.framework.ReadObjectTest)1 TestErrorException (org.eclipse.persistence.testing.framework.TestErrorException)1 UnitOfWorkBasicUpdateObjectTest (org.eclipse.persistence.testing.framework.UnitOfWorkBasicUpdateObjectTest)1 WriteObjectTest (org.eclipse.persistence.testing.framework.WriteObjectTest)1 Employee (org.eclipse.persistence.testing.models.employee.domain.Employee)1