Programming JUnitee

来源:互联网 发布:淘宝网人参是真的吗 编辑:程序博客网 时间:2024/05/17 04:51

 

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

 

原创粉丝点击