mirror of https://github.com/apache/openjpa.git
Reuse EMF.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@739178 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3c85ec758a
commit
47a0f41e72
|
@ -40,11 +40,11 @@ public class TestDynamicConfiguration extends SingleEMFTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testConfigurationIsEqualByValueAndHashCode() {
|
public void testConfigurationIsEqualByValueAndHashCode() {
|
||||||
OpenJPAEntityManagerFactorySPI emf1 = createEMF();
|
OpenJPAEntityManagerFactorySPI emf1 = createEMF(FRESH_EMF);
|
||||||
assertNotNull(emf1);
|
assertNotNull(emf1);
|
||||||
OpenJPAConfiguration conf1 = emf1.getConfiguration();
|
OpenJPAConfiguration conf1 = emf1.getConfiguration();
|
||||||
|
|
||||||
OpenJPAEntityManagerFactorySPI emf2 = createEMF();
|
OpenJPAEntityManagerFactorySPI emf2 = createEMF(FRESH_EMF);
|
||||||
assertNotNull(emf2);
|
assertNotNull(emf2);
|
||||||
OpenJPAConfiguration conf2 = emf2.getConfiguration();
|
OpenJPAConfiguration conf2 = emf2.getConfiguration();
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,7 @@ public abstract class PersistenceTestCase
|
||||||
}
|
}
|
||||||
EMFKey key = new EMFKey(pu, map);
|
EMFKey key = new EMFKey(pu, map);
|
||||||
OpenJPAEntityManagerFactorySPI oemf = _emfs.get(key);
|
OpenJPAEntityManagerFactorySPI oemf = _emfs.get(key);
|
||||||
if (fresh || oemf == null) {
|
if (fresh || oemf == null || !oemf.isOpen()) {
|
||||||
Map config = new HashMap(System.getProperties());
|
Map config = new HashMap(System.getProperties());
|
||||||
config.putAll(map);
|
config.putAll(map);
|
||||||
oemf = (OpenJPAEntityManagerFactorySPI)
|
oemf = (OpenJPAEntityManagerFactorySPI)
|
||||||
|
|
Loading…
Reference in New Issue