• 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: WOUnit testing with partial entities
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WOUnit testing with partial entities


  • Subject: Re: WOUnit testing with partial entities
  • From: Paul Hoadley <email@hidden>
  • Date: Fri, 21 Feb 2014 15:40:01 +1030

Hi Henrique,

On 21/02/2014, at 1:35 PM, Henrique Prange <email@hidden> wrote:

Does it work for you? As soon as you validate this SNAPSHOT I’m going to cut the 1.2.3 release.

Unfortunately, no change.  To give you a little more detail, I have a base class User in a framework, and an application-level partial entity HMUser.  There's an entity Job with a to-one relationship 'creator' in the model to HMUser so that HMUser has the inverse 'jobs' relationship.  This all works fine within the running application.  In testing, calling job.setCreator(user) for some Job job and some User user fails when it gets to setting that inverse relationship:

<com.webobjects.foundation.NSKeyValueCoding$UnknownKeyException message '<net.logicsquad.access.model.User 0x35c4795e> valueForKey(): lookup of unknown key: 'jobs'.
This class does not have an instance variable of the name jobs or _jobs, nor a method of the name jobs, _jobs, getJobs, or _getJobs' object '<net.logicsquad.access.model.User pk:"null">' key 'jobs'>
at com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.handleQueryWithUnboundKey(NSKeyValueCoding.java:1377)
at com.webobjects.eocontrol.EOCustomObject.handleQueryWithUnboundKey(EOCustomObject.java:1545)
at er.extensions.eof.ERXGenericRecord.handleQueryWithUnboundKey(ERXGenericRecord.java:1086)
at com.webobjects.foundation.NSKeyValueCoding$Utility.handleQueryWithUnboundKey(NSKeyValueCoding.java:494)
at com.webobjects.foundation.NSKeyValueCoding$_KeyBinding.valueInObject(NSKeyValueCoding.java:894)
at com.webobjects.eocontrol.EOCustomObject.valueForKey(EOCustomObject.java:1498)
at er.extensions.partials.ERXPartialGenericRecord.valueForKey(ERXPartialGenericRecord.java:92)
at er.extensions.eof.ERXGenericRecord$InverseRelationshipUpdater.takeStoredValueForKey(ERXGenericRecord.java:1490)
at er.extensions.eof.ERXGenericRecord.takeStoredValueForKey(ERXGenericRecord.java:1259)
at net.logicsquad.hydromaster.model.core._Job.setCreator(_Job.java:279)
at net.logicsquad.hydromaster.test.model.core.JobTest.jobMustHaveUniqueJobID(JobTest.java:68)

The stack trace is correct in that User doesn't have that key, but the properties of HMUser should have been merged so that it all just works, shouldn't they?

If what I'm trying to describe isn't clear, I'd be happy to put together a minimal test project—let me know.  Alternatively, if it looks like I'm misusing partials or WOUnit, let me know that as well!

PS.: Sorry for taking so long to fix this problem in the proper way.

Thanks for working on it at all!


-- 
Paul Hoadley
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

  • Follow-Ups:
    • Re: WOUnit testing with partial entities
      • From: Paul Hoadley <email@hidden>
References: 
 >Re: WOUnit testing with partial entities (From: Paul Hoadley <email@hidden>)
 >Re: WOUnit testing with partial entities (From: Paul Hoadley <email@hidden>)
 >Re: WOUnit testing with partial entities (From: Henrique Prange <email@hidden>)
 >Re: WOUnit testing with partial entities (From: Paul Hoadley <email@hidden>)
 >Re: WOUnit testing with partial entities (From: Henrique Prange <email@hidden>)

  • Prev by Date: Re: WOUnit testing with partial entities
  • Next by Date: Re: WOUnit testing with partial entities
  • Previous by thread: Re: WOUnit testing with partial entities
  • Next by thread: Re: WOUnit testing with partial entities
  • Index(es):
    • Date
    • Thread