Re: JUnit for testing EOs
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:
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. :-)
(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