db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Bouschen <mbo.t...@spree.de>
Subject Re: TCK completeness interface
Date Thu, 06 Apr 2006 14:34:28 GMT
Hi Craig,

I think this issue appears at two different places:

(1) Method compare(Object o1, Object o2) in all company classes 
delegates to the compareTo method and casts the first argument to the 
class instead of the interface:
     public int compare(Object o1, Object o2) {
         return ((Insurance)o1).compareTo(o2);
     }
This requires adding the compareTo methods to the interfaces.

(2) Method deepCompareFields in Department and FullTimeEmployee cast the 
argument to the class instead of the interface:
     public boolean deepCompareFields(Object other,
                                      EqualityHelper helper) {
         Department otherDept = (Department)other;

I understood you already started to fix this, correct? Anyway, you find 
my changed attached. They compile, but I could not test it.

Regards Michael

> Hi Erik,
> 
> Great news. If you are this far, then you have succeeded in storing  and 
> retrieving instances to the database. I'll have a fix for you  shortly.
> 
> Craig
> 
> On Apr 6, 2006, at 4:06 AM, Erik Bengtson wrote:
> 
>> Craig,
>>
>> The "null" issue is over. It was a reachability issue where JPOX  
>> nullify all
>> fields before deleting from the database.
>>
>> Now there is another issue in the CompletenessTest.test method  where 
>> it falls
>> the expected object tree back to the concrete classes. It compares  a 
>> concrete
>> object tree to the tree of objects generated by JPOX.
>>
>> The code has a cast to Department and invoke to compareTo, and this  
>> code will
>> not work for interfaces.
>>
>>     [java] 1) test(org.apache.jdo.tck.mapping.CompletenessTest) 
>> java.lang.ClassCa
>> stException: org.apache.jdo.tck.pc.company.IDepartmentImpl
>>     [java]      at org.apache.jdo.tck.pc.company.Department.compare 
>> (Department.j
>> ava:297)
>>     [java]      at java.util.Arrays.mergeSort(Arrays.java:1284)
>>     [java]      at java.util.Arrays.sort(Arrays.java:1223)
>>     [java]      at java.util.Collections.sort(Collections.java:159)
>>     [java]      at org.apache.jdo.tck.util.EqualityHelper.deepEquals 
>> (EqualityHel
>> per.java:477)
>>     [java]      at  
>> org.apache.jdo.tck.pc.company.Company.deepCompareFields(Compa
>> ny.java:224)
>>     [java]      at org.apache.jdo.tck.mapping.CompletenessTest.test 
>> (Completeness
>> Test.java:108)
>>
>>
> 
> Craig Russell
> Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
> 408 276-5638 mailto:Craig.Russell@sun.com
> P.S. A good JDO? O, Gasp!
> 


-- 
Michael Bouschen		Tech@Spree Engineering GmbH
mailto:mbo.tech@spree.de	http://www.tech.spree.de/
Tel.:++49/30/235 520-33		Buelowstr. 66			
Fax.:++49/30/2175 2012		D-10783 Berlin			

Mime
View raw message