openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r813519 - in /openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence: generationtype/TestMultipleSchemaNames.java test/SingleEMFTestCase.java
Date Thu, 10 Sep 2009 17:16:31 GMT
Author: dwoods
Date: Thu Sep 10 17:16:31 2009
New Revision: 813519

URL: http://svn.apache.org/viewvc?rev=813519&view=rev
Log:
updated getLog() methods and switched testcase to use setUnsupportedDatabases()

Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/generationtype/TestMultipleSchemaNames.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/SingleEMFTestCase.java

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/generationtype/TestMultipleSchemaNames.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/generationtype/TestMultipleSchemaNames.java?rev=813519&r1=813518&r2=813519&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/generationtype/TestMultipleSchemaNames.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/generationtype/TestMultipleSchemaNames.java
Thu Sep 10 17:16:31 2009
@@ -43,24 +43,12 @@
     public void setUp() {
         // Need to skip tests on MySQL, Oracle and MS SQL Server
         // See createSchemas() comment at the bottom
-        if (dict == null) {
-            OpenJPAEntityManagerFactorySPI emf = createEMF();
-            OpenJPAEntityManagerSPI em = emf.createEntityManager();
-            JDBCConfiguration conf = (JDBCConfiguration) em.getConfiguration();
-            dict = conf.getDBDictionaryInstance();
-            
-            if ((dict instanceof MySQLDictionary) ||
-                    (dict instanceof OracleDictionary) ||
-                    (dict instanceof SQLServerDictionary)) {
-                setTestsDisabled(true);
-                // do some logging
-                emf.getConfiguration().getLog("Tests").trace(
-                    "TestMultipleSchemaNames() - Skipping all tests - Not supported on this
DB");
-            }
-            closeEMF(emf);
-        }
-        
+        setUnsupportedDatabases(
+                org.apache.openjpa.jdbc.sql.MySQLDictionary.class,
+                org.apache.openjpa.jdbc.sql.OracleDictionary.class,
+                org.apache.openjpa.jdbc.sql.SQLServerDictionary.class);
         if (isTestsDisabled()) {
+            getLog().trace("TestMultipleSchemaNames() - Skipping all tests - Not supported
on this DB");
             return;
         }
 

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/SingleEMFTestCase.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/SingleEMFTestCase.java?rev=813519&r1=813518&r2=813519&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/SingleEMFTestCase.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/SingleEMFTestCase.java
Thu Sep 10 17:16:31 2009
@@ -206,6 +206,19 @@
     }
     
     protected Log getLog() {
-        return emf.getConfiguration().getLog("Tests");
+        return getLog("Tests");
+    }
+
+    protected Log getLog(String s) {
+        OpenJPAEntityManagerFactorySPI tempEMF = emf;
+        if (tempEMF == null) {
+            tempEMF = createEMF();
+        }
+        Log log = emf.getConfiguration().getLog(s);
+        if (emf == null) {
+            closeEMF(tempEMF);
+        }
+        return log;
     }
 }
+



Mime
View raw message