| Summary: | Legacy fails in CDOWorkspace test cases | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | Martin Fluegge <martin.fluegge> | ||||||
| Component: | cdo.legacy | Assignee: | Martin Fluegge <martin.fluegge> | ||||||
| Status: | CLOSED FIXED | QA Contact: | Eike Stepper <stepper> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | Flags: | stepper:
review+
|
||||||
| Version: | 4.0 | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Martin Fluegge
Created attachment 180809 [details]
Test v1
I had a quick look and found out two interesting things:
1.) If the OrderDetail is not attached to the Product the test passes
2.) If the products are added to the resource after all other objects the test passes (even if the Product is attached to the OrderDetail)
So it seems that there is something wrong in the relationship between SalesOrder, Product and OderDetail.
I attached a smaller version of the WorkSpaceTest to make debugging easier.
Investigation is ongoing...
Created attachment 180816 [details]
Patch v1
O.k. Here?s the answer:
First, the resource created a Product. This led to the creation of an OrderDetail while the "oderdetails" feature was processed. This again created a SalesOrder (always talking about *.Impl) while setting the OrderDetails container feature. During the process of the SalesOrder the OrderDetails was set to the related containment feature. Everything is correct now, but remember that the OrderDetail is not yet finished. After creating a customer on the SalesOrder the SalesOrder was finished and returned to the OrderDetail and the container set. Still no problem.
Now comes the fun part.
When the OrderDetail set the "order" containment reference (our SalesOrder) by calling inverseAdd(?) the method call simply removed the OrderDetail from it?s container
So the answer is: Do not add the container if it is already attached.
I attached a patch to fix the problem.
You fixed it ;-) Committed to HEAD. Available in R20110608-1407 |