The jetty servlet container is quick and light enough to run in unit tests (indeed I do to serve up files).
It is possible to install actual servlets into it, programmatically (say in a test) and have it run them?
Yes. We do this on a regular basis with a number of tools. The simpest is probably HTTP-unit . When we deploy in jetty, we usually deploy larger parts of the application and run Selenium . HttpUnit is the simplest, but at some point your application complexity may warrant a more complete deployment. See the documentation section on embedding jetty
为什么不使用任何HttpUnit, HTMLUnit等。创建一个ANT脚本来执行运行测试所需的一切。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.