• 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: JUnit for testing EOs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JUnit for testing EOs


  • Subject: Re: JUnit for testing EOs
  • From: Chuck Hill <email@hidden>
  • Date: Wed, 28 Nov 2007 21:05:14 -0800


On Nov 28, 2007, at 8:50 PM, Paul Hoadley wrote:

On 29/11/2007, at 5:18 AM, Chuck Hill wrote:

If you are up to it, can you try this and post the output?

Comment out the add model code above and add these logs in the @Before method:

NSLog.out.appendln("Main bundle " + NSBundle.mainBundle());
NSLog.out.appendln("frameworkBundles " + NSBundle.frameworkBundles ().valueForKey("name"));
NSLog.out.appendln("frameworkBundle paths " + NSBundle.frameworkBundles());
NSLog.out.appendln("Loaded models " +EOModelGroup.defaultGroup ().modelNames());

I see a conspicuous empty list after "Loaded models"...


Main bundle <com.webobjects.foundation.NSBundle name:'JavaFoundation' bundlePath:'/System/Library/Frameworks/ JavaFoundation.framework' packages:'( com.webobjects.foundation,
com.webobjects.foundation.xml )' 214 classes >


Right there is the problem. The main bundle _should_ be the framework you are testing. JavaFoundation is one of the things it falls back to when all else fails.

The Project/dist/Project.framework/Resources/Java directory should be the working directory. The only thing it might be is that I always do an Ant build so I have a jar in that directory and you might only have .class files. It might that that NSBundle can't find the bundle if there is no jar, I don't recall.

You could try getting the current directory, creating a bundle with that path and using NSBundle._setMainBundle() to set it. Or just give up and create the model group manually. I suspect that without a correct bundle that other things might break. Something to keep in mind.

Chuck

--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects






_______________________________________________
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: 
 >JUnit for testing EOs (From: Paul Hoadley <email@hidden>)
 >Re: JUnit for testing EOs (From: Chuck Hill <email@hidden>)
 >Re: JUnit for testing EOs (From: Paul Hoadley <email@hidden>)
 >Re: JUnit for testing EOs (From: Chuck Hill <email@hidden>)
 >Re: JUnit for testing EOs (From: Paul Hoadley <email@hidden>)
 >Re: JUnit for testing EOs (From: Sam Barnum <email@hidden>)
 >Re: JUnit for testing EOs (From: Chuck Hill <email@hidden>)
 >Re: JUnit for testing EOs (From: Paul Hoadley <email@hidden>)
 >Re: JUnit for testing EOs (From: Chuck Hill <email@hidden>)
 >Re: JUnit for testing EOs (From: Paul Hoadley <email@hidden>)

  • Prev by Date: Re: JUnit for testing EOs
  • Next by Date: Re: Object with globalID could not be found in the database, when it is there ??
  • Previous by thread: Re: JUnit for testing EOs
  • Next by thread: Encouraging
  • Index(es):
    • Date
    • Thread