Re: Dealing with EOUtilities.localInstanceOfObject() in WOUnit
Re: Dealing with EOUtilities.localInstanceOfObject() in WOUnit
- Subject: Re: Dealing with EOUtilities.localInstanceOfObject() in WOUnit
- From: Henrique Prange <email@hidden>
- Date: Sun, 10 Jul 2011 19:39:50 -0300
On 10/07/2011, at 08:04, Paul Hoadley wrote: Hi Henrique,
I'm using WOUnit 1.1.1 to unit test some code that indirectly calls EOUtilities.localInstanceOfObject() for whatever reason on an EO that I've inserted into a MockEditingContext. Because the EO has not been saved to the (non-existent) DB, the local-instance fails and returns null, and I get an NPE. I could certainly set up an in-memory DB using H2, but I'd prefer to avoid the work.
What happen if you call saveChanges in your MockEditingContext before calling the EOUtilities.localInstanceOfObject? AFAIR, calling EOUtilities.localInstanceOfObject on unsaved objects result in null even with real editing contexts.
Cheers,
Henrique
All I want to know is whether you think it's even _possible_ for WOUnit to work around this, in which case I'll request the feature, and gladly help you test it! I assume it's not.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden