db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcai...@apache.org
Subject svn commit: r574622 - /db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/mapping/RelationshipManyToManyNoRelationships.java
Date Tue, 11 Sep 2007 15:12:11 GMT
Author: mcaisse
Date: Tue Sep 11 08:12:10 2007
New Revision: 574622

URL: http://svn.apache.org/viewvc?rev=574622&view=rev
Log:
JDO-521 Removed unnecessary use of emp4, proj2, fixing bug in instance referred to.

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

Modified: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/mapping/RelationshipManyToManyNoRelationships.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/mapping/RelationshipManyToManyNoRelationships.java?rev=574622&r1=574621&r2=574622&view=diff
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/mapping/RelationshipManyToManyNoRelationships.java
(original)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/mapping/RelationshipManyToManyNoRelationships.java
Tue Sep 11 08:12:10 2007
@@ -59,8 +59,7 @@
     public static void main(String[] args) {
         BatchTestRunner.run(RelationshipManyToManyNoRelationships.class);
     }
-    
-    
+        
     /**
      * @see JDO_Test#localSetUp()
      */
@@ -91,19 +90,15 @@
     public void testAddFromMappedSide() {
         testMethod = "testAddFromMappedSide";
         if (isTestToBePerformed) {
-            Object emp4Oid = getOidByName("emp4");
-            Employee emp4 = (Employee)pm.getObjectById(emp4Oid);
-            Object proj2Oid = getOidByName("proj2");
-            Project proj2 = (Project)pm.getObjectById(proj2Oid);
             
             // Set relationship
             Set emps = new HashSet();
-            emps.add(emp4);
+            emps.add(emp1);
             proj1.setMembers(emps);
             pm.flush();
             
             // Postcondition
-            deferredAssertTrue(emp4.getProjects().contains(proj1),
+            deferredAssertTrue(emp1.getProjects().contains(proj1),
                 ASSERTION_FAILED + testMethod,
                 "Postcondition is false; "
                 + "other side of relationship not set on flush");
@@ -112,11 +107,10 @@
             getPM();
             
             pm.currentTransaction().begin();
-            emp4 = (Employee)pm.getObjectById(emp4Oid);
+            emp1 = (Employee)pm.getObjectById(emp1Oid);
             proj1 = (Project)pm.getObjectById(proj1Oid);
-            proj2 = (Project)pm.getObjectById(proj2Oid);
             deferredAssertTrue(
-                emp4.getProjects().contains(proj1),
+                emp1.getProjects().contains(proj1),
                 ASSERTION_FAILED + testMethod,
                 "In new transaction, postcondition is false; " +
                 "other side of relationship is not set.");
@@ -130,19 +124,15 @@
     public void testAddFromMappedbySide() {
         testMethod = "testAddFromMappedbySide";
         if (isTestToBePerformed) {
-            Object emp4Oid = getOidByName("emp4");
-            Employee emp4 = (Employee)pm.getObjectById(emp4Oid);
-            Object proj2Oid = getOidByName("proj2");
-            Project proj2 = (Project)pm.getObjectById(proj2Oid);
             
             // Set relationship
             Set projs = new HashSet();
             projs.add(proj1);
-            emp4.setProjects(projs);
+            emp1.setProjects(projs);
             pm.flush();
             
             // Postcondition
-            deferredAssertTrue(proj1.getMembers().contains(emp4),
+            deferredAssertTrue(proj1.getMembers().contains(emp1),
                 ASSERTION_FAILED + testMethod,
                 "Postcondition is false; "
                 + "other side of relationship not set on flush");
@@ -154,7 +144,7 @@
             emp1 = (Employee)pm.getObjectById(emp1Oid);
             proj1 = (Project)pm.getObjectById(proj1Oid);
             deferredAssertTrue(
-                proj1.getMembers().contains(emp4),
+                proj1.getMembers().contains(emp1),
                 ASSERTION_FAILED + testMethod,
                 "In new transaction, postcondition is false; " +
                 "other side of relationship is not set.");



Mime
View raw message