openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r812974 - in /openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence: generationtype/TestMultipleSchemaNames.java xmlmapping/query/TestXMLCustomerOrder.java
Date Wed, 09 Sep 2009 14:29:09 GMT
Author: dwoods
Date: Wed Sep  9 14:29:09 2009
New Revision: 812974

URL: http://svn.apache.org/viewvc?rev=812974&view=rev
Log:
add a log.trace to denote the tests are being skipped for some DBs

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/xmlmapping/query/TestXMLCustomerOrder.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=812974&r1=812973&r2=812974&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
Wed Sep  9 14:29:09 2009
@@ -38,8 +38,8 @@
 
 public class TestMultipleSchemaNames extends SingleEMFTestCase {
 
-    static DBDictionary dict = null;
-    static Boolean skipTests = null;
+    static private DBDictionary dict = null;
+    static private Boolean skipTests = null;
     
     public void setUp() {
         // Need to skip tests on MySQL, Oracle and MS SQL Server
@@ -54,10 +54,12 @@
                     (dict instanceof OracleDictionary) ||
                     (dict instanceof SQLServerDictionary)) {
                 skipTests = Boolean.TRUE;
+                // do some logging
+                emf.getConfiguration().getLog("Tests").trace(
+                    "TestMultipleSchemaNames() - Skipping all tests - Not supported on this
DB");
             } else {
                 skipTests = Boolean.FALSE;
-            }
-            
+            }            
             closeEMF(emf);
         }
         
@@ -434,7 +436,6 @@
         em.close();
     }
 
