Search in sources :

Example 1 with TestSuite

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

the class MapCollectionsTestModel method getDirectMapMappingTestSuite.

public static TestSuite getDirectMapMappingTestSuite() {
    TestSuite suite = new TestSuite();
    suite.setName("Direct Map Mapping Map Test Suite");
    suite.setDescription("This suite tests using DirectMapMapping with different types of keys.");
    // Read
    suite.addTest(new TestReadDirectDirectMapMapping());
    suite.addTest(new TestReadAggregateDirectMapMapping());
    suite.addTest(new TestReadEntityDirectMapMapping());
    // Update
    suite.addTest(new TestUpdateDirectDirectMapMapping());
    suite.addTest(new TestUpdateAggregateDirectMapMapping());
    suite.addTest(new TestUpdateEntityDirectMapMapping());
    // Private Owned - DirectMapMappings are automatically private owned
    // as a result, the only relevant test here is one with an EntityKey
    suite.addTest(new TestUpdateEntityDirectMapMapping(true));
    // Join
    suite.addTest(new TestReadDirectDirectMapMapping(ForeignReferenceMapping.INNER_JOIN));
    suite.addTest(new TestReadAggregateDirectMapMapping(ForeignReferenceMapping.INNER_JOIN));
    suite.addTest(new TestReadEntityDirectMapMapping(ForeignReferenceMapping.INNER_JOIN));
    // Expressions
    ReadAllExpressionTest test = new ReadAllExpressionTest(DirectDirectMapHolder.class, 1);
    ExpressionBuilder holders = new ExpressionBuilder();
    Expression exp = holders.anyOf("directToDirectMap").mapKey().equal(1);
    test.setExpression(exp);
    suite.addTest(test);
    test = new ReadAllExpressionTest(AggregateDirectMapHolder.class, 1);
    AggregateMapKey aggkey = new AggregateMapKey();
    aggkey.setKey(11);
    holders = new ExpressionBuilder();
    exp = holders.anyOf("aggregateToDirectMap").mapKey().equal(aggkey);
    test.setExpression(exp);
    suite.addTest(test);
    test = new ReadAllExpressionTest(EntityDirectMapHolder.class, 1);
    EntityMapKey entKey = new EntityMapKey();
    entKey.setId(333);
    entKey.setData("data3");
    holders = new ExpressionBuilder();
    exp = holders.anyOf("entityToDirectMap").mapKey().equal(entKey);
    test.setExpression(exp);
    suite.addTest(test);
    return suite;
}
Also used : AggregateMapKey(org.eclipse.persistence.testing.models.collections.map.AggregateMapKey) ExpressionBuilder(org.eclipse.persistence.expressions.ExpressionBuilder) AggregateDirectMapHolder(org.eclipse.persistence.testing.models.collections.map.AggregateDirectMapHolder) EntityMapKey(org.eclipse.persistence.testing.models.collections.map.EntityMapKey) EntityDirectMapHolder(org.eclipse.persistence.testing.models.collections.map.EntityDirectMapHolder) TestSuite(org.eclipse.persistence.testing.framework.TestSuite) Expression(org.eclipse.persistence.expressions.Expression) ReadAllExpressionTest(org.eclipse.persistence.testing.tests.expressions.ReadAllExpressionTest)

Example 2 with TestSuite

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

the class MapCollectionsTestModel method getUnidirectionalOneToManyMappingTestSuite.

