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