use of org.eclipse.persistence.testing.models.jpa.inheritance.InheritancePopulator in project eclipselink by eclipse-ee4j.
the class JUnitJPQLInheritanceTestSuite 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();
// initialize the global comparer object
comparer = new JUnitDomainObjectComparer();
// set the session for the comparer to use
comparer.setSession((AbstractSession) session.getActiveSession());
new AdvancedTableCreator().replaceTables(session);
new InheritanceTableCreator().replaceTables(session);
// Populate the tables
employeePopulator.buildExamples();
// Persist the examples in the database
employeePopulator.persistExample(session);
// Populate the tables
InheritancePopulator inheritancePopulator = new InheritancePopulator();
inheritancePopulator.buildExamples();
// Persist the examples in the database
inheritancePopulator.persistExample(session);
}
use of org.eclipse.persistence.testing.models.jpa.inheritance.InheritancePopulator in project eclipselink by eclipse-ee4j.
the class AdvancedQueryTestSuite 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();
DatabaseSession session = JUnitTestCase.getServerSession();
// create a new EmployeePopulator
EmployeePopulator employeePopulator = new EmployeePopulator();
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);
new RelationshipsTableManager().replaceTables(session);
// populate the relationships model and persist as well
new RelationshipsExamples().buildExamples(session);
new InheritanceTableCreator().replaceTables(session);
InheritancePopulator inheritancePopulator = new InheritancePopulator();
inheritancePopulator.buildExamples();
// Persist the examples in the database
inheritancePopulator.persistExample(session);
}
Aggregations