Search in sources :

Example 1 with InheritedTableManager

use of org.eclipse.persistence.testing.models.jpa.inherited.InheritedTableManager in project eclipselink by eclipse-ee4j.

the class CMP3InheritedTestModel method setup.

@Override
public void setup() {
    super.setup();
    new InheritedTableManager().replaceTables(getServerSession());
}
Also used : InheritedTableManager(org.eclipse.persistence.testing.models.jpa.inherited.InheritedTableManager)

Example 2 with InheritedTableManager

use of org.eclipse.persistence.testing.models.jpa.inherited.InheritedTableManager in project eclipselink by eclipse-ee4j.

the class InheritedCallbacksJunitTest 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 InheritedTableManager().replaceTables(JUnitTestCase.getServerSession());
    clearCache();
}
Also used : InheritedTableManager(org.eclipse.persistence.testing.models.jpa.inherited.InheritedTableManager)

Example 3 with InheritedTableManager

use of org.eclipse.persistence.testing.models.jpa.inherited.InheritedTableManager in project eclipselink by eclipse-ee4j.

the class OrderedListAttributeChangeTrackingJunitTest method suite.

public static Test suite() {
    TestSuite suite = new TestSuite();
    suite.setName("OrderedListAttributeChangeTrackingJunitTest");
    suite.addTest(new OrderedListAttributeChangeTrackingJunitTest("testInitialize"));
    suite.addTest(new OrderedListAttributeChangeTrackingJunitTest("test1"));
    suite.addTest(new OrderedListAttributeChangeTrackingJunitTest("testInitialize"));
    suite.addTest(new OrderedListAttributeChangeTrackingJunitTest("test2"));
    suite.addTest(new OrderedListAttributeChangeTrackingJunitTest("testInitialize"));
    suite.addTest(new OrderedListAttributeChangeTrackingJunitTest("test3"));
    return new TestSetup(suite) {

        private ObjectChangePolicy origPolicy;

        @Override
        protected void setUp() {
            DatabaseSession session = JUnitTestCase.getServerSession();
            new InheritedTableManager().replaceTables(session);
            session.logout();
            origPolicy = session.getDescriptor(BeerConsumer.class).getObjectChangePolicy();
            session.getDescriptor(BeerConsumer.class).setObjectChangePolicy(new AttributeChangeTrackingPolicy());
            session.login();
        }

        @Override
        protected void tearDown() {
            new OrderedListAttributeChangeTrackingJunitTest().clearCache();
            ServerSession session = JUnitTestCase.getServerSession();
            session.logout();
            session.getDescriptor(BeerConsumer.class).setObjectChangePolicy(origPolicy);
            session.login();
        }
    };
}
Also used : TestSetup(junit.extensions.TestSetup) InheritedTableManager(org.eclipse.persistence.testing.models.jpa.inherited.InheritedTableManager) ServerSession(org.eclipse.persistence.sessions.server.ServerSession) DatabaseSession(org.eclipse.persistence.sessions.DatabaseSession) ObjectChangePolicy(org.eclipse.persistence.descriptors.changetracking.ObjectChangePolicy) BeerConsumer(org.eclipse.persistence.testing.models.jpa.inherited.BeerConsumer) AttributeChangeTrackingPolicy(org.eclipse.persistence.descriptors.changetracking.AttributeChangeTrackingPolicy)

Example 4 with InheritedTableManager

use of org.eclipse.persistence.testing.models.jpa.inherited.InheritedTableManager 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());
}
Also used : InheritedTableManager(org.eclipse.persistence.testing.models.jpa.inherited.InheritedTableManager) CompositePKTableCreator(org.eclipse.persistence.testing.models.jpa.advanced.compositepk.CompositePKTableCreator) AdvancedTableCreator(org.eclipse.persistence.testing.models.jpa.advanced.AdvancedTableCreator) EmployeePopulator(org.eclipse.persistence.testing.models.jpa.advanced.EmployeePopulator) DatabaseSession(org.eclipse.persistence.sessions.DatabaseSession) DataTypesTableCreator(org.eclipse.persistence.testing.models.jpa.datatypes.DataTypesTableCreator) SchemaManager(org.eclipse.persistence.tools.schemaframework.SchemaManager) PartnerLinkPopulator(org.eclipse.persistence.testing.models.jpa.advanced.PartnerLinkPopulator)

Example 5 with InheritedTableManager

use of org.eclipse.persistence.testing.models.jpa.inherited.InheritedTableManager in project eclipselink by eclipse-ee4j.

the class InheritedModelJunitTest 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 InheritedTableManager().replaceTables(JUnitTestCase.getServerSession());
    clearCache();
}
Also used : InheritedTableManager(org.eclipse.persistence.testing.models.jpa.inherited.InheritedTableManager)

Aggregations

InheritedTableManager (org.eclipse.persistence.testing.models.jpa.inherited.InheritedTableManager)10 AdvancedTableCreator (org.eclipse.persistence.testing.models.jpa.advanced.AdvancedTableCreator)4 DatabaseSession (org.eclipse.persistence.sessions.DatabaseSession)3 InheritanceTableCreator (org.eclipse.persistence.testing.models.jpa.inheritance.InheritanceTableCreator)3 EmployeePopulator (org.eclipse.persistence.testing.models.jpa.advanced.EmployeePopulator)2 TestSetup (junit.extensions.TestSetup)1 AttributeChangeTrackingPolicy (org.eclipse.persistence.descriptors.changetracking.AttributeChangeTrackingPolicy)1 ObjectChangePolicy (org.eclipse.persistence.descriptors.changetracking.ObjectChangePolicy)1 ServerSession (org.eclipse.persistence.sessions.server.ServerSession)1 PartnerLinkPopulator (org.eclipse.persistence.testing.models.jpa.advanced.PartnerLinkPopulator)1 CompositePKTableCreator (org.eclipse.persistence.testing.models.jpa.advanced.compositepk.CompositePKTableCreator)1 DataTypesTableCreator (org.eclipse.persistence.testing.models.jpa.datatypes.DataTypesTableCreator)1 BeerConsumer (org.eclipse.persistence.testing.models.jpa.inherited.BeerConsumer)1 JUnitDomainObjectComparer (org.eclipse.persistence.testing.tests.jpa.jpql.JUnitDomainObjectComparer)1 SchemaManager (org.eclipse.persistence.tools.schemaframework.SchemaManager)1