public static TestSuite getUnidirectionalOneToManyMappingTestSuite() {
    TestSuite suite = new TestSuite();
    suite.setName("UnidirectionalOneToManyMapping Map Test Suite");
    suite.setDescription("This suite tests using UnidirectionalOneToManyMapping with a Map");
    // Read
    suite.addTest(new TestReadDirectEntityU1MMapMapping());
    suite.addTest(new TestReadAggregateEntityU1MMapMapping());
    suite.addTest(new TestReadEntityEntityU1MMapMapping());
    // Update
    suite.addTest(new TestUpdateDirectEntityU1MMapMapping());
    suite.addTest(new TestUpdateAggregateEntityU1MMapMapping());
    suite.addTest(new TestUpdateEntityEntityU1MMapMapping());
    // Private Owned
    suite.addTest(new TestUpdateDirectEntityU1MMapMapping(true));
    suite.addTest(new TestUpdateAggregateEntityU1MMapMapping(true));
    suite.addTest(new TestUpdateEntityEntityU1MMapMapping(true));
    // Joining
    suite.addTest(new TestReadDirectEntityU1MMapMapping(ForeignReferenceMapping.INNER_JOIN));
    suite.addTest(new TestReadAggregateEntityU1MMapMapping(ForeignReferenceMapping.INNER_JOIN));
    suite.addTest(new TestReadEntityEntityU1MMapMapping(ForeignReferenceMapping.INNER_JOIN));
    // Expressions
    ReadAllExpressionTest test = new ReadAllExpressionTest(DirectEntityU1MMapHolder.class, 1);
    ExpressionBuilder holders = new ExpressionBuilder();
    Expression exp = holders.anyOf("directToEntityMap").mapKey().equal(11);
    test.setExpression(exp);
    suite.addTest(test);
    test = new ReadAllExpressionTest(AggregateEntityU1MMapHolder.class, 1);
    AggregateMapKey aggkey = new AggregateMapKey();
    aggkey.setKey(11);
    holders = new ExpressionBuilder();
    exp = holders.anyOf("aggregateToEntityMap").mapKey().equal(aggkey);
    test.setExpression(exp);
    suite.addTest(test);
    test = new ReadAllExpressionTest(EntityEntityU1MMapHolder.class, 1);
    EntityMapKey entKey = new EntityMapKey();
    entKey.setId(999);
    entKey.setData("data9");
    holders = new ExpressionBuilder();
    exp = holders.anyOf("entityToEntityMap").mapKey().equal(entKey);
    test.setExpression(exp);
    suite.addTest(test);
    return suite;
}
Also used : AggregateMapKey(org.eclipse.persistence.testing.models.collections.map.AggregateMapKey) ExpressionBuilder(org.eclipse.persistence.expressions.ExpressionBuilder) EntityMapKey(org.eclipse.persistence.testing.models.collections.map.EntityMapKey) TestSuite(org.eclipse.persistence.testing.framework.TestSuite) Expression(org.eclipse.persistence.expressions.Expression) EntityEntityU1MMapHolder(org.eclipse.persistence.testing.models.collections.map.EntityEntityU1MMapHolder) ReadAllExpressionTest(org.eclipse.persistence.testing.tests.expressions.ReadAllExpressionTest) AggregateEntityU1MMapHolder(org.eclipse.persistence.testing.models.collections.map.AggregateEntityU1MMapHolder)

Example 3 with TestSuite

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

the class MapCollectionsTestModel method getOneToManyMappingTestSuite.

