Re: Junittests, JavaMail and language-specific Components
Re: Junittests, JavaMail and language-specific Components
- Subject: Re: Junittests, JavaMail and language-specific Components
- From: Sacha Mallais <email@hidden>
- Date: Mon, 13 Jun 2005 09:32:03 -0700
On Jun 12, 2005, at 10:45 PM, Michael Holtermann wrote:
I'm trying to develop an application using test driven development
methods.
The application contains a number of language-dependent components (in
English.lproj and German.lproj), some packages (components, pages,
model) and
JavaMail to send some notifications.
Until the splitting into languages my testcases run quite well, by
creating an
Application, a Session, WOContext and simply instantiating the
component.
But since the split-up I'll get a NullPointerException, if I try to
create the
component.
Make sure that the classpath is correct, in particular, make sure the
built framework itself is on the classpath so that running tests can
find resources in the correct place.
By giving WOUnitTest a chance things turned more funny...
If I call (AddButton)WOUTTestCase#pageWithName
("component.AddButton") I'll get
a ClassCastException: javax.mail.Session is not a subclass of
WOSession. Ups.
It's looking for a class called "Session" and javax.mail.Session is
the only one it found. Make sure your classpath is correct and try
reordering it so that your framework's jar comes first.
It seems that WebObjects flatten *all* classes into one big
package. What a
nice idea... :-/
You mean xCode or Eclipse makes your classes into one big package.
Yes. What were you expecting?
While calling (AddButton)WOUTTestCase#pageWithName("AddButton")
(without the
package) a ClassCastException on a WOComponent occurs, without the
cast this
method returns a WOComponent with the name "AddButton", but this is
useless
since I'm going to test my custom component, not WOComponent.
If you're talking about the same class cast exception as above (the
one for Session), then fixing up your classpath should work for this
too.
So, the simple question at the end:
How do you test components, that resides in a language-folder?
Make sure your classpath is correct. :-)
Cheers,
sacha
_______________________________________________
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