集成测试 Spring Web 应用程序
我需要在每次构建时对我的 Web 应用程序进行集成测试。
目前,我有一组 JUnit 测试,它们在构建应用程序之前测试应用程序的各个部分。 我现在需要做的是测试应用程序部署到 Web 容器后是否处于良好状态。
该应用程序是使用 Spring 框架编写的,我读过很多有关 Spring 集成测试的文档,但他们谈论的只是与数据库集成的测试等。我读过有关 Cactus 的信息,但信息也相当匮乏。
任何有关良好教程和源代码的指示都将受到赞赏。
应用程序使用的软件的详细信息:Spring 2.5、Hibernate 3.2、Maven 2.2、Tomcat 6.0
非常感谢!
I need to do an integration tests on my web application on each build.
Currently I have a set of JUnit tests, which tests various parts of an application before it constructed into war. What I need to do now is to test if application is in good shape after it is deployed into Web container.
The application is written using Spring framework, I've read a lot of docs about Spring integration testing, but all they talk is about testing of integration with databases etc. I've read about Cactus, but the info is pretty scarse as well.
Any pointers for a good tutorials and source code are appreciated.
Details of a software used by app: Spring 2.5, Hibernate 3.2, Maven 2.2, Tomcat 6.0
Many thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您有两个任务需要解决:A) 让容器在自动化(基于 Maven 的)进程中运行,B) 对其运行一些测试。
我们使用 selenium 和 maven-jetty-plugin 用于测试相当相似的应用程序设置。 奇迹般有效。 您可能会找到与 tomcat 相同类型的插件,或者只是在 jetty 中运行。
selenium 的优点是它允许您使用真实浏览器在非常真实环境中测试应用程序。 您可能会发现跳过“真实浏览器”部分的工具更容易上手。
You have two tasks to solve: A) Get the container running in an automated (maven based) process and B) run some tests against it.
We use selenium and maven-jetty-plugin for testing a fairly similar application setup. Works like a charm. You might find the same kind of plugins for tomcat, or just run in jetty.
The advantage of selenium is that it allows you to test the application in a very real environment with a real browser. You may find that tools that skip the "real browser" part are simpler to start with.