• 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: JUnit for testing EOs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JUnit for testing EOs


  • Subject: Re: JUnit for testing EOs
  • From: Paul Hoadley <email@hidden>
  • Date: Tue, 27 Nov 2007 20:30:59 +1030

Hi Chuck,

On 27/11/2007, at 5:04 PM, Chuck Hill wrote:

Add it to User Entries. It also needs to go above the other entries in the class path. If the model (or any other resource) is in a framework, you also need to add the Resources/Java dir for that to User Entries above the default stuff.

Hmm, well AFAICS I've done that:

<pastedGraphic.png>

Yes, that looks correct. Can you take a look in /AM/build/AM.woa/ Contents/Resources to ensure the eomodel is in there and has the entities.

Certainly seems to be. Here's one of the eomodels and its entities:

PNG image




Something also may have changed in WO. I have a rather, er, funky build setup and run the Ant builder at each build. So I always have a properly formed framework. If you are using the incremental builder (as most people are), the problem might be related to this.

I presume I am, if most people are. I've done nothing but install Eclipse, WOLips, WO5.4 and start some projects.


I don't think so, but it might be. It is definitely related to NSBundle resource loading and NSBundle is very path sensitive.

The models are not in frameworks. I am still getting "Unabled [sic!] to find an EOClassDescription".

I love that error message. :-)

Hmmm, just registered that this is an application. I never (or darn rarely) unit test apps.

Oh OK. Although I've used JUnit before in a different context, I really am just trying to bootstrap myself up from zero here. If there's a better way, by all means correct me! All I've done so far is written a single test class with the intention of testing a single entity class (which actually refers to two others, so three in total). They're all in the same Auth.eomodel up there. So if it looks like I'm trying to unit test the app, that's unintentional. How do I just test a class from a single model?


Does adding /AM/build/AM.woa/Contents/ to the build path help? Try making that the working directory on the arguments tab.

If this looks right, then no, it didn't help. :-)

PNG image





(As an aside, do I need to go through this for every single test class I create?)

Not sure what you are doing there... I create a "AllTestsSuite.java" for each project and have that instantiate the test classes. So I only need to set up the launcher once for each project, for AllTestsSuite. Does that make sense?

Yes it does. I'm also pretty new to JUnit, and was just trying to get a single test class going.


To be honest, I'm not wedded to the idea of JUnit. If TestNG is simpler to get going, I'll go take a look at that instead.

It is not going to fix this NSBundle finding its resources issue.

Well, I'm happy to press on if you and the list can be bothered remotely debugging this. :-)



-- Paul.

w  http://logicsquad.net/
h  http://paul.hoadley.name/


 _______________________________________________
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: JUnit for testing EOs
      • From: Sam Barnum <email@hidden>
References: 
 >JUnit for testing EOs (From: Paul Hoadley <email@hidden>)
 >Re: JUnit for testing EOs (From: Chuck Hill <email@hidden>)
 >Re: JUnit for testing EOs (From: Paul Hoadley <email@hidden>)
 >Re: JUnit for testing EOs (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: Object with globalID could not be found in the database, when it is there ??
  • Next by Date: Deadlock [Fixed - we think!]
  • Previous by thread: Re: JUnit for testing EOs
  • Next by thread: Re: JUnit for testing EOs
  • Index(es):
    • Date
    • Thread