public static TestSuite getOneToManyMappingTestSuite() {
    TestSuite suite = new TestSuite();
    suite.setName("OneToManyMapping Map Test Suite");
    suite.setDescription("This suite tests using OneToManyMapping with a Map");
    // Read
    suite.addTest(new TestReadDirectEntity1MMapMapping());
    suite.addTest(new TestReadAggregateEntity1MMapMapping());
    suite.addTest(new TestReadEntityEntity1MMapMapping());
    // Update
    suite.addTest(new TestUpdateDirectEntity1MMapMapping());
    suite.addTest(new TestUpdateAggregateEntity1MMapMapping());
    suite.addTest(new TestUpdateEntityEntity1MMapMapping());
    // Private Owned
    suite.addTest(new TestUpdateDirectEntity1MMapMapping(true));
    suite.addTest(new TestUpdateAggregateEntity1MMapMapping(true));
    suite.addTest(new TestUpdateEntityEntity1MMapMapping(true));
    // Joining
    suite.addTest(new TestReadDirectEntity1MMapMapping(ForeignReferenceMapping.INNER_JOIN));
    suite.addTest(new TestReadAggregateEntity1MMapMapping(ForeignReferenceMapping.INNER_JOIN));
    suite.addTest(new TestReadEntityEntity1MMapMapping(ForeignReferenceMapping.INNER_JOIN));
    // Expressions
    ReadAllExpressionTest test = new ReadAllExpressionTest(DirectEntity1MMapHolder.class, 1);
    ExpressionBuilder holders = new ExpressionBuilder();
    Expression exp = holders.anyOf("directToEntityMap").mapKey().equal(11);
    test.setExpression(exp);
    suite.addTest(test);
    test = new ReadAllExpressionTest(AggregateEntity1MMapHolder.class, 1);
    AggregateMapKey aggkey = new AggregateMapKey();
    aggkey.setKey(11);
    holders = new ExpressionBuilder();
    exp = holders.anyOf("aggregateToEntityMap").mapKey().equal(aggkey);
    test.setExpression(exp);
    suite.addTest(test);
    test = new ReadAllExpressionTest(AggregateEntity1MMapHolder.class, 1);
    holders = new ExpressionBuilder();
    exp = holders.anyOf("aggregateToEntityMap").mapKey().get("key").equal(11);
    test.setExpression(exp);
    suite.addTest(test);
    test = new ReadAllExpressionTest(EntityEntity1MMapHolder.class, 1);
    EntityMapKey entKey = new EntityMapKey();
    entKey.setId(555);
    entKey.setData("data5");
    holders = new ExpressionBuilder();
    exp = holders.anyOf("entityToEntityMap").mapKey().equal(entKey);
    test.setExpression(exp);
    suite.addTest(test);
    test = new ReadAllExpressionTest(EntityEntity1MMapHolder.class, 1);
    holders = new ExpressionBuilder();
    exp = holders.anyOf("entityToEntityMap").mapKey().get("data").equal("data5");
    test.setExpression(exp);
    suite.addTest(test);
    suite.addTest(new MapKeyDirectEntity1MReportQueryTestCase());
    suite.addTest(new MapKeyAggregateEntity1MReportQueryTestCase());
    suite.addTest(new MapKeyEntityEntity1MReportQueryTestCase());
    suite.addTest(new MapEntryDirectEntity1MReportQueryTest());
    suite.addTest(new InMemoryDirectEntity1MTest());
    return suite;
}
Also used : EntityEntity1MMapHolder(org.eclipse.persistence.testing.models.collections.map.EntityEntity1MMapHolder) AggregateMapKey(org.eclipse.persistence.testing.models.collections.map.AggregateMapKey) ExpressionBuilder(org.eclipse.persistence.expressions.ExpressionBuilder) EntityMapKey(org.eclipse.persistence.testing.models.collections.map.EntityMapKey) TestSuite(org.eclipse.persistence.testing.framework.TestSuite) Expression(org.eclipse.persistence.expressions.Expression) AggregateEntity1MMapHolder(org.eclipse.persistence.testing.models.collections.map.AggregateEntity1MMapHolder) ReadAllExpressionTest(org.eclipse.persistence.testing.tests.expressions.ReadAllExpressionTest)

Example 4 with TestSuite

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

the class MapCollectionsTestModel method getManyToManyMappingTestSuite.

