db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian McCallister <bri...@apache.org>
Subject Re: Cleaning up the datastore in tearDown
Date Tue, 09 Aug 2005 23:10:26 GMT
Minor point, but I would suggest doing it in setUp() for a couple  
reasons:

* You know datastore is in good state before test runs instead of after
* You can examine datastore state afterwards to double check things  
manually
* If things go wrong during the test, the evidence isn't erased

On Aug 9, 2005, at 5:51 PM, Craig Russell wrote:

> Hi,
>
> I'm thinking a better way of cleaning up might be:
>
> Extent toBeDeleted = pm.getExtent(parameterClass, false);
> Query toBeDelete = pm.newQuery(parameterClass, toBeDeleted);
> toBeDelete.deletePersistentAll();
>
> This doesn't require that the query be executed except for the  
> purposes of calling the jdoPreDelete callback, which is not an  
> issue in the TCK.
>
> Does JPOX support this? Would it help (I'm thinking of the issue  
> with CompletenessTest not cleaning up because of issues with  
> loading the instances).
>
> Craig
>
> 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!
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message