Bug 310896 - need to add multiple persistence units support in JPA server test framework
Summary: need to add multiple persistence units support in JPA server test framework
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords: test
Depends on:
Blocks:
 
Reported: 2010-04-28 15:47 EDT by Yiping Zhao CLA
Modified: 2022-06-09 10:35 EDT (History)
0 users

See Also:


Attachments
add multiple persistence units to jpa server test framework (48.27 KB, patch)
2010-04-29 14:10 EDT, Yiping Zhao CLA
no flags Details | Diff
updated the patch with new build.xml and persistence.xml (37.79 KB, patch)
2010-04-30 11:11 EDT, Yiping Zhao CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yiping Zhao CLA 2010-04-28 15:47:47 EDT
Right now we only have one persistence unit defined in persistence.xml for running JPA tests on server, we need to support defining multiple persistence units in persistence.xml to be able to run multiple persistence units tests on server.
Comment 1 Yiping Zhao CLA 2010-04-29 14:09:24 EDT
The changes in the fix are:

1. add 4 more server test runner beans named TestRunner1Bean.java, ... TestRunner4Bean.java associated with related remote interfaces under <trunk>/jpa/eclipselink.jpa.test/resource/server. Each test runner bean has its specfic persistence unit

2. change <trunk>/jpa/eclipselink.jpa.test/build.xml to add these multiple sessionbeans to test model which has multiple persistence units, our regular one persistence unit test models won't be affected, those models still use TestRunnerBean.java

3. add (unitName="%%puName%%") to @PersistenceContext and @PersistenceUnit annotations for our existing TestRunnerBean.java, otherwise we will get "...Entity is not known entity type" error when running multiple persistence units tests on server.

4. add persistence.xml and cacheable-entity-mappings.xml for cacheable test model.
Comment 2 Yiping Zhao CLA 2010-04-29 14:10:15 EDT
Created attachment 166539 [details]
add multiple persistence units to jpa server test framework
Comment 3 Yiping Zhao CLA 2010-04-30 11:11:59 EDT
Created attachment 166628 [details]
updated the patch with new build.xml and persistence.xml
Comment 4 Yiping Zhao CLA 2010-05-03 14:55:29 EDT
modify the TestRunner(1..4)Bean to share one interface TestRunner, make TestRunner(1..4)Bean to be subclasses of TestRunnerBean.java with override getPersistenceUnitName() method.

The fix has been checked in trunk as revision 7137, code is reviewed by Edwin Tang, James Sutherland and Kevin Yuan.
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:35:47 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink