db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r452685 - /db/ojb/trunk/src/test/org/apache/ojb/odmg/OdmgExamples.java
Date Wed, 04 Oct 2006 00:35:22 GMT
Author: arminw
Date: Tue Oct  3 17:35:17 2006
New Revision: 452685

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

Modified:
    db/ojb/trunk/src/test/org/apache/ojb/odmg/OdmgExamples.java

Modified: db/ojb/trunk/src/test/org/apache/ojb/odmg/OdmgExamples.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/test/org/apache/ojb/odmg/OdmgExamples.java?view=diff&rev=452685&r1=452684&r2=452685
==============================================================================
--- db/ojb/trunk/src/test/org/apache/ojb/odmg/OdmgExamples.java (original)
+++ db/ojb/trunk/src/test/org/apache/ojb/odmg/OdmgExamples.java Tue Oct  3 17:35:17 2006
@@ -5,6 +5,7 @@
 import org.apache.ojb.broker.Identity;
 import org.apache.ojb.broker.PersistenceBroker;
 import org.apache.ojb.broker.TestHelper;
+import org.apache.ojb.broker.PersistenceConfiguration;
 import org.apache.ojb.broker.metadata.ClassDescriptor;
 import org.apache.ojb.junit.OJBTestCase;
 import org.apache.ojb.odmg.collections.DListImpl;
@@ -243,8 +244,9 @@
 
     public void testNrmAndDlists() throws Exception
     {
+        Class oldCollectionClass = null;
         // get facade instance
-        Implementation odmg = OJB.getInstance();
+        ImplementationImpl odmg = (ImplementationImpl) OJB.getInstance();
         Database db = odmg.newDatabase();
         //open database
         try
@@ -262,7 +264,9 @@
         {
             //=============================
             // this test needs DList impl as oql query collection class
-            ((ImplementationImpl) odmg).setOqlCollectionClass(DListImpl.class);
+            PersistenceConfiguration pc = odmg.getCurrentDatabase().getPersistenceConfiguration();
+            oldCollectionClass = pc.getCollectionFactory().getCollectionTypes().getOQLQuery();
+            pc.getCollectionFactory().getCollectionTypes().setOQLQuery(DListImpl.class);
             //=============================
 
             tx.begin();
@@ -298,10 +302,14 @@
 
         }
         catch (Exception e)
-
         {
             tx.abort();
             throw e;
+        }
+        finally
+        {
+            PersistenceConfiguration pc = odmg.getCurrentDatabase().getPersistenceConfiguration();
+            if(oldCollectionClass != null) pc.getCollectionFactory().getCollectionTypes().setOQLQuery(oldCollectionClass);
         }
 
         // close database



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message