[英]What's the difference between the different Jersey test containers?
According to http://jersey.java.net/nonav/apidocs/latest/jersey/jersey-test-framework/jersey-test-framework-core/com/sun/jersey/test/framework/JerseyTest.html users may choose between two kinds of test containers: 根据http://jersey.java.net/nonav/apidocs/latest/jersey/jersey-test-framework/jersey-test-framework-core/com/sun/jersey/test/framework/JerseyTest.html,用户可以选择在两种测试容器之间:
I have the following questions: 我有以下问题:
UPDATE : 更新 :
Upon further research I discovered that low-level containers are faster but they really run without servlets. 经过进一步的研究,我发现低级容器速度更快,但实际上它们没有Servlet即可运行。 When clients make requests,a the appropriate Resources are constructed and the response is passed back to the client, all in-memory.
当客户端发出请求时,将构建适当的资源,并将响应全部传递回客户端。 This is similar to running an embedded database versus a conventional network-based JDBC connection.
这类似于运行嵌入式数据库,而不是运行基于常规网络的JDBC连接。
There is no mechanism to supply a ServletContextListener, register servlets or filters. 没有提供ServletContextListener,注册Servlet或过滤器的机制。 I'm guessing the request scope isn't supported either.
我猜测请求范围也不被支持。
My question is, can you really test anything meaningful under these restrictions? 我的问题是,在这些限制下,您真的可以测试任何有意义的东西吗?
"... can you really test anything meaningful under these restrictions..." “ ...您真的可以在这些限制下测试任何有意义的东西吗?”
You can test your business logic, and do it quicker. 您可以测试您的业务逻辑,并更快地进行。
(Would like to see this fixed though: JERSEY-622 . The in-memory test container doesn't support Jackson, ie the POJO-mapping feature of Jersey.) (不过,我们希望看到此修复程序: JERSEY-622 。内存中的测试容器不支持Jackson,即Jersey的POJO映射功能。)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.