• 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: Unit testing & loading models
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unit testing & loading models


  • Subject: Re: Unit testing & loading models
  • From: Chuck Hill <email@hidden>
  • Date: Tue, 11 Nov 2008 11:14:14 -0800

Hi Logi,


On Nov 11, 2008, at 6:26 AM, Logi Helguson wrote:

I created a setUp for my Unit test to load the models I needed:

// add eomodels

NSArray<String> models = new NSArray<String>( new String[] { "MY_MODEL" } );

String path = getClass().getResource( "/" ).toString();

path = path.replace( "bin/", "" );

// now we should be at the workspace, add location for EOModles
path = path.concat( "/Resources/" );
for( String model : models ) {
if( EOModelGroup.defaultGroup().modelNamed( model ) == null )
{
EOModelGroup.defaultGroup().addModelWithPathURL( new URL( path +
model + ".eomodeld" ) );
}
}

How is the classpath for launching the unit tests setup? If the .framework/Resources/Java of framework being tested and all referenced frameworks is on the classpath, the models should get loaded automatically.



We have a principal class that connects the emodels to the development or
the deployment DB.


I noticed that if my setUp only contains EOModelGroup.defaultGroup() all my
models are loaded and I'm pretty shure that this didn't happen before.

That is what _should_ happen if your classpath is setup as I indicated above. Have you change the classpath at all or updated to New Hotness since you last tried this?



Can anyone enlighten me or even better tell me how you set up your tests or
how I should set them up ;)


P.s. Project Wonder( max 5 days old version ), Eclipse & WOLips 3.4.

It sounds like it is correct as is.


With well-being and veneration,

I do so enjoy being venerated, as undeserving as I may be. :-)

Chuck


-- Chuck Hill Senior Consultant / VP Development

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: 
 >Unit testing & loading models (From: Logi Helguson <email@hidden>)

  • Prev by Date: Spell Check with WebObjects [Bug in ERXGoogleSpell API]
  • Next by Date: Re: Spell Check with WebObjects [Bug in ERXGoogleSpell API]
  • Previous by thread: Unit testing & loading models
  • Next by thread: MEETING: Chicago CocoaHeads/CAWUG Tuesday November 11th
  • Index(es):
    • Date
    • Thread