Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.2.1
-
None
-
None
Description
I suppose a higher-level point that should be made is that the doc should have a section on "testing", covering issues specific to OpenJPA that facilitate or hinder testing. The particular point I wanted to make is that if you need to override the "jta-data-source" or "non-jta-data-source" in a test (or anywhere), the properties "openjpa.ConnectionFactory2Name" and/or "openjpa.ConnectionFactoryName" need to be set, very likely to the empty string.
For instance, my application uses "non-jta-data-source" to connect to a JNDI datasource in WebLogic, which connects to Oracle. However, my database tests use an embedded instance of Apache Derby. In my test setup, I pass properties to the EntityManagerFactory creation that specifies the database connection, but I had to know to set those two properties (just the "2" one, in my case) to empty strings, to cause it to not try to look up the datasource from JNDI.