• 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
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unit testing


  • Subject: Re: Unit testing
  • From: Stefan Klein <email@hidden>
  • Date: Fri, 10 Oct 2008 14:04:29 +0200

Hi,

you can add a listener in your Application class.

For example:

...
public Application()
{
super();
...
NSNotificationCenter.defaultCenter().addObserver(this,
new NSSelector("modelAddedNotification", new Class[] { NSNotification.class }),
EOModelGroup.ModelAddedNotification, null);
...
}


public void modelAddedNotification(NSNotification notification)
{
      EOModel aModel = (EOModel) notification.object();
      NSMutableDictionary connDict;

      connDict = new NSMutableDictionary(aModel.connectionDictionary());
      // Set your connection stuff
      aModel.setConnectionDictionary(connDict);
}

Stefan


Logi Helguson schrieb:
Hi all,

   I want to perform a unit test against my development database.  I'm
configuring my database connection by setting the connection dictionary of
my model manually( model.setConnectionDictionary ) and adding the model to
the EOModelGroup.defaultGroup.

   When I fetch objects from my editing context( ERXEC.newEditingContext )
the model is connected to the deployment database( as set in the default
connection properties of the model ) but not my development database as I
set manually :(

   Any ideas what's the proper way to set the connection correctly?

With well-being and veneration,
Logi Helgu

 _______________________________________________
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

_______________________________________________
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: Unit testing
      • From: Mike Schrag <email@hidden>
References: 
 >Unit testing (From: Logi Helguson <email@hidden>)

  • Prev by Date: Re: Unit testing
  • Next by Date: Re: WORadioButton error
  • Previous by thread: Unit testing
  • Next by thread: Re: Unit testing
  • Index(es):
    • Date
    • Thread