openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From curti...@apache.org
Subject svn commit: r1097537 - /openjpa/sandboxes/perf-2.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xml/TestToOneLazyXmlOverride.java
Date Thu, 28 Apr 2011 16:30:43 GMT
Author: curtisr7
Date: Thu Apr 28 16:30:43 2011
New Revision: 1097537

URL: http://svn.apache.org/viewvc?rev=1097537&view=rev
Log:
Fix test.

Modified:
    openjpa/sandboxes/perf-2.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xml/TestToOneLazyXmlOverride.java

Modified: openjpa/sandboxes/perf-2.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xml/TestToOneLazyXmlOverride.java
URL: http://svn.apache.org/viewvc/openjpa/sandboxes/perf-2.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xml/TestToOneLazyXmlOverride.java?rev=1097537&r1=1097536&r2=1097537&view=diff
==============================================================================
--- openjpa/sandboxes/perf-2.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xml/TestToOneLazyXmlOverride.java
(original)
+++ openjpa/sandboxes/perf-2.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xml/TestToOneLazyXmlOverride.java
Thu Apr 28 16:30:43 2011
@@ -35,29 +35,28 @@ public class TestToOneLazyXmlOverride ex
 
     public void testToManyLazyOverride() {
         EntityManager em = emf.createEntityManager();
-        try{
-        em.getTransaction().begin();
-        XmlOverrideToOneEntity x = new XmlOverrideToOneEntity();
-        x.setOtherM2O(x);
-        x.setOtherO2O(x);
-        em.persist(x);
-        em.getTransaction().commit();
+        try {
+            em.getTransaction().begin();
+            XmlOverrideToOneEntity x = new XmlOverrideToOneEntity();
+            x.setOtherM2O(x);
+            x.setOtherO2O(x);
+            em.persist(x);
+            em.getTransaction().commit();
 
-        em.clear();
-        resetSQL();
+            em.clear();
+            resetSQL();
 
-        em.find(XmlOverrideToOneEntity.class, x.getId());
-        for (String lastSql : sql) {
-            // Make sure we don't have any joins!
-            assertFalse("Shouldn't have found any instances of join or JOIN in last sql,
but did. Last SQL = "
-                + lastSql, lastSql.contains("join") || lastSql.contains("JOIN"));
-        }
-        }finally{
-            if(em.getTransaction().isActive()){
+            em.find(XmlOverrideToOneEntity.class, x.getId());
+            for (String lastSql : sql) {
+                // Make sure we don't have any joins!
+                assertFalse("Shouldn't have found any instances of join or JOIN in last sql,
but did. Last SQL = "
+                    + lastSql, lastSql.contains("join") || lastSql.contains("JOIN"));
+            }
+        } finally {
+            if (em.getTransaction().isActive()) {
                 em.getTransaction().rollback();
             }
             em.close();
-            }
         }
     }
 }



Mime
View raw message