Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用JwebUnit在 Web 应用程序中测试我的 JSP 页面。由于 JWebUnit 需要一个基本 url 才能工作。JwebUnit 必须setBaseUrl("http://localhost:8080/MyWebapp");设置用于@BeforeJunit 测试的基本 url。我需要在每次测试之前启动服务器并在那里部署 webapp,然后停止服务器。任何人都可以请建议我一个简单的方法来做到这一点Jetty或其他选项......
setBaseUrl("http://localhost:8080/MyWebapp");
@Before
Jetty
你可以看看Server Rule。它提供了一个启动和停止 Jetty Web 服务器的 JUnit 规则。