
|
|
|||
StrutsTestCase Simplifies the Development ProcessBy Sunil Patil2005-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 |
||||
| About the NetVisits, Inc Network | Write For Us | Advertise Copyright ©2007 NetVisits, Inc Network. All Rights Reserved. Privacy Policy. |
Visit other NetVisits, Inc. sites: |