从 JSP 运行 JUnit 集成测试?
我们需要对一些要在 Weblogic 服务器内运行的 Java 类进行一些集成测试。我们有一个运行一组 Junit 测试类的 JUnit 测试套件,我想知道编写一个运行测试套件并以图形方式打印结果的 JSP 是否是一个好主意,以防万一我们不会这样做。无法通过 SSH 访问服务器并通过控制台运行测试。
- 步骤 1:我们上传包含测试和 JSP 的 jar 文件
- 步骤 2:我们通过浏览器调用 JSP
- 步骤 3:利润!我们的测试正在运行,并且我们有视觉反馈。
我是对还是错?感谢您的建议!
we need to do some integration testing of some Java classes which we want to run inside a Weblogic server. We have a JUnit test suite that runs a set of Junit test classes, and I would like to know if is a good idea to write a JSP that runs the test suite and prints out the results in a graphical way, in case we won't be able to access via SSH to the server and run the tests via console.
- Step 1: We upload the jar file with the tests and the JSP
- Step 2: We call the JSP via a browser
- Step 3: Profit! Our tests are running and we have visual feedback.
Am I right or wrong? Thanks for your advices!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该能够使用 Cactus 来执行此操作,
请参阅以下文章以供参考:
http://www.oracle.com/technetwork/articles/server -side-unit-tests-096611.html
这应该可以让你不必编写额外的代码,不确定视觉反馈,但 Cactus 页面似乎建议在像 Tomcat 这样的 servlet 容器中运行时,你应该得到结果视觉上:
http://jakarta.apache.org/cactus/integration/howto_tomcat.html< /a>
You should be able to use Cactus to do this,
See the following article for reference:
http://www.oracle.com/technetwork/articles/server-side-unit-tests-096611.html
That should save you having to write extra code, not sure about visual feedback but the Cactus page seems to suggest that when running in a servlet container like Tomcat you should get the results visually:
http://jakarta.apache.org/cactus/integration/howto_tomcat.html