use of org.eclipse.persistence.testing.models.jpa.advanced.compositepk.CompositePKTableCreator in project eclipselink by eclipse-ee4j.
the class AdvancedCompositePKJunitTest method testSetup.
/**
* The setup is done as a test, both to record its failure, and to allow execution in the server.
*/
public void testSetup() {
new CompositePKTableCreator().replaceTables(JUnitTestCase.getServerSession());
new AdvancedTableCreator().replaceTables(JUnitTestCase.getServerSession());
clearCache();
}
use of org.eclipse.persistence.testing.models.jpa.advanced.compositepk.CompositePKTableCreator in project eclipselink by eclipse-ee4j.
the class AdvancedCompositePKJunitTest method testSetup.
/**
* The setup is done as a test, both to record its failure, and to allow execution in the server.
*/
public void testSetup() {
new CompositePKTableCreator().replaceTables(JUnitTestCase.getServerSession());
new AdvancedTableCreator().replaceTables(JUnitTestCase.getServerSession());
clearCache();
}
use of org.eclipse.persistence.testing.models.jpa.advanced.compositepk.CompositePKTableCreator 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());
}
use of org.eclipse.persistence.testing.models.jpa.advanced.compositepk.CompositePKTableCreator in project eclipselink by eclipse-ee4j.
the class JUnitJPQLComplexAggregateTestSuite 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();
new AdvancedTableCreator().replaceTables(session);
new CompositePKTableCreator().replaceTables(session);
RelationshipsExamples relationshipExamples = new RelationshipsExamples();
new RelationshipsTableManager().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 relationships model and persist as well
relationshipExamples.buildExamples(session);
}
use of org.eclipse.persistence.testing.models.jpa.advanced.compositepk.CompositePKTableCreator in project eclipselink by eclipse-ee4j.
the class BaseFetchGroupTests method testSetup.
@Test
public void testSetup() {
ServerSession session = getServerSession();
new AdvancedTableCreator().replaceTables(session);
// requires another package
new CompositePKTableCreator().replaceTables(session);
// Force uppercase for Postgres.
if (session.getPlatform().isPostgreSQL()) {
session.getLogin().setShouldForceFieldNamesToUpperCase(true);
}
// The EquipmentCode class 'should' be set to read only. We want
// to be able to create a couple in the Employee populator, so
// force the read only to false. If EquipmentCode is not
// actually read only, don't worry, we set the original read
// only value back on the descriptor and the error will be
// caught in a later test in this suite.
ClassDescriptor descriptor = session.getDescriptor(EquipmentCode.class);
boolean shouldBeReadOnly = descriptor.shouldBeReadOnly();
descriptor.setShouldBeReadOnly(false);
// Populate the database with our examples.
EmployeePopulator employeePopulator = new EmployeePopulator();
employeePopulator.buildExamples();
employeePopulator.persistExample(session);
CompositePKPopulator compositePKPopulator = new CompositePKPopulator();
compositePKPopulator.buildExamples();
compositePKPopulator.persistExample(session);
descriptor.setShouldBeReadOnly(shouldBeReadOnly);
clearCache();
}
Aggregations