Search in sources :

Example 1 with DeleteObjectTest

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

the class MappingTestModel method getDeleteObjectTestSuite.

public static TestSuite getDeleteObjectTestSuite() {
    TestSuite suite = new TestSuite();
    suite.setName("MappingDeleteObjectTestSuite");
    suite.setDescription("This suite tests the deletion of each object in the mapping model.");
    PopulationManager manager = PopulationManager.getDefaultManager();
    suite.addTest(new DeleteObjectTest(manager.getObject(Employee.class, "example1")));
    suite.addTest(new DeleteObjectTest(manager.getObject(Employee.class, "example2")));
    suite.addTest(new DeleteObjectTest(manager.getObject(Employee.class, "example3")));
    suite.addTest(new DeleteObjectTest(manager.getObject(Computer.class, "example2")));
    suite.addTest(new DeleteObjectTest(manager.getObject(Shipment.class, "example2")));
    suite.addTest(new MTMPrivateOwnedWithValueholderDeleteObjectTest());
    suite.addTest(new DirectCollectionMappingDeleteNullValueTest());
    return suite;
}
Also used : TestSuite(org.eclipse.persistence.testing.framework.TestSuite) PopulationManager(org.eclipse.persistence.tools.schemaframework.PopulationManager) DeleteObjectTest(org.eclipse.persistence.testing.framework.DeleteObjectTest)

Example 2 with DeleteObjectTest

use of org.eclipse.persistence.testing.framework.DeleteObjectTest 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 3 with DeleteObjectTest

use of org.eclipse.persistence.testing.framework.DeleteObjectTest 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 4 with DeleteObjectTest

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

the class LegacyTestModel method getDeleteObjectTestSuite.

public static TestSuite getDeleteObjectTestSuite() {
    TestSuite suite = new TestSuite();
    suite.setName("LegacyDeleteObjectTestSuite");
    suite.setDescription("This suite tests the deletion of each object in the mapping model.");
    Class<Employee> employeeClass = Employee.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")));
    return suite;
}
Also used : Employee(org.eclipse.persistence.testing.models.legacy.Employee) DeleteObjectTest(org.eclipse.persistence.testing.framework.DeleteObjectTest)

Example 5 with DeleteObjectTest

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

the class CollectionsTestModel method getDeleteObjectTestSuite.

public static TestSuite getDeleteObjectTestSuite() {
    TestSuite suite = new TestSuite();
    suite.setName("CollectionsDeleteObjectTestSuite");
    suite.setDescription("This suite tests the deletion of each object in the collections model.");
    PopulationManager manager = PopulationManager.getDefaultManager();
    suite.addTest(new DeleteObjectTest(manager.getObject(Restaurant.class, "example1")));
    suite.addTest(new DeleteObjectTest(manager.getObject(Restaurant.class, "example2")));
    suite.addTest(new OTMPrivateOwnedDeleteObjectTest());
    return suite;
}
Also used : DeleteObjectTest(org.eclipse.persistence.testing.framework.DeleteObjectTest)

Aggregations

DeleteObjectTest (org.eclipse.persistence.testing.framework.DeleteObjectTest)5 TestSuite (org.eclipse.persistence.testing.framework.TestSuite)3 PopulationManager (org.eclipse.persistence.tools.schemaframework.PopulationManager)3 InsertObjectTest (org.eclipse.persistence.testing.framework.InsertObjectTest)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 Agent (org.eclipse.persistence.testing.models.aggregate.Agent)1 Builder (org.eclipse.persistence.testing.models.aggregate.Builder)1 Client (org.eclipse.persistence.testing.models.aggregate.Client)1 Employee (org.eclipse.persistence.testing.models.aggregate.Employee)1 EvaluationClient (org.eclipse.persistence.testing.models.aggregate.EvaluationClient)1 Employee (org.eclipse.persistence.testing.models.legacy.Employee)1 Employee1 (org.eclipse.persistence.testing.models.mapping.Employee1)1