• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Dealing with EOUtilities.localInstanceOfObject() in WOUnit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dealing with EOUtilities.localInstanceOfObject() in WOUnit


  • Subject: Re: Dealing with EOUtilities.localInstanceOfObject() in WOUnit
  • From: Paul Hoadley <email@hidden>
  • Date: Mon, 11 Jul 2011 09:59:58 +0930

On 11/07/2011, at 8:09 AM, Henrique Prange 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.

Oh, sorry—it hadn't even occurred to me to try.  I gave up too early.  It works just fine.


--
Paul.

http://logicsquad.net/


 _______________________________________________
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

References: 
 >Dealing with EOUtilities.localInstanceOfObject() in WOUnit (From: Paul Hoadley <email@hidden>)
 >Re: Dealing with EOUtilities.localInstanceOfObject() in WOUnit (From: Henrique Prange <email@hidden>)

  • Prev by Date: Re: Dealing with EOUtilities.localInstanceOfObject() in WOUnit
  • Next by Date: Re: Apple Representation On WebObjects-Dev Mailing List?
  • Previous by thread: Re: Dealing with EOUtilities.localInstanceOfObject() in WOUnit
  • Next by thread: Let's find a new name for the Community
  • Index(es):
    • Date
    • Thread