[
https://issues.apache.org/jira/browse/JDO-521?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12523350
]
Craig Russell commented on JDO-521:
-----------------------------------
Here are all the negative tests that I came up with:
Error conditions
setting both sides of a one-to-one relationship such that they do not refer to
each other
a1 <-> b1 // pre-condition
a2 <-> b2 // pre-condition
a3 = new A() // pre-condition
a1.setB(b2); b2.setA(a3); // error on flush
setting one side of a one-to-one relationship and setting the other side to null
a1 <-> b1 // pre-condition
a2 <-> b2 // pre-condition
a1.setB(b2); b2.setA(null); // error on flush
setting one side of a one-to-many relationship and deleting the other side
d1 <-> e1, e2 // pre-condition
d2.add(e1); pm.deletePersistent(e1); // error on flush
adding a related instance (with a single-valued mapped-by relationship field)
to more than one one-to-many collection relationship
e1 = new E();
d1.add(e1); d2.add(e1); // error on flush
adding a related instance to a collection and setting the other side to a
different instance
e1 = new E();
d1.add(e1); e1.setD(d2); // error on flush
adding a related instance to a collection and deleting the related instance
d1 <-> e1, e2 // pre-condition
d2.add(e1); pm.deletePersistent(e1); // error on flush
> Create tests for relationship mapping (spec section 15.3)
> ---------------------------------------------------------
>
> Key: JDO-521
> URL: https://issues.apache.org/jira/browse/JDO-521
> Project: JDO
> Issue Type: Test
> Components: tck2
> Affects Versions: JDO 2 maintenance release 1
> Reporter: Michelle Caisse
> Assignee: Michelle Caisse
> Attachments: JDO-521.patch
>
>
> We need a set of tests to test that an implementation syncs both sides of a
> relationship on flush().
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.