51Testing软件测试论坛

标题: 如何测试EJB [打印本页]

作者: lummyliao    时间: 2005-1-21 16:50
标题: 如何测试EJB
try MockEJB:

MockEJB is a lightweight framework for running EJBs. MockEJB implements javax.ejb APIs and creates Home and EJBObject implementation classes for your EJBs. Internally, MockEJB relies on dynamic proxies and interceptors. MockEJB has two primary usages:
It allows for running EJBs outside of the container for unit testing.You can run EJBs directly from your favorite IDE with the minimal setup effort.
It allows for deploying mock EJBs (i.e., mock EJB implementation classes) into the container. Mock EJBs provide very effective way of isolating EJBs under test from the rest of the application. Mock EJBs return predefined test data and can override the actual "non-mock" deployed EJBs. Once again, the purpose of MockEJB is twofold and it works inside and outside of the container. So you can benefit from it even if you continue running all your test classes inside the container using Cactus.

Additionally, MockEJB comes with the "mock" implementation of non-EJB APIs. Currently it provides in-memory JNDI and JMS implementations which can be used independently from MockEJB's EJB support.

MockEJB is not a full-blown EJB container. It does not fully implement J2EE/EJB specs, however it supports all vital APIs.

http://mockejb.sourceforge.net/
作者: testing26    时间: 2010-2-1 14:25
EJB 让人头疼




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2