 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
phimalaya Guest
|
Posted: Fri Jun 23, 2006 1:23 am Post subject: how to run an individual module |
|
|
hi,
i have a jsp application built in jbuilder 2006. it is a complete app and
upon running it is configured to show me the log in jsp when.
now out of the complete package, i want to test a module which has a "main"
method. what should i do?
thx |
|
| Back to top |
|
 |
Paul Furbacher [TeamB] Guest
|
Posted: Fri Jun 23, 2006 8:12 am Post subject: Re: how to run an individual module |
|
|
phimalaya wrote:
| Quote: | i have a jsp application built in jbuilder 2006. it is a complete app and
upon running it is configured to show me the log in jsp when.
now out of the complete package, i want to test a module which has a "main"
method. what should i do?
|
It's not really clear what you are trying to do. Part of
the reason is that you are using the words "module" and
"package" in ways which are confusing. "Web module",
I would understand. But what's a module in this case?
Is it a class? A set of classes? The Web module itself?
Are you asking how to unit test a particular class?
Why, in a Web app, would you have a class which has
a "main()" method? If you have added the "main()"
method so that you can run the class to do testing,
that's not a best practice. You should write a
TestCase for that class, and run that test case
via a runtime configuration.
If the class depends upon servlet-related classes,
you will have to mock both the container and the
servlet-related classes. Spring has some very nice
servlet mock objects. (http://springframework.org)
--
Paul Furbacher (TeamB)
Save time, search the archives:
http://info.borland.com/newsgroups/ngsearch.html
Is it in Joi Ellis's Faq-O-Matic?
http://www.visi.com/~gyles19/fom-serve/cache/1.html
Finally, please send responses to the newsgroup only.
That means, do not send email directly to me.
Thank you. |
|
| Back to top |
|
 |
phimalaya Guest
|
Posted: Fri Jun 23, 2006 5:57 pm Post subject: Re: how to run an individual module |
|
|
thanks for your response. i found the solution.
"Paul Furbacher [TeamB]" <pfurbacher (AT) mac (DOT) com> wrote in message
news:449b5c45$1 (AT) newsgroups (DOT) borland.com...
| Quote: | phimalaya wrote:
i have a jsp application built in jbuilder 2006. it is a complete app and
upon running it is configured to show me the log in jsp when.
now out of the complete package, i want to test a module which has a
"main" method. what should i do?
It's not really clear what you are trying to do. Part of
the reason is that you are using the words "module" and
"package" in ways which are confusing. "Web module",
I would understand. But what's a module in this case?
Is it a class? A set of classes? The Web module itself?
Are you asking how to unit test a particular class?
Why, in a Web app, would you have a class which has
a "main()" method? If you have added the "main()"
method so that you can run the class to do testing,
that's not a best practice. You should write a
TestCase for that class, and run that test case
via a runtime configuration.
If the class depends upon servlet-related classes,
you will have to mock both the container and the
servlet-related classes. Spring has some very nice
servlet mock objects. (http://springframework.org)
--
Paul Furbacher (TeamB)
Save time, search the archives:
http://info.borland.com/newsgroups/ngsearch.html
Is it in Joi Ellis's Faq-O-Matic?
http://www.visi.com/~gyles19/fom-serve/cache/1.html
Finally, please send responses to the newsgroup only.
That means, do not send email directly to me.
Thank you. |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|