• 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: Proper Wonder/App Initialization for testing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proper Wonder/App Initialization for testing


  • Subject: Re: Proper Wonder/App Initialization for testing
  • From: Ray Kiddy <email@hidden>
  • Date: Mon, 21 Sep 2009 10:03:35 -0700


On Sep 21, 2009, at 8:55 AM, Greg Brown wrote:

Hi,

I converted an app to use Wonder, and I think my tests need do do something new so that all the Wonder stuff initializes properly.

This page:
http://wiki.objectstyle.org/confluence/display/WONDER/Integrate+Wonder+Into+an+Existing+Application

has nothing about tests ;>o


You are right and something can certainly be added. Have you seen http://wiki.objectstyle.org/confluence/display/WONDER/Testing and the pages it points to? If you have suggestions for content to add to those pages, I would be glad to discuss it. Or you can add whatever you think needs to be added.


Unit type tests seem to run fine without initializing the wonder frameworks, but database type (dbuinit) tests probably need the wonder stuff to be properly initialized.


I assume you mean dbunit, yes? How do you invoke the tests you have now? I looked at dbunit quite a while ago. Things are probably at the point where I should look at it again. For example, I was planning on making use of the Memory EOAdaptor in a bunch of tests.


I have just started to put junit tests that do EOF-ish stuff into the tests in the ERExtensions framework in Project Wonder, which can be checked out with svn. I have things set up to parameterize the tests so that we can run all the tests with one model, and then another and so on. There are, right now, some issues with running tests that use more than one EOAdaptor. So, I have checked in test that can parameterize on more than one model, but they do not.


ERXExtensions has a bunch of initApp, initEOF, initialize methods, which one is generally best for testNG / dbuinit initializations? Or do I need something like an initApp followed by a initEOF?


I am not sure you are looking at the right things, or I may not understand your question. One can initialize EOF by getting the default EOModelGroup (from the static defaultGroup() method), adding a model to it and fetching objects from that model. Or one can get an instance of an EOAdaptor (EOAdaptor.adaptorWithName()), set the connection dictionary properly, and call createAdaptorContext() on the adaptor to get a context, then createAdaptorChannel() on the context to get a channel and then opening the channel.


Basically, EOF is self-(lazily)-initializing. Or rather, it is as lazy as it can be.

How do people handle this? a @BeforeSuite annotation to a method which calls some er.extensions.ERXExtensions.initFoo()?


Again, it depends on how you are invoking the tests you have now.

We have different people who run different kinds of tests and invoke them in very different ways. I am trying to find methods of testing that span methods of test management and invocation. So, if you can explain what you want to do and you use tests and want to use tests, this will help broaden the use cases.

cheers - ray

_______________________________________________
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: 
 >Proper Wonder/App Initialization for testing (From: Greg Brown <email@hidden>)

  • Prev by Date: Re: Rewrite Rule
  • Next by Date: Re: AjaxAutoComplete - is it possible to have the equivalent of a noDisplayString?
  • Previous by thread: Proper Wonder/App Initialization for testing
  • Next by thread: Re: Proper Wonder/App Initialization for testing
  • Index(es):
    • Date
    • Thread