db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Braeuchi <jbraeu...@gmx.ch>
Subject Re: [junit] Still get junit errors
Date Sun, 14 Dec 2003 11:05:55 GMT
hi all,

the test can be forced to pass by adding

         q.addPrefetchedRelationship("allArticlesInGroup");

this forces the relationship to be loaded. but this is imo not the right 
way to do it :(

jakob

Jakob Braeuchi wrote:

> hi all,
> 
> i get an error in QueryTest#testPrefetchedArraySingleKey. Array of 
> articles is null when the using the proxy
> 
> ...
> //
> // use ProductGroupWithArray and Articles with original Proxy settings
> //
> broker.clearCache();
> cldArticle.setProxyClass(articleProxy);
> 
> crit = new Criteria();
> crit.addEqualTo("groupId", new Integer(5));
> q = QueryFactory.newQuery(ProductGroupWithArray.class, crit);
> results = broker.getCollectionByQuery(q);
> ProductGroupWithArray pg2 = (ProductGroupWithArray)results.toArray()[0];
> InterfaceArticle[] articles = pg2.getAllArticles();
> _assertNotNull_("Array of articles should not be null!", articles);
> assertTrue("Array should contain more than 0 entries!",articles.length 
> != 0);
> ...
> 
> 
> this is due to QueryReferenceBroker#performRetrievalTasks
> 
> ...
>      if (ord.isLazy() || (_ord.getItemProxyClass() != null_))
>      {
>        continue;
>      }
> ...
> 
> 
> jakob
> 
> Armin Waibel wrote:
> 
>> Hi Oleg,
>>
>> I still get
>>
>> 1 errors (+ one known failure) in PB
>> 3 failures in ODMG
>>
>> when running the test suite.
>>
>> What's wrong?
>>
>> regards,
>> Armin
>>
>> Oleg Nitz wrote:
>>
>>> On Saturday 13 December 2003 12:21, Thomas Mahler wrote:
>>>
>>>> thanks for the quick fix. Unfortunately you changes cause a problem 
>>>> with
>>>>  dynamic proxies. I get five junit errors after checking out your 
>>>> changes.
>>>
>>>
>>>
>>> Fixed!
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>>
>>>
>>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message