This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Testing and the fly likes Unit testing of web component - Lot of tools Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » Testing
Bookmark "Unit testing of web component - Lot of tools" Watch "Unit testing of web component - Lot of tools" New topic
Author

Unit testing of web component - Lot of tools

Sam Gehouse
Ranch Hand

Joined: Jul 21, 2003
Posts: 281
I would like to learn about your experience on using the tools for writing unit test for web components.

What would be your suggestion for doing unit testing of web components for applications written using Struts 1 (running on WebSphere 5.1) and Struts 2 (running on WebSphere 6.1)?

There are a lot of choices for this. The names that stand out are:
1. HttpUnit
2. Spring's mock implementation for each key web interface e.g., MockHttpServletRequest, MockHttpServlet, MockHttpSession etc.
3. Cactus
4. HtmlUnit
5. Canoo
6. AppPerfect's free version that extends on JUnit and HttpUnit to create web based unit tests. http://www.appperfect.com/products/ut.pdf

There are many more listed under:
http://java-source.net/open-source/web-testing-tools

Again, the objective is to test web components. Junit is already in place.

With so many choices, it is difficult to settle down on one. Any of the above could be a feasible solution; as I am using Junit, Spring and have limited exposure to HttpUnit and Cactus.

But I wanted to learn about your experience on using tools for writing unit test for web components. Please share your thoughts.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42046
    
  64
My favorite is jWebUnit. It sits on top of HtmlUnit and gives it an easier-to-use (i.e., less code to write) and more powerful API.

HttpUnit operates on a lower level than HtmlUnit or jWebUnit (closer to HTTP than HTML - the name is appropriate), again meaning there's more code to write. Its JavaScript support is way behind HtmlUnit, and that's an area that's becoming ever more important.

Also check out Selenium. It can be used to create tests that can then be run either standalone, or from within jWebUnit. It's a very powerful tool.


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unit testing of web component - Lot of tools