Abstract:
JUnitEE is a simple extension to JUnit which allows standard test cases to be run from within a J2EE application server. JUnit provides the framework for writing your unit tests, and JUnitEE gives you the possibility to run these tests inside your application server. This has the advantage of testing your EJB/servlet-based application in the same environment it will run when in production
But I hate JUnitee, for what people really need is "run test without application server", the existing of JUnitee gives guys a peg to give up improving their design to make testing easier, and much time is wasted on deploying/starting/stopping/undeploying, even it is automatic.
Test Approach:
Step 1, Package JUnitee and your test code with the application to be tested.
Step 2, Start application server
Step 3, Deploy the package
Step 4, Run tests via JUnitee servlet
Step 5, Undeploy the package
Step 6, Stop application server
Practice:
1, Cooperate with XDoclet to automated Step 1: provide a subclass of org.junite.servlet.JUnitEEServlet which labeled with @web and @ejbref
2, Cooperate with Ant <exec> and application server script to automated Step 2,3,5,6
3, Cooperate with Cactus to automated Step 4, and make cycle for Step 3,4,5
4, Cooperate with Ant script to automated all Steps
User Guide:
http://www.junitee.org/usersguide.html
Ant How To:
http://www.junitee.org/antguide.html
JUnitEE在应用服务器中运行测试的探讨
JUnitEE是JUnit的简单扩展,可让标准测试用例在J2EE应用服务器内运行。它能在生产环境中测试基于EJB/ servlet的应用,但也有人认为它会让人放弃改进设计以方便测试,且部署等操作浪费时间。还介绍了测试步骤及与XDoclet的协作实践。
889

被折叠的 条评论
为什么被折叠?