-
     /**
      * Create necessary schemas if running on PostgreSQL as it does
      * not create them automatically.

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?rev=812974&r1=812973&r2=812974&view=diff
==============================================================================
--- 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
Wed Sep  9 14:29:09 2009
@@ -30,19 +30,15 @@
 import org.apache.openjpa.jdbc.sql.DBDictionary;
 import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI;
 import org.apache.openjpa.persistence.OpenJPAEntityManagerSPI;
-import org.apache.openjpa.persistence.test.AllowFailure;
 import org.apache.openjpa.persistence.test.SingleEMFTestCase;
 import org.apache.openjpa.persistence.xmlmapping.entities.Customer;
 import org.apache.openjpa.persistence.xmlmapping.entities.EAddress;
 import org.apache.openjpa.persistence.xmlmapping.entities.Order;
 import org.apache.openjpa.persistence.xmlmapping.entities.Customer.CreditRating;
 import org.apache.openjpa.persistence.xmlmapping.xmlbindings.myaddress.Address;
-import org.apache.openjpa.persistence.xmlmapping.xmlbindings.myaddress.
-        CANAddress;
-import org.apache.openjpa.persistence.xmlmapping.xmlbindings.myaddress.
-        ObjectFactory;
-import org.apache.openjpa.persistence.xmlmapping.xmlbindings.myaddress.
-        USAAddress;
+import org.apache.openjpa.persistence.xmlmapping.xmlbindings.myaddress.CANAddress;
+import org.apache.openjpa.persistence.xmlmapping.xmlbindings.myaddress.ObjectFactory;
+import org.apache.openjpa.persistence.xmlmapping.xmlbindings.myaddress.USAAddress;
 
 /**
  * Test query with predicates on persistent field mapped to XML column.
@@ -56,7 +52,7 @@
 public class TestXMLCustomerOrder
     extends SingleEMFTestCase {
 
-    private boolean enabled = false;
+    private static Boolean skipTests = null;
     
     private static final int ORDER_1_OID = 10;
     private static final double ORDER_1_AMOUNT = 850;
@@ -68,11 +64,23 @@
 
     public void setUp() {
         // skip test if dictionary has no support for XML column type
-        if (!dictionarySupportsXMLColumn()) {
-            return;
+        if (skipTests == null) {
+            if (!dictionarySupportsXMLColumn()) {
+                skipTests = Boolean.TRUE;
+                // do some logging
+                OpenJPAEntityManagerFactorySPI emf = createEMF();
+                emf.getConfiguration().getLog("Tests").trace(
+                    "TestXMLCustomerOrder() - Skipping all tests - No XML Column support");
+                closeEMF(emf);
+            } else {
+                skipTests = Boolean.FALSE;
+            }
         }
 
-        enabled = true;
+        if (skipTests) {
+            return;
+        }
+        
         setUp(Customer.class, Customer.CustomerKey.class, Order.class,
             EAddress.class, CLEAR_TABLES);
         EntityManager em = emf.createEntityManager();
@@ -84,8 +92,9 @@
 
     @SuppressWarnings("unchecked")
     public void testXMLFieldProjection() {
-        if (!enabled)
+        if (skipTests) {
             return;
+        }
         
         EntityManager em = emf.createEntityManager();
         List<Address> addrs = em.createQuery(
@@ -107,8 +116,9 @@
     
     @SuppressWarnings("unchecked")
     public void testXMLFieldInEntity() {
-        if (!enabled)
+        if (skipTests) {
             return;
+        }
         
         EntityManager em = emf.createEntityManager();
         List<Order> orders = em.createQuery(
@@ -132,8 +142,9 @@
 
     @SuppressWarnings("unchecked")
     public void testXMLStringToXMLStringComparison() {
-        if (!enabled)
+        if (skipTests) {
             return;
+        }
         
         EntityManager em = emf.createEntityManager();
         List<Object[]> orders = em.createQuery(
@@ -160,8 +171,9 @@
 
     @SuppressWarnings("unchecked")
     public void testXMLStringToEmbeddedStringComparison() {
-        if (!enabled)
+        if (skipTests) {
             return;
+        }
         
         EntityManager em = emf.createEntityManager();
         List<Order> orders = em.createQuery(
@@ -178,8 +190,9 @@
 
     @SuppressWarnings("unchecked")
     public void testXMLStringToConstantStringComparison() {
-        if (!enabled)
+        if (skipTests) {
             return;
+        }
         
         EntityManager em = emf.createEntityManager();
         List<Order> orders = em.createQuery(
@@ -195,8 +208,9 @@
 
     @SuppressWarnings("unchecked")
     public void testXMLStringToParameterStringComparison() {
-        if (!enabled)
+        if (skipTests) {
             return;
+        }
         
         EntityManager em = emf.createEntityManager();
         Query query = em.createQuery(
@@ -213,8 +227,9 @@
 
     @SuppressWarnings("unchecked")
     public void testParameterStringToXMLStringComparison() {
-        if (!enabled)
+        if (skipTests) {
             return;
+        }
         
         EntityManager em = emf.createEntityManager();
         Query query = em.createQuery(
@@ -230,8 +245,9 @@
     }
 
     public void testUpdate() {
-        if (!enabled)
+        if (skipTests) {
             return;
+        }
         
         EntityManager em = emf.createEntityManager();
         em.getTransaction().begin();
@@ -257,8 +273,9 @@
     }
 
     public void testNullify() {
-        if (!enabled)
+        if (skipTests) {
             return;
+        }
         
         EntityManager em = emf.createEntityManager();
         em.getTransaction().begin();
@@ -281,8 +298,9 @@
     }
 
     public void testXMLStringToConstantIntComparison() {
-        if (!enabled)
+        if (skipTests) {
             return;
+        }
         
         EntityManager em = emf.createEntityManager();
         try {
@@ -298,8 +316,9 @@
     }
 
     public void testXMLListToConstantStringComparison() {
-        if (!enabled)
+        if (skipTests) {
             return;
+        }
         
         EntityManager em = emf.createEntityManager();
         try {
@@ -315,8 +334,9 @@
     }
 
     public void testSubclassPropertyInXMLFieldComparison() {
-        if (!enabled)
+        if (skipTests) {
             return;
+        }
         
         EntityManager em = emf.createEntityManager();
         try {



Mime
View raw message