在服务器上运行单元测试 (JAX-RS)

发布于 12-27 05:48 字数 374 浏览 4 评论 0原文

我正在编写一个 JAX-RS (Jersey+Maven) 应用程序,它执行一些棘手的操作(例如调用 WAR 中嵌入的本机可执行文件)。我需要在服务器(运行 Tomcat 7.0.22 的 Amazon Elastic Beanstalk)上运行[一些]单元测试 (JUnit4),以检查一切是否正常。

除了 RYO(自己动手)之外,是否有标准、灵活的方法可以做到这一点?我发现的事情似乎与开发人员机器上的集成测试(即 Jersey Test Framework)有更多关系。甚至 RYO 都让我感到困惑......我如何从源包调用测试包中的代码?

基本上,我想创建一个可以调用的 /test 资源,它将以漂亮的格式从服务器返回我的单元测试结果。如果我可以做 /test/{category} 就更好了

I am writing a JAX-RS (Jersey+Maven) application that does some tricky things (eg call native executables embedded in the WAR). I need to run [some of] my unit tests (JUnit4) on the server (Amazon Elastic Beanstalk running Tomcat 7.0.22) to check that everything is ok.

Is there a standard, flexible way of doing this other than RYO (roll your own)? The things I found seem to have more to do with integration testing on the developer machine (ie, Jersey Test Framework). Even RYO is confusing me... how could I call code in the Test Packages from Source Packages?

Basically, I want to create a /test resource that I can call that will return my unit test results from the server in a pretty format. Even better if I could do /test/{category}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文