Search in sources :

Example 1 with JUnitDomainObjectComparer

use of org.eclipse.persistence.testing.tests.jpa.jpql.JUnitDomainObjectComparer 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);
}
Also used : AdvancedTableCreator(org.eclipse.persistence.testing.models.jpa.advanced.AdvancedTableCreator) JUnitDomainObjectComparer(org.eclipse.persistence.testing.tests.jpa.jpql.JUnitDomainObjectComparer) EmployeePopulator(org.eclipse.persistence.testing.models.jpa.advanced.EmployeePopulator) DatabaseSession(org.eclipse.persistence.sessions.DatabaseSession)

Example 2 with JUnitDomainObjectComparer

use of org.eclipse.persistence.testing.tests.jpa.jpql.JUnitDomainObjectComparer in project eclipselink by eclipse-ee4j.

the class AdvancedCriteriaQueryTestSuite 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);
}
Also used : AdvancedTableCreator(org.eclipse.persistence.testing.models.jpa.advanced.AdvancedTableCreator) JUnitDomainObjectComparer(org.eclipse.persistence.testing.tests.jpa.jpql.JUnitDomainObjectComparer) EmployeePopulator(org.eclipse.persistence.testing.models.jpa.advanced.EmployeePopulator) DatabaseSession(org.eclipse.persistence.sessions.DatabaseSession)

Example 3 with JUnitDomainObjectComparer

use of org.eclipse.persistence.testing.tests.jpa.jpql.JUnitDomainObjectComparer in project eclipselink by eclipse-ee4j.

the class JUnitCriteriaSimpleTestSuiteBase 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);
    // 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 InheritedTableManager().replaceTables(session);
    new InheritanceTableCreator().replaceTables(session);
}
Also used : InheritedTableManager(org.eclipse.persistence.testing.models.jpa.inherited.InheritedTableManager) AdvancedTableCreator(org.eclipse.persistence.testing.models.jpa.advanced.AdvancedTableCreator) JUnitDomainObjectComparer(org.eclipse.persistence.testing.tests.jpa.jpql.JUnitDomainObjectComparer) EmployeePopulator(org.eclipse.persistence.testing.models.jpa.advanced.EmployeePopulator) DatabaseSession(org.eclipse.persistence.sessions.DatabaseSession) InheritanceTableCreator(org.eclipse.persistence.testing.models.jpa.inheritance.InheritanceTableCreator)

Aggregations

DatabaseSession (org.eclipse.persistence.sessions.DatabaseSession)3 AdvancedTableCreator (org.eclipse.persistence.testing.models.jpa.advanced.AdvancedTableCreator)3 EmployeePopulator (org.eclipse.persistence.testing.models.jpa.advanced.EmployeePopulator)3 JUnitDomainObjectComparer (org.eclipse.persistence.testing.tests.jpa.jpql.JUnitDomainObjectComparer)3 InheritanceTableCreator (org.eclipse.persistence.testing.models.jpa.inheritance.InheritanceTableCreator)1 InheritedTableManager (org.eclipse.persistence.testing.models.jpa.inherited.InheritedTableManager)1