db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Watzek <mwa.t...@spree.de>
Subject Re: JDO-58
Date Wed, 01 Jun 2005 17:03:05 GMT
Hi Craig,

> Hi Michael,
> 
> On Jun 1, 2005, at 9:30 AM, Michael Watzek wrote:
> 
>> Hi Craig,
>>
>>>>> And we should probably disallow pmf == null in cases where there is 
>>>>> work to do.
>>>>
>>>>
>>>> I'm not sure. Do you mean that the test result is ERROR for test 
>>>> cases having "pmf == null in cases where there is work to do"? Let 
>>>> me know if you feel strong on this.
>>>
>>> I think so. Since this is a new feature, any test case that uses 
>>> tearDown methods should leave the PMF open. Can you think of a case 
>>> where this is not true?
>>
>> No. My question is: Do we want to *force* test cases to leave the PMF 
>> open when they add tear down instances and/or classes?
> 
> 
> Yes. Unless we can think of cases where the test method wants instances 
> removed but needs to close the PMF for some reason. I think in these 
> cases we can let the test method clean itself.
Ok. What do you think of adding a check in tearDown (before the other 
check):

if ((pmf == null || pmf.isClosed()) &&
     (this.tearDownInstances.size() > 0 || this.tearDownClasses.size() > 0))
    throw new JDOFatalException ("PMF must not be nullified or closed 
when tear down instances and /or classes have been added.");

Michael
-- 
-------------------------------------------------------------------
Michael Watzek                  Tech@Spree Engineering GmbH
mailto:mwa.tech@spree.de        Buelowstr. 66
Tel.:  ++49/30/235 520 36       10783 Berlin - Germany
Fax.:  ++49/30/217 520 12       http://www.spree.de/
-------------------------------------------------------------------

Mime
View raw message