openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r673855 - in /openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test: PersistenceTestCase.java SingleEMFTestCase.java
Date Thu, 03 Jul 2008 22:41:07 GMT
Author: ppoddar
Date: Thu Jul  3 15:41:07 2008
New Revision: 673855

URL: http://svn.apache.org/viewvc?rev=673855&view=rev
Log:
OPENJPA-652: Formatting to be published base TestCases

Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.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/test/PersistenceTestCase.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java?rev=673855&r1=673854&r2=673855&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java
Thu Jul  3 15:41:07 2008
@@ -43,10 +43,15 @@
     extends TestCase {
 
     /**
-     * Marker object you an pass to {@link #setUp} to indicate that the
-     * database tables should be cleared.
+     * Marker object you pass to {@link #setUp} to indicate that the
+     * database table rows should be cleared.
      */
     protected static final Object CLEAR_TABLES = new Object();
+
+    /**
+     * Marker object you pass to {@link #setUp} to indicate that the
+     * database table should be dropped and then recreated.
+     */
     protected static final Object DROP_TABLES = new Object();
 
     /**
@@ -152,7 +157,8 @@
     }
 
     /**
-     * Closes all open entity managers after first rolling back any open transactions
+     * Closes all open entity managers after first rolling back any open 
+     * transactions.
      */
     protected void closeAllOpenEMs(EntityManagerFactory emf) {
         if (emf == null || !emf.isOpen())
@@ -196,15 +202,17 @@
     protected void clear(EntityManagerFactory emf) {
         if (emf == null)
             return;
-        clear(emf, true, ((OpenJPAEntityManagerFactorySPI) emf).getConfiguration().
-            getMetaDataRepositoryInstance().getMetaDatas());
+        clear(emf, true, ((OpenJPAEntityManagerFactorySPI) emf)
+        		.getConfiguration()
+        		.getMetaDataRepositoryInstance().getMetaDatas());
     }
 
     /**
      * Delete all instances of the given types using bulk delete queries.
      * @param closeEMs TODO
      */
-    private void clear(EntityManagerFactory emf, boolean closeEMs, ClassMetaData... types)
{
+    private void clear(EntityManagerFactory emf, boolean closeEMs, 
+    		ClassMetaData... types) {
         if (emf == null || types.length == 0)
             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=673855&r1=673854&r2=673855&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 Jul  3 15:41:07 2008
@@ -21,6 +21,17 @@
 import org.apache.openjpa.jdbc.meta.ClassMapping;
 import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI;
 
+/**
+ * Base class for OpenJPA-specific Test Case.
+ * Provides utilities for configuration setup and persistent entity 
+ * registration during setUp() method.
+ * Derived classes can access protected EntityManagerFactory to create 
+ * EntityManager. The protected EntityManagerFactory is declared to be
+ * OpenJPA-extended SPI interface <code>OpenJPAEntityManagerFactorySPI</code>
+ * so that derived classes can access internal mapping/metadata/configuration
+ * and other structures.  
+ *   
+ */
 public abstract class SingleEMFTestCase
     extends PersistenceTestCase {
 
@@ -71,8 +82,7 @@
     /**
      * Get the class mapping for a given entity
      * 
-     * @param name
-     *            The Entity's name.
+     * @param name The Entity's name.
      * 
      * @return If the entity is a known type the ClassMapping for the Entity
      *         will be returned. Otherwise null



Mime
View raw message