use of org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.AdvancedTableCreator in project eclipselink by eclipse-ee4j.
the class BaseFetchGroupTests method testSetup.
@Test
public void testSetup() {
ServerSession session = getServerSession("fieldaccess");
new AdvancedTableCreator().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);
descriptor.setShouldBeReadOnly(shouldBeReadOnly);
clearCache("fieldaccess");
}
use of org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.AdvancedTableCreator in project eclipselink by eclipse-ee4j.
the class ExtendedPersistenceContextJUnitTestSuite 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 AdvancedTableCreator().replaceTables(JUnitTestCase.getServerSession("fieldaccess"));
// create a new EmployeePopulator
EmployeePopulator employeePopulator = new EmployeePopulator();
// Populate the tables
employeePopulator.buildExamples();
// Persist the examples in the database
employeePopulator.persistExample(JUnitTestCase.getServerSession("fieldaccess"));
clearCache("fieldaccess");
}
use of org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.AdvancedTableCreator in project eclipselink by eclipse-ee4j.
the class NamedNativeQueryJUnitTest 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 AdvancedTableCreator().replaceTables(JUnitTestCase.getServerSession("fieldaccess"));
clearCache("fieldaccess");
}
use of org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.AdvancedTableCreator in project eclipselink by eclipse-ee4j.
the class SessionBeanTests method testSetup.
/**
* The setup is done as a test, both to record its failure, and to allow
* execution in the server.
*/
public void testSetup() throws Exception {
new AdvancedTableCreator().replaceTables(JUnitTestCase.getServerSession("sessionbean"));
Employee bob = new Employee();
bob.setFirstName("Bob");
bob.setLastName("Jones");
bob.setAddress(new Address());
bob.setDepartment(new Department());
getEmployeeService().insert(bob);
Employee joe = new Employee();
joe.setFirstName("Joe");
joe.setLastName("Smith");
joe.setAddress(new Address());
joe.setDepartment(new Department());
getEmployeeService().insert(joe);
}
use of org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.AdvancedTableCreator in project eclipselink by eclipse-ee4j.
the class AdvancedJunitTest 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 AdvancedTableCreator().replaceTables(getDatabaseSession());
clearCache();
}
Aggregations