• 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: Database testing and EOF; junit testrunner environment;
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Database testing and EOF; junit testrunner environment;


  • Subject: Re: Database testing and EOF; junit testrunner environment;
  • From: Christian Pekeler <email@hidden>
  • Date: Fri, 7 Jul 2006 14:31:11 -0600

I am trying to set up DBUnit test AND test EO stuff also.

Why are you trying to test your database? It's generally easier to do programmatic unit testing without involving things like the database, network, or filesystem.



It seems the testrunner environment is very different than the normal environment that EOF operates under; I can't use EOF to do fetches. If I try,

java.lang.IllegalArgumentException: An object store for the entity "Patient" could not be found. Verify that the entity is defined in an EOModel, and that the model is installed properly. To see what models are loaded, you can try printing the return value of EOModelGroup.defaultGroup() in your application.

I guess your model needs to be loaded first. One way of doing it:
if (EOModelGroup.defaultGroup().modelNamed("foo") == null)
EOModelGroup.defaultGroup().addModelWithPathURL(new URL("FILE:/// Library/Frameworks/Foo.framework/Resources/foo.eomodeld"));



I looked at WOUnitTest,

but it has a WOOUTMAIN web component that calls
 public WOComponent saveSettings() {

This is an internal method of WOUnitTest to save your junit preferences. Unless you want to change or extend WOUnitTest, you should not concern yourself with the WOUTMain component.



So what does work for testing database/EOF?

Check out the WOUnitTestTest project that comes with WOUnitTest. Try to get it to work. Look at the ThingTestCase, and read the Javadoc. That should give you some ideas.



Christian

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: Database testing and EOF; junit testrunner environment;
      • From: Chuck Hill <email@hidden>
References: 
 >Database testing and EOF; junit testrunner environment; (From: Greg Brown <email@hidden>)

  • Prev by Date: Re: Webobjects-dev Digest, Vol 3, Issue 412
  • Next by Date: Re: Database testing and EOF; junit testrunner environment;
  • Previous by thread: Database testing and EOF; junit testrunner environment;
  • Next by thread: Re: Database testing and EOF; junit testrunner environment;
  • Index(es):
    • Date
    • Thread