Search in sources :

Example 1 with Employee1

use of org.eclipse.persistence.testing.models.aggregate.Employee1 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 Employee1

use of org.eclipse.persistence.testing.models.aggregate.Employee1 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 Employee1

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

the class AggregateMappingNullNotAllow method test.

@Override
public void test() {
    boolean Error = false;
    try {
        Employee1 example = new Employee1();
        example.setName("Rick");
        example.setId(23);
        example.setSalary(33000);
        example.setStatus("EclipseLink");
        example.setAddress(WorkingAddress.example2());
        example.businessAddress = HomeAddress.example1();
        UnitOfWork uow = getSession().acquireUnitOfWork();
        uow.registerObject(example);
        uow.commit();
        uow = getSession().acquireUnitOfWork();
        Employee1 empClone = (Employee1) uow.registerObject(example);
        empClone.setAddress(null);
        uow.commit();
    } catch (EclipseLinkException exp) {
        Error = true;
        if (exp.getErrorCode() == (DescriptorException.NULL_FOR_NON_NULL_AGGREGATE)) {
            return;
        }
    }
    if (Error == false) {
        throw new TestErrorException("Test Error.  No exception was thrown");
    }
}
Also used : Employee1(org.eclipse.persistence.testing.models.aggregate.Employee1)

Example 4 with Employee1

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

the class AggregateTestModel method getSRGReadAllTestSuite.

// SRG test set is maintained by QA only, do NOT add any new tests into it.
public static TestSuite getSRGReadAllTestSuite() {
    TestSuite suite = new TestSuite();
    suite.setName("AggregateReadAllTestSuite");
    suite.setDescription("This suite tests the reading of all the objects of each class in the aggregate model.");
    suite.addTest(new ReadAllTest(Employee1.class, 2));
    // ====================
    suite.addTest(new ReadAllTest(Employee.class, 3));
    suite.addTest(new ReadAllTest(Client.class, 3));
    suite.addTest(new ReadAllTest(EvaluationClient.class, 3));
    // aggregate collection read all
    suite.addTest(new ReadAllTest(Agent.class, 1));
    // Added May 5, 2000 - Jon D. for pr381
    suite.addTest(new ReadAllTest(Transport.class, 4));
    // Bug 2847621
    suite.addTest(new AggregateCollectionOuterJoinTest(Agent.class));
    if (useNewAggregateCollection) {
        suite.addTest(new ReadAllTest(Builder.class, 1));
        suite.addTest(new AggregateCollectionOuterJoinTest(Builder.class));
    }
    return suite;
}
Also used : Agent(org.eclipse.persistence.testing.models.aggregate.Agent) Employee(org.eclipse.persistence.testing.models.aggregate.Employee) TestSuite(org.eclipse.persistence.testing.framework.TestSuite) ReadAllTest(org.eclipse.persistence.testing.framework.ReadAllTest) Builder(org.eclipse.persistence.testing.models.aggregate.Builder) EvaluationClient(org.eclipse.persistence.testing.models.aggregate.EvaluationClient) Client(org.eclipse.persistence.testing.models.aggregate.Client) EvaluationClient(org.eclipse.persistence.testing.models.aggregate.EvaluationClient) Transport(org.eclipse.persistence.testing.models.aggregate.Transport) Employee1(org.eclipse.persistence.testing.models.aggregate.Employee1)

Example 5 with Employee1

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

the class AggregateTestModel 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("AggregateUpdateObjectTestSuite");
    suite.setDescription("This suite tests the updating 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 WriteObjectTest(manager.getObject(employee1Class, "example1")));
    suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(employee1Class, "example1")));
    suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(employee1Class, "example2")));
    // =================================================================================
    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")));
    suite.addTest(new WriteObjectTest(manager.getObject(clientClass, "example1")));
    suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(clientClass, "example1")));
    suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(clientClass, "example2")));
    suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(clientClass, "example3")));
    suite.addTest(new WriteObjectTest(manager.getObject(evaluationClientClass, "example1")));
    suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(evaluationClientClass, "example1")));
    suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(evaluationClientClass, "example2")));
    suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(evaluationClientClass, "example3")));
    // update testing on aggregate collection mapping
    suite.addTest(new WriteObjectTest(manager.getObject(Agent.class, "example1")));
    suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(Agent.class, "example1")));
    if (useNewAggregateCollection) {
        suite.addTest(new WriteObjectTest(manager.getObject(Builder.class, "example1")));
        suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(Builder.class, "example1")));
    }
    return suite;
}
Also used : Employee(org.eclipse.persistence.testing.models.aggregate.Employee) 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) EvaluationClient(org.eclipse.persistence.testing.models.aggregate.EvaluationClient) Client(org.eclipse.persistence.testing.models.aggregate.Client) EvaluationClient(org.eclipse.persistence.testing.models.aggregate.EvaluationClient) Employee1(org.eclipse.persistence.testing.models.aggregate.Employee1)

Aggregations

Employee1 (org.eclipse.persistence.testing.models.aggregate.Employee1)5 Client (org.eclipse.persistence.testing.models.aggregate.Client)4 TestSuite (org.eclipse.persistence.testing.framework.TestSuite)3 Employee (org.eclipse.persistence.testing.models.aggregate.Employee)3 EvaluationClient (org.eclipse.persistence.testing.models.aggregate.EvaluationClient)3 PopulationManager (org.eclipse.persistence.tools.schemaframework.PopulationManager)3 Agent (org.eclipse.persistence.testing.models.aggregate.Agent)2 Builder (org.eclipse.persistence.testing.models.aggregate.Builder)2 ReadAllTest (org.eclipse.persistence.testing.framework.ReadAllTest)1 ReadObjectTest (org.eclipse.persistence.testing.framework.ReadObjectTest)1 UnitOfWorkBasicUpdateObjectTest (org.eclipse.persistence.testing.framework.UnitOfWorkBasicUpdateObjectTest)1 WriteObjectTest (org.eclipse.persistence.testing.framework.WriteObjectTest)1 Transport (org.eclipse.persistence.testing.models.aggregate.Transport)1 Employee (org.eclipse.persistence.testing.models.employee.domain.Employee)1