Re: WOApplication.primeApplication() deprecated
Re: WOApplication.primeApplication() deprecated
- Subject: Re: WOApplication.primeApplication() deprecated
- From: Kaj Hejer <email@hidden>
- Date: Fri, 21 Nov 2003 09:22:44 +0100
Hi!
Thank you for answering!
4)
Until now we have used
WOApplication.primeApplication(
NSBundle.mainBundle().bundlePath(), "Application");
in the setUp method of our junit testcases for WO apps.
NSBundle.mainBundle().bundlePath() is now deprecated, ref.
<url:http://developer.apple.com/documentation/WebObjects/Reference/API/com/webobjects/foundation/NSBundle.html#bundlePath()>
What should we use instead in setUp?
Depends on what you are using it for now... WOApps should almost
never need to invoke this. Can you describe a bit more what you are
using it for now?
Hi!
We are using junit tests for our eo-classes.
In our setUp method we have to call primeApplication
protected void setUp() throws Exception {
super.setUp();
editingContext().lock();
WOApplication.primeApplication(
NSBundle.mainBundle().bundlePath(), "Application");
}
When not having the primeApplication statement there we got alot of
strange errors when running our junit tests from ant or from inside
eclipse, like a ClassCastException on (Application)
WOApplication.application().
From what I have understood we have to tell our application to be
ready and up and running in some way before running the tests and
this is what primeApplication does when we not start the application
"the normal way" but run unitests on one class.
Please let me know if you want me to describe more that I have do
here. I didn't wrote more just to save some trees (well, bandwidth, I
guess ppl don't print out emails :).
just a little btw:
If some of you out there don't know about unit testing you maybe you
should run out and buy "Test Driven Development: By Example" by Kent
Beck (see
<url:http://www.amazon.com/exec/obidos/tg/detail/-/0321146530/103-1351737-2076641?v=glance>).
Very usefull stuff. Makes programming even more fun! :)
-Kaj :)
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.