openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dez...@apache.org
Subject svn commit: r684064 - /openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java
Date Fri, 08 Aug 2008 19:38:14 GMT
Author: dezzio
Date: Fri Aug  8 12:38:13 2008
New Revision: 684064

URL: http://svn.apache.org/viewvc?rev=684064&view=rev
Log:
A little better error handling when an unknown persistence unit is specified in the test case.

Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java?rev=684064&r1=684063&r2=684064&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java
Fri Aug  8 12:38:13 2008
@@ -123,8 +123,13 @@
                 "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



Mime
View raw message