---
title: "基于Junit2.0的StrutsTestCase应用"
author: "zzuizui"
date: "2005-11-16T17:23:18Z"
tags: [".net", "PHP", "Struts", "junit", "框架"]
slug: "junit2-0-strutstestcase"
draft: false
lastmod: "2005-11-16T17:23:18Z"
id: 23540
url: "https://zzuizui.iteye.com/blog/23540"
---

StrutsTestCase是基于Junit的一个方便测试struts框架的测试框架。它提供模拟对象（Mock Object）和Cactus两种方式来“真实”的运行Struts ActionServlet，它允许你在不启动servlet 引擎的情况下测试你的struts代码。因为strutstestcase可以用ActionServlet来测试你的代码，所以它不光可以测试你的action，同时它也可以测试你的（容器中的？）mapping,frombeans以及forwards声明。我前面曾提到过它对我们开发员来说是“透明的”，因为象action,mapping,form beans 以及forward等等，我们真的可以象在常规的XXXAction中一样在我们的测试代码中随意的使用它们。

       JavaDoc: <http://strutstestcase.sourceforge.net/api/index.html>

       热点论坛：<http://sourceforge.net/forum/forum.php?forum_id=121751>

       常见问题：<http://strutstestcase.sourceforge.net/faq.htm>