Java – unit test EJB

I'm looking for a way to apply TDD to session bean

Who can provide suggestions and links on how to unit test them?

How do I do this with JUnit?

P. S: I'm a novice in test driven development and session bean

I am using EJB v2

Solution

I assume you're talking about EJB 2 X session bean For these animals, what I like to do is:

>Using session beans as wrappers, you simply delegate the logic to POJOs that you can easily test outside the container External container testing is better, faster, easier, etc., but does not include things like deployment descriptor validation – and / or – > use something like cactus for in container testing (see howto EJB documentation) – and / or – > use cargo to build and deploy EJB modules for integration testing

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>