Strategy for unit testing web applications [message #179012] |
Wed, 13 September 2006 09:34 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: gert.anova.be
L.S.,
We just started to use WTP for web application development and were
wondering about how to unit test these applications. You can have a
separate source folder for the unit tests, as you can have in any
regular Java project. However, the Java test classes are also getting
included in the WAR file. It's even worse if you have unit tests using
a dummy (HyperSonic or Derby) database instead of the production
database, as we do.
Is there a way to exclude the classes from some source folders from the
resulting WAR file? Or do we need to create a separate project to hold
the unit test for the war file?
Regards,
Gert Vanthienen
gert@anova.be
|
|
|
|
Re: Strategy for unit testing web applications [message #179037 is a reply to message #179029] |
Wed, 13 September 2006 13:13 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: gert.anova.be
Larry,
In fact I hadn't specified a separate output folder for the unit tests.
After doing this and changing the order of the source folders in
'Order and export', everything works fine!
Thanks for helping us out with this,
Gert Vanthienen
gert@anova.be
Larry Isaacs wrote:
> Assuming you also specified a separate output folder for the unit test
> source folder, you may also need to open the
> "org.eclipse.wst.common.component" file in the project's ".settings"
> folder and remove the <wb-resouce> element that is referencing your unit
> test folder as its "source-path". This should keep these classes from
> being included in the web application, and thus the WAR file.
>
> Cheers,
> Larry
>
> Gert Vanthienen wrote:
>> L.S.,
>>
>> We just started to use WTP for web application development and were
>> wondering about how to unit test these applications. You can have a
>> separate source folder for the unit tests, as you can have in any
>> regular Java project. However, the Java test classes are also getting
>> included in the WAR file. It's even worse if you have unit tests
>> using a dummy (HyperSonic or Derby) database instead of the production
>> database, as we do.
>>
>> Is there a way to exclude the classes from some source folders from
>> the resulting WAR file? Or do we need to create a separate project to
>> hold the unit test for the war file?
>>
>> Regards,
>>
>> Gert Vanthienen
>> gert@anova.be
|
|
|
Powered by
FUDForum. Page generated in 0.10048 seconds