openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1224900 - /openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/TestEmbeddedEnumSqlGeneration.java
Date Tue, 27 Dec 2011 12:00:13 GMT
Author: struberg
Date: Tue Dec 27 12:00:12 2011
New Revision: 1224900

URL: http://svn.apache.org/viewvc?rev=1224900&view=rev
Log:
OPENJPA-2100 oops, fixed broken test

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

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/TestEmbeddedEnumSqlGeneration.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/TestEmbeddedEnumSqlGeneration.java?rev=1224900&r1=1224899&r2=1224900&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/TestEmbeddedEnumSqlGeneration.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/TestEmbeddedEnumSqlGeneration.java
Tue Dec 27 12:00:12 2011
@@ -20,7 +20,6 @@ package org.apache.openjpa.persistence.e
 
 import org.apache.openjpa.enhance.PCEnhancer;
 import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
-import org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl;
 import org.apache.openjpa.jdbc.meta.MappingTool;
 import org.apache.openjpa.persistence.OpenJPAEntityManager;
 import org.apache.openjpa.persistence.OpenJPAEntityManagerSPI;
@@ -44,11 +43,13 @@ public class TestEmbeddedEnumSqlGenerati
 
     public void testEnumEnhancement()
     throws IOException {
-        JDBCConfiguration conf = new JDBCConfigurationImpl();
-        try {
-            return MappingTool.run(conf, args, opts);
-        } finally {
-            conf.close();
-        }
+        EntityManager em= currentEntityManager();
+        OpenJPAEntityManager kem = OpenJPAPersistence.cast(em);
+
+        MappingTool tool = new MappingTool((JDBCConfiguration)
+                ((OpenJPAEntityManagerSPI) kem).getConfiguration(),
+                MappingTool.ACTION_REFRESH, false);
+        tool.run(EntityWithEnum.class);
+        tool.record();
     }
 }



Mime
View raw message