db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r381489 - /db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/metadata/MetadataMultithreadedTest.java
Date Mon, 27 Feb 2006 23:36:49 GMT
Author: arminw
Date: Mon Feb 27 15:36:47 2006
New Revision: 381489

URL: http://svn.apache.org/viewcvs?rev=381489&view=rev
Log:
remove redundant object handling to fix deadlock problem with SQLServer

Modified:
    db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/metadata/MetadataMultithreadedTest.java

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/metadata/MetadataMultithreadedTest.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/metadata/MetadataMultithreadedTest.java?rev=381489&r1=381488&r2=381489&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/metadata/MetadataMultithreadedTest.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/metadata/MetadataMultithreadedTest.java
Mon Feb 27 15:36:47 2006
@@ -1,12 +1,16 @@
 package org.apache.ojb.broker.metadata;
 
-import java.util.ArrayList;
-import java.util.List;
 import java.util.Collection;
 import java.util.Iterator;
+import java.util.List;
 
 import org.apache.commons.lang.ClassUtils;
-import org.apache.ojb.broker.*;
+import org.apache.ojb.broker.Article;
+import org.apache.ojb.broker.OJBRuntimeException;
+import org.apache.ojb.broker.PersistenceBroker;
+import org.apache.ojb.broker.PersistenceBrokerFactory;
+import org.apache.ojb.broker.Person;
+import org.apache.ojb.broker.ProductGroupWithCollectionProxy;
 import org.apache.ojb.broker.accesslayer.OJBIterator;
 import org.apache.ojb.broker.query.Query;
 import org.apache.ojb.broker.query.QueryByCriteria;
@@ -100,14 +104,14 @@
             Iterator groupIter;
             ProductGroupWithCollectionProxy pg;
 
-            assertNotNull(groupIter = (OJBIterator) broker.getIteratorByQuery(query));
+            assertNotNull(groupIter = broker.getIteratorByQuery(query));
             assertTrue(groupIter.hasNext());
 
             // We have not named any OJB profiles, so using dynamic proxies at this stage
is not
             // supported
             Throwable expectedThrowable = null;
             try {
-                System.err.println("------ The following exception is part of the tests...");
+                //System.err.println("------ The following exception is part of the tests...");
                 groupIter.next();
             } catch (Throwable t) {
                 expectedThrowable = t;
@@ -354,48 +358,11 @@
                     Query query = new QueryByCriteria(Person.class, null, true);
                     broker.getCollectionByQuery(query);
                     // store target object
-                    /*
-                    store some complex objects to check if references to
-                    metadata classes are cached
-                    */
-                    Project project = new Project();
-                    project.setTitle(title);
-
-                    Person p1 = new Person();
-                    p1.setFirstname(title);
-                    List l1 = new ArrayList();
-                    l1.add(project);
-                    p1.setProjects(l1);
-
-                    Person p2 = new Person();
-                    p2.setFirstname(title);
-                    List l2 = new ArrayList();
-                    l2.add(project);
-                    p2.setProjects(l2);
-
-                    Role r1 = new Role();
-                    r1.setPerson(p1);
-                    r1.setRoleName(title);
-                    r1.setProject(project);
-                    List roles1 = new ArrayList();
-                    roles1.add(r1);
-
-                    Role r2 = new Role();
-                    r2.setPerson(p2);
-                    r2.setRoleName(title);
-                    r2.setProject(project);
-                    List roles2 = new ArrayList();
-                    roles2.add(r2);
-
-                    p1.setRoles(roles1);
-                    p2.setRoles(roles2);
 
                     Object obj = ClassHelper.newInstance(targetTestClass);
 
                     broker.beginTransaction();
                     broker.store(obj);
-                    broker.store(p1);
-                    broker.store(p2);
                     broker.commitTransaction();
                     // delete target object
                     broker.beginTransaction();



---------------------------------------------------------------------
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