db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r609390 - in /db/jdo/trunk: tck2-legacy/src/java/org/apache/jdo/tck/query/QueryTest.java tck2/src/java/org/apache/jdo/tck/query/QueryTest.java
Date Sun, 06 Jan 2008 20:05:18 GMT
Author: mbo
Date: Sun Jan  6 12:05:17 2008
New Revision: 609390

URL: http://svn.apache.org/viewvc?rev=609390&view=rev
Log:
Fix minor bug in QueryTest in using variable pm from the superclass; the variable might not
have been initialized

Modified:
    db/jdo/trunk/tck2-legacy/src/java/org/apache/jdo/tck/query/QueryTest.java
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/query/QueryTest.java

Modified: db/jdo/trunk/tck2-legacy/src/java/org/apache/jdo/tck/query/QueryTest.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2-legacy/src/java/org/apache/jdo/tck/query/QueryTest.java?rev=609390&r1=609389&r2=609390&view=diff
==============================================================================
--- db/jdo/trunk/tck2-legacy/src/java/org/apache/jdo/tck/query/QueryTest.java (original)
+++ db/jdo/trunk/tck2-legacy/src/java/org/apache/jdo/tck/query/QueryTest.java Sun Jan  6 12:05:17
2008
@@ -200,7 +200,7 @@
      */
     public CompanyModelReader loadAndPersistCompanyModel(PersistenceManager pm) {
         makePersistentAll(
-                getCompanyModelReaderForPersistentInstances().getRootList());
+            pm, getCompanyModelReaderForPersistentInstances().getRootList());
         return getCompanyModelReaderForPersistentInstances();
     }
     
@@ -211,15 +211,17 @@
      * instance allowing to access a compay model instance by name.
      */
     public MylibReader loadAndPersistMylib(PersistenceManager pm) {
-        makePersistentAll(getMylibReaderForPersistentInstances().getRootList());
+        makePersistentAll(
+            pm, getMylibReaderForPersistentInstances().getRootList());
         return getMylibReaderForPersistentInstances();
     }
 
     /**
      * Persists the given pc instances.
+     * @param pm the PersistenceManager
      * @param pcInstances the pc instances to persist
      */
-    private void makePersistentAll(List pcInstances) {
+    private void makePersistentAll(PersistenceManager pm, List pcInstances) {
         Transaction tx = pm.currentTransaction();
         tx.begin();
         try {
@@ -1117,6 +1119,7 @@
     private Object execute(String assertion, 
             QueryElementHolder queryElementHolder, boolean asSingleString,
             Object parameters, Object expectedResult) {
+        PersistenceManager pm = getPM();
         Query query = asSingleString ?
                 queryElementHolder.getSingleStringQuery(pm) :
                     queryElementHolder.getAPIQuery(pm);
@@ -1374,6 +1377,7 @@
     private void delete(String assertion, 
             QueryElementHolder queryElementHolder, boolean asSingleString,
             Object parameters, long expectedNrOfDeletedObjects) {
+        PersistenceManager pm = getPM();
         Query query = asSingleString ?
                 queryElementHolder.getSingleStringQuery(pm) :
                     queryElementHolder.getAPIQuery(pm);

Modified: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/query/QueryTest.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/query/QueryTest.java?rev=609390&r1=609389&r2=609390&view=diff
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/query/QueryTest.java (original)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/query/QueryTest.java Sun Jan  6 12:05:17
2008
@@ -200,7 +200,7 @@
      */
     public CompanyModelReader loadAndPersistCompanyModel(PersistenceManager pm) {
         makePersistentAll(
-                getCompanyModelReaderForPersistentInstances().getRootList());
+            pm, getCompanyModelReaderForPersistentInstances().getRootList());
         return getCompanyModelReaderForPersistentInstances();
     }
     
@@ -211,15 +211,17 @@
      * instance allowing to access a compay model instance by name.
      */
     public MylibReader loadAndPersistMylib(PersistenceManager pm) {
-        makePersistentAll(getMylibReaderForPersistentInstances().getRootList());
+        makePersistentAll(
+            pm, getMylibReaderForPersistentInstances().getRootList());
         return getMylibReaderForPersistentInstances();
     }
 
     /**
      * Persists the given pc instances.
+     * @param pm the PersistenceManager
      * @param pcInstances the pc instances to persist
      */
-    private void makePersistentAll(List pcInstances) {
+    private void makePersistentAll(PersistenceManager pm, List pcInstances) {
         Transaction tx = pm.currentTransaction();
         tx.begin();
         try {
@@ -1117,6 +1119,7 @@
     private Object execute(String assertion, 
             QueryElementHolder queryElementHolder, boolean asSingleString,
             Object parameters, Object expectedResult) {
+        PersistenceManager pm = getPM();
         Query query = asSingleString ?
                 queryElementHolder.getSingleStringQuery(pm) :
                     queryElementHolder.getAPIQuery(pm);
@@ -1374,6 +1377,7 @@
     private void delete(String assertion, 
             QueryElementHolder queryElementHolder, boolean asSingleString,
             Object parameters, long expectedNrOfDeletedObjects) {
+        PersistenceManager pm = getPM();
         Query query = asSingleString ?
                 queryElementHolder.getSingleStringQuery(pm) :
                     queryElementHolder.getAPIQuery(pm);



Mime
View raw message