[jira] Commented: (JDO-466) Test for compound identity fails
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache JDO Project > [jira] Commented: (JDO-466) Test for compound identity fails




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    [jira] Commented: (JDO-466) Test for compound identity fails  
Andy Jefferson (JIRA)


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-19-07 12:11 PM


[ https://issues.apache.org/jira/brow...action_12474120 ]

Andy Jefferson commented on JDO-466:
------------------------------------

The PK class for the OrderItem has an incorrect equals() method. It uses "==
" but should use equals() ... like this

public boolean equals(Object obj) {
if (obj==null || !this.getClass().equals(obj.getClass()))
return false;
OrderItemOid o = (OrderItemOid) obj;
if ((!this.order.equals(o.order)) || (this.item != o.item)) {
return false;
}
return true;
}

The use of == means that when performing reachability checks JPOX tries to r
emove all reachables from the collection of newly persisted object ids and f
ails to remove the OrderItem ... hence it gets deleted by reachability. Chan
ging the equals() as above
passes the test :-)

> Test for compound identity fails
> --------------------------------
>
>                 Key: JDO-466
>                 URL: https://issues.apache.org/jira/browse/JDO-466
>             Project: JDO
>          Issue Type: Bug
>          Components: tck2
>    Affects Versions: JDO 2 maintenance release 1
>            Reporter: Michelle Caisse
>         Assigned To: Andy Jefferson
>
> The new test CompletenessTestOrder (use compoundidentity.conf) fails on th
e RI. It appears that the OrderItem instances are not persisted to the datab
ase.
>     [echo] Starting configuration="compoundidentity.conf" with databas
e="derby"identitytype="applicationidentity" mapping="".
>     [java] RUN CompletenessTestOrder.test          FAILURE
>     [java] Description: Completeness test with standard mapping using 
order model for compound identity testing
>     [java] Time: 009
>     [java] There was 1 failure:
>     [java] 1) test(org.apache.jdo.tck.mapping.CompletenessTestOrder)ju
nit.framework.AssertionFailedError: CompletenessTestOrder failed; see list o
f failures below:
>     [java] Expected this  instance:
>     [java]     org.apache.jdo.tck.pc.order.Order@40b181
>     [java] Got persistent instance:
>     [java]     org.apache.jdo.tck.pc.order.Order@1108727
>     [java] Detailed list of differences follows...
>     [java] Context: Order<1>.items
>     [java] expected '[org.apache.jdo.tck.pc.order.OrderItem@2]'
>     [java]   actual '[]'
>     [java]
>     [java]      at org.apache.jdo.tck.JDO_Test.fail(JDO_Test.java:639)
>     [java]      at org.apache.jdo.tck.mapping.CompletenessTestOrder.te
st(CompletenessTestOrder.java:122)
>     [java]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
 Method)
>     [java]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeM
ethodAccessorImpl.java:39)
>     [java]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Del
egatingMethodAccessorImpl.java:25)
>     [java]      at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:2
54)
>     [java]      at org.apache.jdo.tck.util.BatchTestRunner.doRun(Batch
TestRunner.java:108)
>     [java]      at org.apache.jdo.tck.util.BatchTestRunner.start(Batch
TestRunner.java:148)
>     [java]      at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunne
r.java:123)

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:46 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register