openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hthom...@apache.org
Subject svn commit: r1673310 - in /openjpa/branches/2.2.1.x: ./ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cascade/pudefault/ openjpa-persistence-jdbc/src/test/resources/META-INF/ openjpa-persistence-jdbc/src/test/resources/org/apach...
Date Mon, 13 Apr 2015 22:59:58 GMT
Author: hthomann
Date: Mon Apr 13 22:59:58 2015
New Revision: 1673310

URL: http://svn.apache.org/r1673310
Log:
OPENJPA-1988: Made an update to the test case for this JIRA, i.e. merged r1642555 from 2.2.x
to 2.2.1.x.

Added:
    openjpa/branches/2.2.1.x/openjpa-persistence-jdbc/src/test/resources/META-INF/cascade-persist.xml
      - copied unchanged from r1642555, openjpa/branches/2.2.x/openjpa-persistence-jdbc/src/test/resources/META-INF/cascade-persist.xml
Removed:
    openjpa/branches/2.2.1.x/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/cascade/
Modified:
    openjpa/branches/2.2.1.x/   (props changed)
    openjpa/branches/2.2.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cascade/pudefault/TestPUDefaultCascadePersist.java
    openjpa/branches/2.2.1.x/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml

Propchange: openjpa/branches/2.2.1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Apr 13 22:59:58 2015
@@ -1,5 +1,5 @@
 /openjpa/branches/1.0.x:736493
 /openjpa/branches/2.0.x:1419659,1484136,1484287,1504611
 /openjpa/branches/2.1.x:1415379,1415398,1436150,1469090,1469949,1484300,1484313,1485010,1505837,1513249,1517838,1529241,1530146,1533218,1533280,1539188,1569528,1575444,1591536,1614935,1636464,1648430,1655218,1662610
-/openjpa/branches/2.2.x:1580898,1580939,1591681,1641906
+/openjpa/branches/2.2.x:1580898,1580939,1591681,1641906,1642555
 /openjpa/trunk:1416742,1420324,1430117,1431649,1436957,1436960,1448662,1448796,1451369,1456574,1456614,1459091,1461833,1469646,1469649,1469652,1504282,1600757,1603251

Modified: openjpa/branches/2.2.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cascade/pudefault/TestPUDefaultCascadePersist.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.2.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cascade/pudefault/TestPUDefaultCascadePersist.java?rev=1673310&r1=1673309&r2=1673310&view=diff
==============================================================================
--- openjpa/branches/2.2.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cascade/pudefault/TestPUDefaultCascadePersist.java
(original)
+++ openjpa/branches/2.2.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/cascade/pudefault/TestPUDefaultCascadePersist.java
Mon Apr 13 22:59:58 2015
@@ -19,46 +19,22 @@
 package org.apache.openjpa.persistence.cascade.pudefault;
 
 import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
 
-import org.apache.openjpa.persistence.OpenJPAPersistence;
 import org.apache.openjpa.persistence.test.SingleEMFTestCase;
 
 public class TestPUDefaultCascadePersist extends SingleEMFTestCase {
-    private EntityManagerFactory emf = null;
     public void setUp() throws Exception {
-        super.setUp();
-        emf = OpenJPAPersistence.
-                createEntityManagerFactory("TestPUDefaultCascadePersist", 
-                    "org/apache/openjpa/persistence/cascade/pudefault/META-INF/persistence.xml");
-        
-        EntityManager em = emf.createEntityManager();
-        try {
-            em.getTransaction().begin();
-            em.createQuery("DELETE FROM PUDEntityA01").executeUpdate();
-            em.createQuery("DELETE FROM PUDEntityA02").executeUpdate();
-            em.createQuery("DELETE FROM PUDEntityAE01").executeUpdate();
-            em.createQuery("DELETE FROM PUDEntityB").executeUpdate();
-            em.createQuery("DELETE FROM PUDEntityA01_PUDEntityB").executeUpdate();
-            em.createQuery("DELETE FROM PUDEntityA02_PUDEntityB").executeUpdate();
-            em.createQuery("DELETE FROM PUDEntityAE01_PUDEntityB").executeUpdate();
-            em.getTransaction().commit();
-        } catch (Throwable t) {
-            // Swallow
-        } finally {
-            if (em.getTransaction().isActive()) {
-                em.getTransaction().rollback();
-            }
-            em.close();
-        }
-//        super.setUp(PUDEntityA01.class, PUDEntityB.class,
-//            "org/apache/openjpa/persistence/cascade/pudefault/META-INF/cascadepersistorm.xml",
-//            CLEAR_TABLES);
+        super.setUp(PUDEntityA01.class, PUDEntityA02.class, PUDEntityAE01.class, PUDEntityB.class,
+            CLEAR_TABLES);
+    }
+    
+    protected String getPersistenceUnitName() {
+        return "TestPUDefaultCascadePersist";
     }
     
+    
     public void tearDown() throws Exception {
         super.tearDown();
-        emf.close();
     }
     
     public void testPUDefaultCascadePersistOverM2M() {
@@ -83,9 +59,10 @@ public class TestPUDefaultCascadePersist
             if (em.getTransaction().isActive()) {
                 em.getTransaction().rollback();
             }
+            em.close();
         }
                
-        em.close();
+        
         em = emf.createEntityManager();
         
         try {

Modified: openjpa/branches/2.2.1.x/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/openjpa/branches/2.2.1.x/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml?rev=1673310&r1=1673309&r2=1673310&view=diff
==============================================================================
--- openjpa/branches/2.2.1.x/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml
(original)
+++ openjpa/branches/2.2.1.x/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml
Mon Apr 13 22:59:58 2015
@@ -462,4 +462,19 @@
     </properties>
   </persistence-unit> 
 
+    <persistence-unit name="TestPUDefaultCascadePersist" transaction-type="RESOURCE_LOCAL">
+        <!--  <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
-->
+        <mapping-file>META-INF/cascade-persist.xml</mapping-file>
+        <class>org.apache.openjpa.persistence.cascade.pudefault.PUDEntityA01</class>
+        <class>org.apache.openjpa.persistence.cascade.pudefault.PUDEntityAE01</class>
+        <class>org.apache.openjpa.persistence.cascade.pudefault.PUDEntityA02</class>
+        <class>org.apache.openjpa.persistence.cascade.pudefault.PUDEntityB</class>
+        <class>org.apache.openjpa.persistence.cascade.pudefault.AnEmbeddable</class>
+        <class>org.apache.openjpa.persistence.cascade.pudefault.EmbeddableWithRelationships</class>
+        <properties>
+            <property name="openjpa.ConnectionFactoryProperties" value="MaxActive=110,
MaxIdle=10, ValidationTimeout=50000, 
+                                                                     MaxCachedStatements=10,
ValidationSQL='', MaxWait=10000, TestOnBorrow=true" />
+            <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"
/>
+        </properties>
+    </persistence-unit>
 </persistence>



Mime
View raw message