毕业论文

打赏
当前位置: 毕业论文 > 计算机论文 >

Struts2构件自动测试技术研究及应用

时间:2021-04-14 19:41来源:毕业论文
研究Struts2 Action类的自动化测试方法,通过研究JUnit单元测试方法以及相关技术,能够在不依赖J2EE容器的情况下,执行测试用例,并给出可靠的测试结果,并应用于一个具体的项目中

摘要Struts2是J2EE系统开发中应用最广泛的MVC方案之一。一个大型复杂J2EE/Web应用系统中往往包含大量的Struts构件,带Struts标记指令的JSP视图、相应Action类、配置文件,这些构件难以采用一般性JUnit单元测试来执行,需要部署在J2EE容器中才能运行,但部署运行测试需要较长周期,而且要依赖客户端Web浏览器,自动化测试性能低下。65595

本文研究Struts2 Action类的自动化测试方法,通过研究JUnit单元测试方法以及相关技术,能够在不依赖J2EE容器的情况下,执行测试用例,并给出可靠的测试结果,并应用于一个具体的项目中。

毕业论文关键词  JUnit  单元测试  Action

毕业设计说明书(论文)外文摘要

Title        JUnit application testing technology           

Abstract

Struts2 J2EE system development is the most widely used one of the MVC program. A large and complex application systems J2EE/Web often contain a large number of Struts components with a JSP Struts tags instruction view, the corresponding Action class, configuration files, these components difficult to adopt a general JUnit unit tests to perform, you need to be deployed in a J2EE container run, but run the tests take a long deployment cycles, but also on a client Web browser, automated testing poor performance.

In this paper, Struts2 Action class automated testing methods, through research JUnit unit testing methods and related technology that does not rely on the case of a J2EE container, execute test cases, and gives reliable test results, and applied to a specific project .

Keywords  JUnit  unit test  Action

目次

1 绪论 4

1.1 研究现状 4

1.1.1 Struts2现状简介 4

1.1.2 JUnit现状简介 5

1.2 本文研究内容及意义 6

1.3 本文组织结构 7

2 JUnit原理及相关技术 8

2.1  JUnit原理 8

2.2  测试框架 11

2.3  Mock对象 11

2.3  本章小结 12

3 针对Struts2Action类的测试方法 13

3.1  Struts2框架结构 13

3.2  Struts构件中Action类 13

3.2.1 概念 13

3.2.2 作用 14

3.3.3 Action的生命周期 14

3.3  Action类测试的重要性 15

3.4  对Action类测试 15

3.4.1  不需要外部资源的Action测试 15

3.4.2  需要外部资源的Action测试 16

3.4.3  测试难点 17

3.5  几个典型的例子 17

3.5.1 普通Action类的测试实例 17

3.5.2 涉及数据库访问的Action类测试实例 18

3.6  进行容器外测试的意义 20

3.7  本章小结 20

4测试应用实例 Struts2构件自动测试技术研究及应用:http://www.751com.cn/jisuanji/lunwen_73282.html

------分隔线----------------------------
推荐内容