use of org.eclipse.persistence.testing.models.jpa.datatypes.DataTypesTableCreator in project eclipselink by eclipse-ee4j.
the class JUnitJPQLComplexTestSuite method testSetup.
/**
* The setup is done as a test, both to record its failure, and to allow execution in the server.
*/
public void testSetup() {
clearCache();
// get session to start setup
DatabaseSession session = JUnitTestCase.getServerSession();
// create a new EmployeePopulator
EmployeePopulator employeePopulator = new EmployeePopulator();
// create a new PartnerLinkPopulator
PartnerLinkPopulator partnerLinkPopulator = new PartnerLinkPopulator();
new AdvancedTableCreator().replaceTables(session);
// initialize the global comparer object
comparer = new JUnitDomainObjectComparer();
// set the session for the comparer to use
comparer.setSession((AbstractSession) session.getActiveSession());
// Populate the tables
employeePopulator.buildExamples();
// Persist the examples in the database
employeePopulator.persistExample(session);
// Populate the tables
partnerLinkPopulator.buildExamples();
// Persist the examples in the database
partnerLinkPopulator.persistExample(session);
new InheritedTableManager().replaceTables(session);
new DataTypesTableCreator().replaceTables(session);
// create stored function when database supports it
if (supportsStoredFunctions()) {
SchemaManager schema = new SchemaManager(session);
schema.replaceObject(buildStoredFunction());
}
new CompositePKTableCreator().replaceTables(JUnitTestCase.getServerSession());
}
Aggregations