db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From an...@apache.org
Subject svn commit: r763963 - /db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/mapping/Relationship1ToManyAllRelationships.java
Date Fri, 10 Apr 2009 15:30:52 GMT
Author: andyj
Date: Fri Apr 10 15:30:51 2009
New Revision: 763963

URL: http://svn.apache.org/viewvc?rev=763963&view=rev
Log:
JDO-628 Change "contains" call to use iterator and comparison of object ids since the object
is in deleted state (and for datastore id would trigger an attempt to load fields)

Modified:
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/mapping/Relationship1ToManyAllRelationships.java

Modified: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/mapping/Relationship1ToManyAllRelationships.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/mapping/Relationship1ToManyAllRelationships.java?rev=763963&r1=763962&r2=763963&view=diff
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/mapping/Relationship1ToManyAllRelationships.java
(original)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/mapping/Relationship1ToManyAllRelationships.java
Fri Apr 10 15:30:51 2009
@@ -19,7 +19,11 @@
 
 import java.util.Date;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.Set;
+
+import javax.jdo.JDOHelper;
+
 import org.apache.jdo.tck.pc.company.Department;
 import org.apache.jdo.tck.pc.company.Employee;
 import org.apache.jdo.tck.pc.company.FullTimeEmployee;
@@ -410,7 +414,16 @@
             pm.flush();
             
             // Postcondition
-            deferredAssertTrue(!dept1.getEmployees().contains(emp1),
+            boolean contained = false;
+            Iterator iter = dept1.getEmployees().iterator();
+            while (iter.hasNext()) {
+        	Object elem = iter.next();
+        	if (JDOHelper.getObjectId(elem).equals(emp1)) {
+        	    contained = true;
+        	    break;
+        	}
+            }
+            deferredAssertTrue(!contained,
                 ASSERTION_FAILED + testMethod,
                 "Postcondition is false; "
                 + "other side of relationship not set on flush");



Mime
View raw message