public static TestSuite getManyToManyMappingTestSuite() {
    TestSuite suite = new TestSuite();
    suite.setName("ManyToManyMapping Map Test Suite");
    suite.setDescription("This suite tests using ManyToManyMapping with a Map");
    // Read
    suite.addTest(new TestReadDirectEntityMapMapping());
    suite.addTest(new TestReadAggregateEntityMapMapping());
    suite.addTest(new TestReadEntityEntityMapMapping());
    // Update
    suite.addTest(new TestUpdateDirectEntityMapMapping());
    suite.addTest(new TestUpdateAggregateEntityMapMapping());
    suite.addTest(new TestUpdateEntityEntityMapMapping());
    // private owned
    suite.addTest(new TestUpdateDirectEntityMapMapping(true));
    suite.addTest(new TestUpdateAggregateEntityMapMapping(true));
    suite.addTest(new TestUpdateEntityEntityMapMapping(true));
    // Joining
    suite.addTest(new TestReadDirectEntityMapMapping(ForeignReferenceMapping.INNER_JOIN));
    suite.addTest(new TestReadAggregateEntityMapMapping(ForeignReferenceMapping.INNER_JOIN));
    suite.addTest(new TestReadEntityEntityMapMapping(ForeignReferenceMapping.INNER_JOIN));
    // Expressions
    ReadAllExpressionTest test = new ReadAllExpressionTest(DirectEntityMapHolder.class, 1);
    ExpressionBuilder holders = new ExpressionBuilder();
    Expression exp = holders.anyOf("directToEntityMap").mapKey().equal(11);
    test.setExpression(exp);
    suite.addTest(test);
    test = new ReadAllExpressionTest(AggregateEntityMapHolder.class, 1);
    AggregateMapKey aggkey = new AggregateMapKey();
    aggkey.setKey(11);
    holders = new ExpressionBuilder();
    exp = holders.anyOf("aggregateToEntityMap").mapKey().equal(aggkey);
    test.setExpression(exp);
    suite.addTest(test);
    test = new ReadAllExpressionTest(EntityEntityMapHolder.class, 1);
    EntityMapKey entKey = new EntityMapKey();
    entKey.setId(777);
    entKey.setData("data7");
    holders = new ExpressionBuilder();
    exp = holders.anyOf("entityToEntityMap").mapKey().equal(entKey);
    test.setExpression(exp);
    suite.addTest(test);
    return suite;
}
Also used : AggregateMapKey(org.eclipse.persistence.testing.models.collections.map.AggregateMapKey) EntityEntityMapHolder(org.eclipse.persistence.testing.models.collections.map.EntityEntityMapHolder) ExpressionBuilder(org.eclipse.persistence.expressions.ExpressionBuilder) AggregateEntityMapHolder(org.eclipse.persistence.testing.models.collections.map.AggregateEntityMapHolder) EntityMapKey(org.eclipse.persistence.testing.models.collections.map.EntityMapKey) TestSuite(org.eclipse.persistence.testing.framework.TestSuite) Expression(org.eclipse.persistence.expressions.Expression) ReadAllExpressionTest(org.eclipse.persistence.testing.tests.expressions.ReadAllExpressionTest)

Example 5 with TestSuite

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

the class MappingWMIntegrationStoredProcedureTestModel method getStoredProcedureCallFromProjectXMLSuite.

public static TestSuite getStoredProcedureCallFromProjectXMLSuite() {
    TestSuite suite = new TestSuite();
    suite.setName("getStoredProcedureCallFromProjectXMLSuite");
    suite.setDescription("This suite tests read stored procedure call from XML and execute it.");
    suite.addTest(new ProjectXMLStoredProcedureCallTest());
    return suite;
}
Also used : TestSuite(org.eclipse.persistence.testing.framework.TestSuite)

Aggregations

TestSuite (org.eclipse.persistence.testing.framework.TestSuite)128 PopulationManager (org.eclipse.persistence.tools.schemaframework.PopulationManager)37 Employee (org.eclipse.persistence.testing.models.employee.domain.Employee)18 LargeProject (org.eclipse.persistence.testing.models.employee.domain.LargeProject)14 SmallProject (org.eclipse.persistence.testing.models.employee.domain.SmallProject)14 ReadObjectTest (org.eclipse.persistence.testing.framework.ReadObjectTest)9 WriteObjectTest (org.eclipse.persistence.testing.framework.WriteObjectTest)8 InsertObjectTest (org.eclipse.persistence.testing.framework.InsertObjectTest)7 ReadAllTest (org.eclipse.persistence.testing.framework.ReadAllTest)7 Employee (org.eclipse.persistence.testing.models.aggregate.Employee)7 Expression (org.eclipse.persistence.expressions.Expression)6 ExpressionBuilder (org.eclipse.persistence.expressions.ExpressionBuilder)6 Client (org.eclipse.persistence.testing.models.aggregate.Client)6 EvaluationClient (org.eclipse.persistence.testing.models.aggregate.EvaluationClient)6 Project (org.eclipse.persistence.testing.models.employee.domain.Project)6 ReadAllExpressionTest (org.eclipse.persistence.testing.tests.expressions.ReadAllExpressionTest)6 Agent (org.eclipse.persistence.testing.models.aggregate.Agent)5 Builder (org.eclipse.persistence.testing.models.aggregate.Builder)5 AggregateMapKey (org.eclipse.persistence.testing.models.collections.map.AggregateMapKey)5 EntityMapKey (org.eclipse.persistence.testing.models.collections.map.EntityMapKey)5