spacer
Web Development Tutorials JAVA Tutorials
 Developer Newsletter

Tutorials
AJAX
ASP
CGI & Perl
CSS
Flash
HTML
Illustrator
Java
JavaScript
Linux
MySQL
PHP
Photoshop
Python
Wireless
XML
Miscellaneous


Scripts Directory
AJAX Scripts
ASP Scripts
ASP.NET Scripts
CGI & Perl Scripts
Flash Scripts
Java Scripts
JavaScript Scripts
PHP Scripts
Python Scripts
Remotely Hosted Scripts
Tools & Utilities Scripts
XML Scripts

Web Hosting Directory
ASP.NET
Budget
Dedicated Servers
Ecommerce
Linux
Resellers
Shared
Small Business
Windows

Developer Manuals
Learn HTML
Learn PHP
Learn CSS
Learn AJAX
Learn JavaScript
Learn Pear
Free White Papers

Developer Resources
Developer Tools
Developer Content
Survey Software
Dedicated Servers




StrutsTestCase Simplifies the Development Process

By Sunil Patil
2005-04-28


Save Time by Using STC's Mock and Cactus Testing Approaches

This article introduces the StrutsTestCase (STC) framework and explains how to test a sample application using the mock approach and Cactus approach. Author Sunil Patil, a developer at the IBM Software Labs in India, introduces STC, then walks you through setting up an environment for using STC and testing various Struts features. He also demonstrates using both the Cactus and mock approaches from within STC.

Note: This article assumes familiarity with the Struts framework.

The StrutsTestCase (STC) framework is an open source framework for testing Struts-based Web applications. This framework allows you to test things like:

• Validation logic in your ActionForm class (the validate() method)
• Business logic in your Action class (the execute() method)
• Action Forwards
• Forward JSPs

STC supports two types of testing:

• Mock Approach -- In this approach, STC allows you to test your application without deploying it in an application server by mocking the container-provided object (HttpServletRequest, HttpServletResponse, and ServletContext).

• Cactus Approach -- In this approach, used during the integration testing phase, the application will be deployed in a container, and you will be able to run your test case like any other JUnit test case.

Tutorial Pages:
» Save Time by Using STC's Mock and Cactus Testing Approaches
» Sample Application
» Using the Mock Object Approach
» Advantages and Disadvantages of Mocking
» Cactus Approach
» Cactus Pros and Cons
» Conclusion
» Resources


First published by IBM DeveloperWorks


 | Bookmark Print |   Write For Us
Related Tutorials:
» All about JAXP, Part 1
» Make Database Queries Without the Database
» Load List Values for Improved Efficiency
» 2 Ways To Implement Session Tracking
» A Simple Way to Read an XML File in Java
» Develop Aspect-Oriented Java Applications with Eclipse and AJDT



About the NetVisits, Inc Network | Write For Us | Advertise
Copyright ©2007 NetVisits, Inc Network. All Rights Reserved. Privacy Policy.
Visit other NetVisits, Inc. sites: