On Jul 10, 2011, at 5:39 PM, Henrique Prange <[email protected]> wrote:

> 
> 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.

Yes, the MockEditingContext is behaving correctly. 

Chuck


> 
> 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.
>> 
>> 
>> -- 
>> Paul.
>> 
>> http://logicsquad.net/
>> 
>> 
> 
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net
> 
> This email sent to [email protected]
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to