mirror of https://github.com/apache/openjpa.git
A little better error handling when an unknown persistence unit is specified in the test case.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@684064 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
352d799756
commit
e5a363e651
|
@ -123,8 +123,13 @@ public abstract class PersistenceTestCase
|
|||
"jpa(Types=" + buf.toString() + ")");
|
||||
}
|
||||
|
||||
return (OpenJPAEntityManagerFactorySPI) Persistence.
|
||||
createEntityManagerFactory(pu, map);
|
||||
OpenJPAEntityManagerFactorySPI oemf = (OpenJPAEntityManagerFactorySPI)
|
||||
Persistence.createEntityManagerFactory(pu, map);
|
||||
if (oemf == null)
|
||||
throw new NullPointerException(
|
||||
"Expected an entity manager factory " +
|
||||
"for the persistence unit named: \"" + pu + "\"");
|
||||
return oemf;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue