Update of /var/cvs/tests/bridge/org/mmbase/bridge
In directory james.mmbase.org:/tmp/cvs-serv11485

Modified Files:
        TransactionTest.java 
Log Message:
creating a relation to the (deleted) node. This now gives a Database exception 
(Integrity constraint violation). In the spirit of MMB-1680.


See also: http://cvs.mmbase.org/viewcvs/tests/bridge/org/mmbase/bridge
See also: http://www.mmbase.org/jira/browse/MMB-1680


Index: TransactionTest.java
===================================================================
RCS file: /var/cvs/tests/bridge/org/mmbase/bridge/TransactionTest.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- TransactionTest.java        22 Jul 2008 05:34:14 -0000      1.11
+++ TransactionTest.java        22 Jul 2008 05:51:59 -0000      1.12
@@ -19,7 +19,7 @@
  * Test class <code>Transaction</code> from the bridge package.
  *
  * @author Michiel Meeuwissen
- * @version $Id: TransactionTest.java,v 1.11 2008/07/22 05:34:14 michiel Exp $
+ * @version $Id: TransactionTest.java,v 1.12 2008/07/22 05:51:59 michiel Exp $
  * @since MMBase-1.8.6
   */
 public class TransactionTest extends BridgeTest {
@@ -259,6 +259,12 @@
         }
 
         try {
+            // make a relation to the (deleted) node, but in the transaction, 
where the node still
+            // exists.
+            // This demonstrate that there is an actual problem if the node 
ends up non-existing now.
+            Node url = t.getNodeManager("urls").createNode();
+            RelationManager rm = t.getRelationManager("news", "urls", 
"posrel");
+            Relation r = nodeInTransaction.createRelation(url, rm);
             t.commit();
         } catch (Exception e) {
             // should not give exception. MMB-1680
@@ -267,6 +273,7 @@
         }
 
         assertTrue(cloud.hasNode(newNode2));
+        assertEquals(1, cloud.getNode(newNode2).countRelations());
     }
 
 
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to