• 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: WOApplication.primeApplication() deprecated
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >WOApplication.primeApplication() deprecated (From: Christian Pekeler <email@hidden>)
 >Re: WOApplication.primeApplication() deprecated (From: Hsu <email@hidden>)
 >Re: WOApplication.primeApplication() deprecated (From: Christian Pekeler <email@hidden>)
 >Re: WOApplication.primeApplication() deprecated (From: Hsu <email@hidden>)
 >Re: WOApplication.primeApplication() deprecated (From: Kaj Hejer <email@hidden>)
 >Re: WOApplication.primeApplication() deprecated (From: Hsu <email@hidden>)

  • Prev by Date: Re: WOApplication.primeApplication() deprecated
  • Next by Date: RE: Time zones are driving me CRAZY
  • Previous by thread: Re: WOApplication.primeApplication() deprecated
  • Next by thread: Re: WOApplication.primeApplication() deprecated
  • Index(es):
    • Date
    • Thread