openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r563664 - /openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/query/TestXMLCustomerOrder.java
Date Tue, 07 Aug 2007 21:32:06 GMT
Author: pcl
Date: Tue Aug  7 14:32:06 2007
New Revision: 563664

URL: http://svn.apache.org/viewvc?view=rev&rev=563664
Log:
Oops; fixing NPE caused by previous short-circuiting.

Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/query/TestXMLCustomerOrder.java

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/query/TestXMLCustomerOrder.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/query/TestXMLCustomerOrder.java?view=diff&rev=563664&r1=563663&r2=563664
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/query/TestXMLCustomerOrder.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/query/TestXMLCustomerOrder.java
Tue Aug  7 14:32:06 2007
@@ -49,6 +49,8 @@
 public class TestXMLCustomerOrder
     extends SQLListenerTestCase {
 
+    private boolean enabled = false;
+
     public void setUp() {
         OpenJPAEntityManagerFactory emf = createEMF();
         DBDictionary dict = ((JDBCConfiguration) emf.getConfiguration())
@@ -58,6 +60,8 @@
         if (!dict.supportsXMLColumn)
             return;
 
+        enabled = true;
+
         setUp(org.apache.openjpa.persistence.xmlmapping.entities.Customer.class
             , org.apache.openjpa.persistence.xmlmapping.entities.Customer
                 .CustomerKey.class
@@ -71,14 +75,14 @@
     }
 
     public void testXMLCustomerOrder() {	
+        // skip if dictionary has no support for XML column type
+        if (!enabled)
+            return;
+
         OpenJPAEntityManager em =
             OpenJPAPersistence.cast(emf.createEntityManager());
         DBDictionary dict = ((JDBCConfiguration) em.getConfiguration())
             .getDBDictionaryInstance();
-
-        // skip if dictionary has no support for XML column type 
-        if (!dict.supportsXMLColumn)
-            return;
 
         String sqllog = TestXMLCustomerOrder.class.getName();
         sqllog = sqllog.replace('.', '/');



Mime
View raw message