Bug 401832 - make changes in persistence.xml and tests of jpa21/advanced model to allow the tests running on server as well
Summary: make changes in persistence.xml and tests of jpa21/advanced model to allow th...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords: test
Depends on:
Blocks:
 
Reported: 2013-02-26 15:41 EST by Yiping Zhao CLA
Modified: 2022-06-09 10:31 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yiping Zhao CLA 2013-02-26 15:41:26 EST
The changes are:

    1. modify jpa\eclipselink.jpa.test\resource\eclipselink-jpa21-model\persistence.xml to use hardcoded PU names like "MulitPU-1"..."MulitPU-5"

    2. add persistence.xml for server user under jpa\eclipselink.jpa.test\resource\eclipselink-jpa21-model\server\

    3. make changes to tests as following:
        (1) remove NamedStoredProcedureQueryTestSuite and XMLNamedStoredProcedureQueryTestSuite from StoredProcedureQueryTestSuite, add these two suites to JPA21TestSuite

        (2) remove XMLConverterTestSuite from ConverterTestSuite, add XMLConverterTestSuite to JPA21TestSuite

        (3) CriteriaQueryTestSuite
             replace JUnitTestCase.getServerSession() or getServerSession() with getPersistenceUnitServerSession()
            move beginTransaction(em) further up, after createEntityManager() statement in some tests
            change em.close() to closeEntityManager(em)

        (4) CriteriaQueryMetamodelTestSuite, changes are same as for CriteriaQueryTestSuite

        (5) split DDLTestSuite to DDLTestSuit, ForeignKeyTestSuit, IndexTestSuite, XMLForeignKeyTestSuite and XMLIndexTestSuite, add the last 4 test suites to JPA21TestSuite

        (6) EntityManagerFactoryTestSuite,
            replace JUnitTestCase.getServerSession() or getServerSession() with getPersistenceUnitServerSession()
            change "EntityManagerImpl em = (EntityManagerImpl)createEntityManager();" to "EntityManagerImpl em = createEntityManager();"

        (7) EntityGraphTestSuite,
            remove XMLEntityGraphTestSuite, add it to JPA21TestSuite
            change em.close() to closeEntityManager(em)

        (8) QueryTestSuite and CriteriaQueryCastTestSuite, replace JUnitTestCase.getServerSession() or getServerSession() with getPersistenceUnitServerSession()

        (9) EntityManagerTestSuite, replace JUnitTestCase.getServerSession() or getServerSession() with getPersistenceUnitServerSession()
Comment 1 Yiping Zhao CLA 2013-02-26 15:44:18 EST
The changes have been made to master revision 3d5cf9dfee8 on Feb 26, 2013.
Comment 2 Yiping Zhao CLA 2013-02-27 11:39:25 EST
After checked in, testQueryWithMultipleResults() in NamedStoredProcedureQueryTestSuite failed on MySQL in http://download.eclipse.org/rt/eclipselink/nightly/2.5.0/20130227/Eclipse/eclipselink-jpa-lrg-2.5.0.v20130227-3d5cf9d.html. The problem is the test oder for NamedStoredProcedureQueryTestSuite is changed, so I remove NamedStoredProcedureQueryTestSuite from JPA21TestSuite, and put NamedStoredProcedureQueryTestSuite back to StoredProcedureQueryTestSuite to its original position like:

// Add the EM level stored procedure query tests.
        suite.addTest(new StoredProcedureQueryTestSuite("testQueryExecute1"));
        suite.addTest(new StoredProcedureQueryTestSuite("testQueryExecute2"));
        suite.addTest(new StoredProcedureQueryTestSuite("testQueryExecuteUpdate"));
        suite.addTest(new StoredProcedureQueryTestSuite("testQueryGetResultList"));
        suite.addTest(new StoredProcedureQueryTestSuite("testQueryWithMultipleResultsFromCode"));
        suite.addTest(new StoredProcedureQueryTestSuite("testQueryWithNamedFieldResult"));
        suite.addTest(new StoredProcedureQueryTestSuite("testQueryWithNumberedFieldResult"));
        suite.addTest(new StoredProcedureQueryTestSuite("testQueryWithResultClass"));
        suite.addTest(new StoredProcedureQueryTestSuite("testStoredProcedureParameterAPI"));
        suite.addTest(new StoredProcedureQueryTestSuite("testStoredProcedureQuerySysCursor"));

        // Add the named Annotation query tests.
        suite.addTest(NamedStoredProcedureQueryTestSuite.suite());
        
        // These are EM API validation tests. These tests delete and update so 
        // be careful where you introduce new tests.
        suite.addTest(new StoredProcedureQueryTestSuite("testClassCastExceptionOnExecuteWithNoOutputParameters"));
        suite.addTest(new StoredProcedureQueryTestSuite("testGetResultListOnDeleteQuery"));
        suite.addTest(new StoredProcedureQueryTestSuite("testGetResultListOnUpdateQuery"));
        suite.addTest(new StoredProcedureQueryTestSuite("testGetSingleResultOnDeleteQuery"));
        suite.addTest(new StoredProcedureQueryTestSuite("testGetSingleResultOnUpdateQuery"));

The above changes are made to repository as ae8f820 on Feb 27, 2013
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:31:09 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink